Details coming soon.

This commit is contained in:
Paulchen-Panther
2018-12-27 23:11:32 +01:00
parent e3be03ea73
commit d762aa2f3e
186 changed files with 6156 additions and 5444 deletions

View File

@@ -416,6 +416,7 @@
"edt_conf_enum_PAL" : "PAL",
"edt_conf_enum_NTSC" : "NTSC",
"edt_conf_enum_SECAM" : "SECAM",
"edt_conf_enum_NO_CHANGE" : "Auto",
"edt_conf_enum_logsilent" : "Stille",
"edt_conf_enum_logwarn" : "Warnung",
"edt_conf_enum_logverbose" : "Ausführlich",
@@ -486,14 +487,8 @@
"edt_conf_v4l2_input_expl" : "Der Eingang des Pfades.",
"edt_conf_v4l2_standard_title" : "Videoformat",
"edt_conf_v4l2_standard_expl" : "Wähle das passende Videoformat deiner Region.",
"edt_conf_v4l2_width_title" : "Breite",
"edt_conf_v4l2_width_expl" : "Die Breite des Bildes. (-1 = Automatische Breitenbestimmung)",
"edt_conf_v4l2_height_title" : "Höhe",
"edt_conf_v4l2_height_expl" : "Die Höhes des Bildes. (-1 = Automatische Höhenbestimmung)",
"edt_conf_v4l2_frameDecimation_title" : "Bildverkleinerung",
"edt_conf_v4l2_frameDecimation_expl" : "Der Faktor der Bildverkleinerung",
"edt_conf_v4l2_sizeDecimation_title" : "Größenänderung",
"edt_conf_v4l2_sizeDecimation_expl" : "Der Faktor der Größenänderung",
"edt_conf_v4l2_sizeDecimation_title" : "Bildverkleinerung Faktor",
"edt_conf_v4l2_sizeDecimation_expl" : "Der Faktor der Bildverkleinerung ausgehend der von der ursprünglichen Größe, 1 bedeutet keine Änderung (originales Bild).",
"edt_conf_v4l2_cropLeft_title" : "Entferne links",
"edt_conf_v4l2_cropLeft_expl" : "Anzahl der Pixel auf der linken Seite die vom Bild entfernt werden.",
"edt_conf_v4l2_cropRight_title" : "Entferne rechts",
@@ -503,7 +498,7 @@
"edt_conf_v4l2_cropBottom_title" : "Entferne unten",
"edt_conf_v4l2_cropBottom_expl" : "Anzahl der Pixel auf der unteren Seite die vom Bild entfernt werden.",
"edt_conf_v4l2_signalDetection_title" : "Signal Erkennung",
"edt_conf_v4l2_signalDetection_expl" : "Wenn aktiviert, wird die USB Aufnahme temporär bei \"kein Signal\" abgeschalten. Das Bild muss dazu 4 Sekunden lang unter die Schwellwerte fallen.",
"edt_conf_v4l2_signalDetection_expl" : "Wenn aktiviert, wird die USB Aufnahme temporär bei \"kein Signal\" abgeschalten.",
"edt_conf_v4l2_redSignalThreshold_title" : "Rote Signalschwelle",
"edt_conf_v4l2_redSignalThreshold_expl" : "Je höher die rote Schwelle je eher wird abgeschalten bei entsprechendem rot-Anteil.",
"edt_conf_v4l2_greenSignalThreshold_title" : "Grüne Signalschwelle",
@@ -523,16 +518,12 @@
"edt_conf_fg_type_expl" : "Art der Plattform Aufnahme, standard ist 'auto'",
"edt_conf_fg_frequency_Hz_title" : "Aufnahmefrequenz",
"edt_conf_fg_frequency_Hz_expl" : "Wie schnell neue Bilder aufgenommen werden.",
"edt_conf_fg_horizontalPixelDecimation_title" : "Horizontale Pixelreduzierung",
"edt_conf_fg_horizontalPixelDecimation_expl" : "Horizontale Pixelreduzierung (Faktor)",
"edt_conf_fg_useXGetImage_title" : "Nutze XGetImage",
"edt_conf_fg_useXGetImage_expl" : "XGetImage für aktuelle X11 desktops",
"edt_conf_fg_width_title" : "Breite",
"edt_conf_fg_width_expl" : "Verkleinere Bild auf dieser Breite, da das Rohmaterial viel Leistung benötigen würde.",
"edt_conf_fg_height_title" : "Höhe",
"edt_conf_fg_height_expl" : "Verkleinere Bild auf dieser Höhe, da das Rohmaterial viel Leistung benötigen würde.",
"edt_conf_fg_verticalPixelDecimation_title" : "Vertikale Pixelreduzierung",
"edt_conf_fg_verticalPixelDecimation_expl" : "Vertikale Pixelreduzierung (Faktor)",
"edt_conf_fg_pixelDecimation_title" : "Bildverkleinerung Faktor",
"edt_conf_fg_pixelDecimation_expl" : "Bildverkleinerung (Faktor) ausgehend von der original Größe. 1 für unveränderte/originale Größe.",
"edt_conf_fg_device_title" : "Device",
"edt_conf_fg_display_title" : "Display",
"edt_conf_fg_display_expl" : "Gebe an von welchem Desktop aufgenommen werden soll. (Multi Monitor Setup)",

View File

@@ -417,6 +417,7 @@
"edt_conf_enum_PAL" : "PAL",
"edt_conf_enum_NTSC" : "NTSC",
"edt_conf_enum_SECAM" : "SECAM",
"edt_conf_enum_NO_CHANGE" : "Auto",
"edt_conf_enum_logsilent" : "Silent",
"edt_conf_enum_logwarn" : "Warning",
"edt_conf_enum_logverbose" : "Verbose",
@@ -504,7 +505,7 @@
"edt_conf_v4l2_cropBottom_title" : "Crop bottom",
"edt_conf_v4l2_cropBottom_expl" : "Count of pixels on the bottom side that are removed from the picture.",
"edt_conf_v4l2_signalDetection_title" : "Signal detection",
"edt_conf_v4l2_signalDetection_expl" : "If enabled, usb capture will be temporarily disabled when no signal was found. This will happen when the picture fall below the threshold value for a period of 4 seconds.",
"edt_conf_v4l2_signalDetection_expl" : "If enabled, usb capture will be temporarily disabled when no signal was found.",
"edt_conf_v4l2_redSignalThreshold_title" : "Red signal threshold",
"edt_conf_v4l2_redSignalThreshold_expl" : "Darkens low red values (recognized as black)",
"edt_conf_v4l2_greenSignalThreshold_title" : "Green signal threshold",
@@ -524,16 +525,12 @@
"edt_conf_fg_type_expl" : "Type of platform capture, default is 'auto'",
"edt_conf_fg_frequency_Hz_title" : "Capture frequency",
"edt_conf_fg_frequency_Hz_expl" : "How fast new pictures are captured",
"edt_conf_fg_horizontalPixelDecimation_title" : "Horizontal pixel decimation",
"edt_conf_fg_horizontalPixelDecimation_expl" : "Horizontal pixel decimation (factor)",
"edt_conf_fg_width_title" : "Width",
"edt_conf_fg_width_expl" : "Shrink picture to this width, as raw picture needs a lot of cpu time.",
"edt_conf_fg_height_title" : "Height",
"edt_conf_fg_height_expl" : "Shrink picture to this height, as raw picture needs a lot of cpu time.",
"edt_conf_fg_useXGetImage_title" : "Use XGetImage",
"edt_conf_fg_useXGetImage_expl" : "XGetImage for newer X11 desktops",
"edt_conf_fg_verticalPixelDecimation_title" : "Vertical pixel decimation",
"edt_conf_fg_verticalPixelDecimation_expl" : "Vertical pixel decimation (factor)",
"edt_conf_fg_pixelDecimation_title" : "Picture decimation",
"edt_conf_fg_pixelDecimation_expl" : "Reduce picture size (factor) based on original size. A factor of 1 means no change",
"edt_conf_fg_device_title" : "Device",
"edt_conf_fg_display_title" : "Display",
"edt_conf_fg_display_expl" : "Select which desktop should be captured (multi monitor setup)",

View File

@@ -31,6 +31,9 @@
<script src="js/lib/bootstrap-colorpicker.min.js"></script>
<link href="css/bootstrap-colorpicker.min.css" rel="stylesheet">
<!-- BS Notfiy -->
<script src="js/lib/bootstrap-notify.min.js"></script>
<!-- JSONEditor -->
<script src="js/lib/jsoneditor.js"></script>

View File

@@ -1,6 +1,6 @@
$(document).ready( function() {
performTranslation();
function newsCont(t,e,l)
{
var h = '<div style="padding-left:9px;border-left:6px solid #0088cc;">';
@@ -10,7 +10,7 @@ $(document).ready( function() {
h += '</div><hr/>';
$('#dash_news').append(h);
}
function createNews(d)
{
for(var i = 0; i<d.length; i++)
@@ -21,11 +21,11 @@ $(document).ready( function() {
title = d[i].title.rendered;
excerpt = d[i].excerpt.rendered;
link = d[i].link+'?pk_campaign=WebUI&pk_kwd=news_'+d[i].slug;
newsCont(title,excerpt,link);
}
}
function getNews()
{
var h = '<span style="color:red;font-weight:bold">'+$.i18n('dashboard_newsbox_noconn')+'</span>';
@@ -45,30 +45,31 @@ $(document).ready( function() {
$('#dash_news').html(h);
});
}
//getNews();
function updateComponents()
{
var components = serverInfo.components;
var components = comps;
components_html = "";
for ( idx=0; idx<components.length;idx++)
{
components_html += '<tr><td>'+$.i18n('general_comp_'+components[idx].name)+'</td><td><i class="fa fa-circle component-'+(components[idx].enabled?"on":"off")+'"></i></td></tr>';
if(components[idx].name != "ALL")
components_html += '<tr><td>'+$.i18n('general_comp_'+components[idx].name)+'</td><td><i class="fa fa-circle component-'+(components[idx].enabled?"on":"off")+'"></i></td></tr>';
}
$("#tab_components").html(components_html);
//info
$('#dash_statush').html(serverInfo.hyperion.off? '<span style="color:red">'+$.i18n('general_btn_off')+'</span>':'<span style="color:green">'+$.i18n('general_btn_on')+'</span>');
$('#btn_hsc').html(serverInfo.hyperion.off? '<button class="btn btn-sm btn-success" onClick="requestSetComponentState(\'ALL\',true)">'+$.i18n('dashboard_infobox_label_enableh')+'</button>' : '<button class="btn btn-sm btn-danger" onClick="requestSetComponentState(\'ALL\',false)">'+$.i18n('dashboard_infobox_label_disableh')+'</button>');
$('#dash_statush').html(serverInfo.hyperion.enabled ? '<span style="color:green">'+$.i18n('general_btn_on')+'</span>' : '<span style="color:red">'+$.i18n('general_btn_off')+'</span>');
$('#btn_hsc').html(serverInfo.hyperion.enabled ? '<button class="btn btn-sm btn-danger" onClick="requestSetComponentState(\'ALL\',false)">'+$.i18n('dashboard_infobox_label_disableh')+'</button>' : '<button class="btn btn-sm btn-success" onClick="requestSetComponentState(\'ALL\',true)">'+$.i18n('dashboard_infobox_label_enableh')+'</button>');
}
// add more info
$('#dash_leddevice').html(serverInfo.ledDevices.active);
$('#dash_currv').html(currentVersion);
$('#dash_instance').html(serverConfig.general.name);
$('#dash_ports').html(jsonPort+' | '+serverConfig.protoServer.port);
$.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/version.json", function( data ) {
parsedUpdateJSON = JSON.parse(data);
latestVersion = parsedUpdateJSON[0].versionnr;
@@ -76,13 +77,13 @@ $(document).ready( function() {
var cleanCurrentVersion = currentVersion.replace(/\./g, '');
// $('#dash_latev').html(latestVersion);
// if ( cleanCurrentVersion < cleanLatestVersion )
// $('#versioninforesult').html('<div class="bs-callout bs-callout-warning" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatewarning', latestVersion)+'</div>');
// else
$('#versioninforesult').html('<div class="bs-callout bs-callout-success" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
});
//determine platform
var grabbers = serverInfo.grabbers.available;
var html = "";
@@ -97,16 +98,16 @@ $(document).ready( function() {
html += 'Amlogic';
else
html += 'Framebuffer';
$('#dash_platform').html(html);
$('#dash_platform').html(html);
//interval update
updateComponents();
$(hyperion).on("cmd-serverinfo",updateComponents);
$(hyperion).on("components-updated",updateComponents);
if(showOptHelp)
createHintH("intro", $.i18n('dashboard_label_intro'), "dash_intro");
removeOverlay();
});
});

View File

@@ -121,7 +121,10 @@ $(document).ready( function() {
}
//interval update
$(hyperion).on("cmd-serverinfo",updateEffectlist);
$(hyperion).on("cmd-effects-update", function(event){
serverInfo.effects = event.response.data.effects
updateEffectlist();
});
removeOverlay();
});

View File

@@ -171,7 +171,10 @@ $(document).ready( function() {
updateDelEffectlist();
//interval update
$(hyperion).on("cmd-serverinfo",updateDelEffectlist);
$(hyperion).on("cmd-effects-update", function(event){
serverInfo.effects = event.response.data.effects
updateDelEffectlist();
});
removeOverlay();
});

View File

@@ -2,7 +2,8 @@ $(document).ready( function() {
performTranslation();
var conf_editor_v4l2 = null;
var conf_editor_fg = null;
var conf_editor_instCapt = null;
function hideEl(el)
{
for(var i = 0; i<el.length; i++)
@@ -10,14 +11,19 @@ $(document).ready( function() {
$('[data-schemapath*="root.framegrabber.'+el[i]+'"]').toggle(false);
}
}
if(showOptHelp)
{
//fg
$('#conf_cont').append(createRow('conf_cont_instCapt'))
$('#conf_cont_instCapt').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
$('#conf_cont_instCapt').append(createHelpTable(schema.instCapture.properties, $.i18n("edt_conf_instCapture_heading_title")));
//fg
$('#conf_cont').append(createRow('conf_cont_fg'))
$('#conf_cont_fg').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
$('#conf_cont_fg').append(createHelpTable(schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
//v4l
$('#conf_cont').append(createRow('conf_cont_v4l'))
$('#conf_cont_v4l').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
@@ -26,10 +32,24 @@ $(document).ready( function() {
else
{
$('#conf_cont').addClass('row');
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
}
//instCapt
conf_editor_instCapt = createJsonEditor('editor_container_instCapt', {
instCapture: schema.instCapture
}, true, true);
conf_editor_instCapt.on('change',function() {
conf_editor_instCapt.validate().length ? $('#btn_submit_instCapt').attr('disabled', true) : $('#btn_submit_instCapt').attr('disabled', false);
});
$('#btn_submit_instCapt').off().on('click',function() {
requestWriteConfig(conf_editor_instCapt.getValue());
});
//fg
conf_editor_fg = createJsonEditor('editor_container_fg', {
framegrabber: schema.framegrabber
@@ -38,11 +58,11 @@ $(document).ready( function() {
conf_editor_fg.on('change',function() {
conf_editor_fg.validate().length ? $('#btn_submit_fg').attr('disabled', true) : $('#btn_submit_fg').attr('disabled', false);
});
$('#btn_submit_fg').off().on('click',function() {
requestWriteConfig(conf_editor_fg.getValue());
});
//vl4
conf_editor_v4l2 = createJsonEditor('editor_container_v4l2', {
grabberV4L2 : schema.grabberV4L2
@@ -51,32 +71,31 @@ $(document).ready( function() {
conf_editor_v4l2.on('change',function() {
conf_editor_v4l2.validate().length ? $('#btn_submit_v4l2').attr('disabled', true) : $('#btn_submit_v4l2').attr('disabled', false);
});
$('#btn_submit_v4l2').off().on('click',function() {
requestWriteConfig(conf_editor_v4l2.getValue());
});
//create introduction
if(showOptHelp)
{
createHint("intro", $.i18n('conf_grabber_fg_intro'), "editor_container_fg");
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2");
}
//hide specific options
conf_editor_fg.on('ready',function() {
var grabbers = serverInfo.grabbers.available;
if(grabbers.indexOf('dispmanx') > -1)
hideEl(["device","verticalPixelDecimation","horizontalPixelDecimation","useXGetImage"]);
hideEl(["device","pixelDecimation"]);
else if(grabbers.indexOf('x11') > -1)
hideEl(["device","width","height"]);
else if(grabbers.indexOf('osx') > -1 )
hideEl(["device","verticalPixelDecimation","horizontalPixelDecimation","useXGetImage"]);
hideEl(["device","pixelDecimation"]);
else if(grabbers.indexOf('amlogic') > -1)
hideEl(["verticalPixelDecimation","horizontalPixelDecimation","useXGetImage"]);
hideEl(["pixelDecimation"]);
});
removeOverlay();
});

View File

@@ -1,6 +1,5 @@
$(document).ready( function() {
var uiLock = false;
var prevSess = 0;
loadContentTo("#container_connection_lost","connection_lost");
loadContentTo("#container_restart","restart");
@@ -8,17 +7,28 @@ $(document).ready( function() {
$(hyperion).on("cmd-serverinfo",function(event){
serverInfo = event.response.info;
// protect components from serverinfo updates
if(!compsInited)
{
comps = event.response.info.components
compsInited = true;
}
if(!priosInited)
{
priosInited = true;
}
$(hyperion).trigger("ready");
if (serverInfo.hyperion.config_modified)
$("#hyperion_reload_notify").fadeIn("fast");
else
$("#hyperion_reload_notify").fadeOut("fast");
if (serverInfo.hyperion.off)
$("#hyperion_disabled_notify").fadeIn("fast");
else
if (serverInfo.hyperion.enabled)
$("#hyperion_disabled_notify").fadeOut("fast");
else
$("#hyperion_disabled_notify").fadeIn("fast");
if (!serverInfo.hyperion.config_writeable)
{
@@ -33,45 +43,32 @@ $(document).ready( function() {
uiLock = false;
}
var sess = serverInfo.hyperion.sessions;
if (sess.length != prevSess)
{
wSess = [];
prevSess = sess.length;
for(var i = 0; i<sess.length; i++)
{
if(sess[i].type == "_hyperiond-http._tcp.")
{
wSess.push(sess[i]);
}
}
if (wSess.length > 1)
$('#btn_instanceswitch').toggle(true);
else
$('#btn_instanceswitch').toggle(false);
}
updateSessions();
}); // end cmd-serverinfo
$(hyperion).on("cmd-sessions-update", function(event) {
serverInfo.sessions = event.response.data;
updateSessions();
});
$(hyperion).one("cmd-sysinfo", function(event) {
requestServerInfo();
sysInfo = event.response.info;
currentVersion = sysInfo.hyperion.version;
});
$(hyperion).one("cmd-config-getschema", function(event) {
serverSchema = event.response.result;
serverSchema = event.response.info;
requestServerConfig();
schema = serverSchema.properties;
});
$(hyperion).one("cmd-config-getconfig", function(event) {
serverConfig = event.response.result;
serverConfig = event.response.info;
requestSysInfo();
showOptHelp = serverConfig.general.showOptHelp;
});
@@ -82,15 +79,48 @@ $(document).ready( function() {
$(hyperion).on("open",function(event){
requestServerConfigSchema();
});
$(hyperion).one("ready", function(event) {
loadContent();
});
$(hyperion).on("cmd-adjustment-update", function(event) {
serverInfo.adjustment = event.response.data
});
$(hyperion).on("cmd-videomode-update", function(event) {
serverInfo.videomode = event.response.data.videomode
});
$(hyperion).on("cmd-components-update", function(event) {
let obj = event.response.data
// notfication in index
if (obj.name == "ALL")
{
if(obj.enable)
$("#hyperion_disabled_notify").fadeOut("fast");
else
$("#hyperion_disabled_notify").fadeIn("fast");
}
comps.forEach((entry, index) => {
if (entry.name === obj.name){
comps[index] = obj;
}
});
// notify the update
$(hyperion).trigger("components-updated");
});
$(hyperion).on("cmd-effects-update", function(event){
serverInfo.effects = event.response.data.effects
});
$("#btn_hyperion_reload").on("click", function(){
initRestart();
});
$(".mnava").bind('click.menu', function(e){
loadContent(e);
window.scrollTo(0, 0);
@@ -105,4 +135,3 @@ $(function(){
$(this).toggleClass('active inactive');
});
});

View File

@@ -1,24 +1,25 @@
$(document).ready( function() {
performTranslation();
var conf_editor_net = null;
var conf_editor_json = null;
var conf_editor_proto = null;
var conf_editor_bobl = null;
var conf_editor_udpl = null;
var conf_editor_forw = null;
if(showOptHelp)
{
//jsonserver
$('#conf_cont').append(createRow('conf_cont_json'))
$('#conf_cont_json').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_js_heading_title"), 'editor_container_jsonserver', 'btn_submit_jsonserver'));
$('#conf_cont_json').append(createHelpTable(schema.jsonServer.properties, $.i18n("edt_conf_js_heading_title")));
//protoserver
$('#conf_cont').append(createRow('conf_cont_proto'))
$('#conf_cont_proto').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_ps_heading_title"), 'editor_container_protoserver', 'btn_submit_protoserver'));
$('#conf_cont_proto').append(createHelpTable(schema.protoServer.properties, $.i18n("edt_conf_ps_heading_title")));
//boblight
$('#conf_cont').append(createRow('conf_cont_bobl'))
$('#conf_cont_bobl').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_bobls_heading_title"), 'editor_container_boblightserver', 'btn_submit_boblightserver'));
@@ -44,7 +45,7 @@ $(document).ready( function() {
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_ps_heading_title"), 'editor_container_protoserver', 'btn_submit_protoserver'));
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_bobls_heading_title"), 'editor_container_boblightserver', 'btn_submit_boblightserver'));
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_udpl_heading_title"), 'editor_container_udplistener', 'btn_submit_udplistener'));
if(storedAccess != 'default')
if(storedAccess != 'default')
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_fw_heading_title"), 'editor_container_forwarder', 'btn_submit_forwarder'));
}
@@ -69,11 +70,11 @@ $(document).ready( function() {
conf_editor_proto.on('change',function() {
conf_editor_proto.validate().length ? $('#btn_submit_protoserver').attr('disabled', true) : $('#btn_submit_protoserver').attr('disabled', false);
});
$('#btn_submit_protoserver').off().on('click',function() {
requestWriteConfig(conf_editor_proto.getValue());
});
//boblight
conf_editor_bobl = createJsonEditor('editor_container_boblightserver', {
boblightServer : schema.boblightServer
@@ -82,11 +83,11 @@ $(document).ready( function() {
conf_editor_bobl.on('change',function() {
conf_editor_bobl.validate().length ? $('#btn_submit_boblightserver').attr('disabled', true) : $('#btn_submit_boblightserver').attr('disabled', false);
});
$('#btn_submit_boblightserver').off().on('click',function() {
requestWriteConfig(conf_editor_bobl.getValue());
});
//udplistener
conf_editor_udpl = createJsonEditor('editor_container_udplistener', {
udpListener : schema.udpListener
@@ -95,11 +96,11 @@ $(document).ready( function() {
conf_editor_udpl.on('change',function() {
conf_editor_udpl.validate().length ? $('#btn_submit_udplistener').attr('disabled', true) : $('#btn_submit_udplistener').attr('disabled', false);
});
$('#btn_submit_udplistener').off().on('click',function() {
requestWriteConfig(conf_editor_udpl.getValue());
});
if(storedAccess != 'default')
{
//forwarder
@@ -115,7 +116,7 @@ $(document).ready( function() {
requestWriteConfig(conf_editor_forw.getValue());
});
}
//create introduction
if(showOptHelp)
{
@@ -125,7 +126,6 @@ $(document).ready( function() {
createHint("intro", $.i18n('conf_network_udpl_intro'), "editor_container_udplistener");
createHint("intro", $.i18n('conf_network_forw_intro'), "editor_container_forwarder");
}
removeOverlay();
});

View File

@@ -86,22 +86,6 @@ $(document).ready(function() {
requestSetColor(rgb.r, rgb.g, rgb.b,duration);
}
function updateRemote()
{
if ($('#componentsbutton').length == 0)
{
$(hyperion).off("cmd-serverinfo",updateRemote);
}
else
{
updateInputSelect();
updateLedMapping();
updateVideoMode();
updateComponents();
updateEffectlist();
}
}
function updateInputSelect()
{
$('.sstbody').html("");
@@ -123,6 +107,7 @@ $(document).ready(function() {
var priority = prios[i].priority;
var compId = prios[i].componentId;
var duration = prios[i].duration_ms/1000;
var value = "0,0,0";
var btn_type = "default";
var btn_text = $.i18n('remote_input_setsource_btn');
var btn_state = "enabled";
@@ -145,13 +130,16 @@ $(document).ready(function() {
if(ip)
origin += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_ip')+' '+ip+'</span>';
if("value" in prios[i])
value = prios[i].value.RGB;
switch (compId)
{
case "EFFECT":
owner = $.i18n('remote_effects_label_effects')+' '+owner;
break;
case "COLOR":
owner = $.i18n('remote_color_label_color')+' '+'<div style="width:18px; height:18px; border-radius:20px; margin-bottom:-4px; border:1px grey solid; background-color: rgb('+prios[i].value.RGB+'); display:inline-block" title="RGB: ('+prios[i].value.RGB+')"></div>';
owner = $.i18n('remote_color_label_color')+' '+'<div style="width:18px; height:18px; border-radius:20px; margin-bottom:-4px; border:1px grey solid; background-color: rgb('+value+'); display:inline-block" title="RGB: ('+value+')"></div>';
break;
case "GRABBER":
owner = $.i18n('general_comp_GRABBER')+': ('+owner+')';
@@ -165,6 +153,9 @@ $(document).ready(function() {
case "UDPLISTENER":
owner = $.i18n('general_comp_UDPLISTENER');
break;
case "PROTOSERVER":
owner = "Proto";
break;
}
if(duration && compId != "GRABBER" && compId != "PROTOSERVER")
@@ -195,7 +186,7 @@ $(document).ready(function() {
function updateLedMapping()
{
mapping = serverInfo.ledMAppingType;
mapping = serverInfo.imageToLedMappingType;
$('#mappingsbutton').html("");
for(var ix = 0; ix < mappingList.length; ix++)
@@ -211,16 +202,19 @@ $(document).ready(function() {
function updateComponents()
{
components = serverInfo.components;
components = comps;
// create buttons
$('#componentsbutton').html("");
for ( idx=0; idx<components.length;idx++)
{
if(components[idx].name == "ALL")
continue
enable_style = (components[idx].enabled? "btn-success" : "btn-danger");
enable_icon = (components[idx].enabled? "fa-play" : "fa-stop");
comp_name = components[idx].name;
comp_btn_id = "comp_btn_"+comp_name;
comp_goff = serverInfo.hyperion.off? "disabled" : "enabled";
comp_goff = serverInfo.hyperion.enabled? "enabled" : "disabled";
// create btn if not there
if ($("#"+comp_btn_id).length == 0)
@@ -266,7 +260,7 @@ $(document).ready(function() {
function updateVideoMode()
{
videoModes = ["2D","3DSBS","3DTAB"];
currVideoMode = serverInfo.grabbers.videomode;
currVideoMode = serverInfo.videomode;
$('#videomodebtns').html("");
for(var ix = 0; ix < videoModes.length; ix++)
@@ -327,10 +321,34 @@ $(document).ready(function() {
});
//force first update
updateRemote();
updateComponents();
updateInputSelect();
updateLedMapping();
updateVideoMode();
updateEffectlist();
// interval updates
$(hyperion).on("cmd-serverinfo",updateRemote);
$(hyperion).on("components-updated",updateComponents);
$(hyperion).on("cmd-priorities-update", function(event){
serverInfo.priorities = event.response.data.priorities
serverInfo.priorities_autoselect = event.response.data.priorities_autoselect
updateInputSelect()
});
$(hyperion).on("cmd-imageToLedMapping-update", function(event){
serverInfo.imageToLedMappingType = event.response.data.imageToLedMappingType
updateLedMapping()
});
$(hyperion).on("cmd-videomode-update", function(event){
serverInfo.videomode = event.response.data.videomode
updateVideoMode()
});
$(hyperion).on("cmd-effects-update", function(event){
serverInfo.effects = event.response.data.effects
updateEffectlist();
});
removeOverlay();
});

View File

@@ -22,6 +22,17 @@ var loggingHandlerInstalled = false;
var watchdog = 0;
var debugMessagesActive = true;
var wSess = [];
var plugins_installed = {};
var plugins_available = {};
//comps serverinfo lock
comps = [];
compsInited = false;
// prios serverinfo lock
priosInited = false;
// token list
tokenList = {}
function initRestart()
{
@@ -59,6 +70,7 @@ function connectionLostDetection(type)
setInterval(connectionLostDetection, 3000);
// init websocket to hyperion and bind socket events to jquery events of $(hyperion) object
function initWebSocket()
{
if ("WebSocket" in window)
@@ -66,8 +78,8 @@ function initWebSocket()
if (websocket == null)
{
jsonPort = (document.location.port == '') ? '80' : document.location.port;
websocket = new WebSocket('ws://'+document.location.hostname+":"+document.location.port);
console.log(jsonPort)
websocket = new WebSocket('ws://'+document.location.hostname+":"+jsonPort);
websocket.onopen = function (event) {
$(hyperion).trigger({type:"open"});
@@ -108,7 +120,7 @@ function initWebSocket()
response = JSON.parse(event.data);
success = response.success;
cmd = response.command;
if (success)
if (success || typeof(success) == "undefined")
{
$(hyperion).trigger({type:"cmd-"+cmd, response:response});
}
@@ -161,7 +173,7 @@ function sendToHyperion(command, subcommand, msg)
// also used for watchdog
function requestServerInfo()
{
sendToHyperion("serverinfo");
sendToHyperion("serverinfo","",'"subscribe":["components-update","sessions-update","priorities-update", "imageToLedMapping-update", "adjustment-update", "videomode-update", "effects-update"]');
}
function requestSysInfo()
@@ -218,7 +230,7 @@ function requestPriorityClear(prio)
function requestClearAll()
{
sendToHyperion("clearall");
requestPriorityClear(-1)
}
function requestPlayEffect(effectName, duration)

File diff suppressed because one or more lines are too long

View File

@@ -7,7 +7,7 @@ function removeOverlay()
function reload()
{
location.reload();
location.reload();
}
function storageComp()
@@ -48,6 +48,27 @@ function debugMessage(msg)
}
}
function updateSessions()
{
var sess = serverInfo.sessions;
if (sess.length)
{
wSess = [];
for(var i = 0; i<sess.length; i++)
{
if(sess[i].type == "_hyperiond-http._tcp.")
{
wSess.push(sess[i]);
}
}
if (wSess.length > 1)
$('#btn_instanceswitch').toggle(true);
else
$('#btn_instanceswitch').toggle(false);
}
}
function validateDuration(d)
{
if(typeof d === "undefined" || d < 0)
@@ -73,9 +94,9 @@ function getHashtag()
function loadContent(event)
{
var tag;
if(typeof event != "undefined")
{
{
tag = event.currentTarget.hash;
tag = tag.substr(tag.indexOf("#") + 1);
setStorage('lasthashtag', tag, true);
@@ -130,7 +151,7 @@ function setClassByBool(obj,enable,class1,class2)
}
function showInfoDialog(type,header,message)
{
{
if (type=="success"){
$('#id_body').html('<i style="margin-bottom:20px" class="fa fa-check modal-icon-check">');
if(header == "")
@@ -143,12 +164,12 @@ function showInfoDialog(type,header,message)
$('#id_body').append('<h4 style="font-weight:bold;text-transform:uppercase;">'+$.i18n('infoDialog_general_warning_title')+'</h4>');
$('#id_footer').html('<button type="button" class="btn btn-warning" data-dismiss="modal">'+$.i18n('general_btn_ok')+'</button>');
}
else if (type=="error"){
else if (type=="error"){
$('#id_body').html('<i style="margin-bottom:20px" class="fa fa-warning modal-icon-error">');
if(header == "")
$('#id_body').append('<h4 style="font-weight:bold;text-transform:uppercase;">'+$.i18n('infoDialog_general_error_title')+'</h4>');
$('#id_footer').html('<button type="button" class="btn btn-danger" data-dismiss="modal">'+$.i18n('general_btn_ok')+'</button>');
}
}
else if (type == "select"){
$('#id_body').html('<img style="margin-bottom:20px" src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!">');
$('#id_footer').html('<button type="button" id="id_btn_saveset" class="btn btn-primary" data-dismiss="modal"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_saveandreload')+'</button>');
@@ -178,10 +199,10 @@ function showInfoDialog(type,header,message)
$('#id_body').append('<h4 style="font-weight:bold;text-transform:uppercase;">'+header+'</h4>');
$('#id_body').append(message);
if(type == "select" || type == "iswitch")
$('#id_body').append('<select id="id_select" class="form-control" style="margin-top:10px;width:auto;"></select>');
$("#modal_dialog").modal({
backdrop : "static",
keyboard: false,
@@ -193,14 +214,14 @@ function createHintH(type, text, container)
{
if(type = "intro")
tclass = "introd";
$('#'+container).prepend('<div class="'+tclass+'"><h4 style="font-size:16px">'+text+'</h4><hr/></div>');
}
function createHint(type, text, container, buttonid, buttontxt)
{
var fe, tclass;
if(type == "intro")
{
fe = '';
@@ -212,21 +233,21 @@ function createHint(type, text, container, buttonid, buttontxt)
tclass = "info-hint";
}
else if(type == "wizard")
{
{
fe = '<div style="font-size:25px;text-align:center"><i class="fa fa-magic"></i></div><div style="text-align:center;font-size:13px">Information</div>';
tclass = "wizard-hint";
}
else if(type == "warning")
{
{
fe = '<div style="font-size:25px;text-align:center"><i class="fa fa-info"></i></div><div style="text-align:center;font-size:13px">Information</div>';
tclass = "warning-hint";
}
if(buttonid)
buttonid = '<p><button id="'+buttonid+'" class="btn btn-wizard" style="margin-top:15px;">'+text+'</button></p>';
else
buttonid = "";
if(type == "intro")
$('#'+container).prepend('<div class="bs-callout bs-callout-primary" style="margin-top:0px"><h4>'+$.i18n("conf_helptable_expl")+'</h4>'+text+'</div>');
else if(type == "wizard")
@@ -247,8 +268,8 @@ function valValue(id,value,min,max)
{
if(typeof max === 'undefined' || max == "")
max = 999999;
if(Number(value) > Number(max))
if(Number(value) > Number(max))
{
$('#'+id).val(max);
showInfoDialog("warning","",$.i18n('edt_msg_error_maximum_incl',max));
@@ -260,7 +281,7 @@ function valValue(id,value,min,max)
showInfoDialog("warning","",$.i18n('edt_msg_error_minimum_incl',min));
return min;
}
return value;
return value;
}
function readImg(input,cb)
@@ -294,12 +315,12 @@ function createJsonEditor(container,schema,setconfig,usePanel,arrayre)
{
$('#'+container).off();
$('#'+container).html("");
//JSONEditor.plugins.selectize.enable = true;
if (typeof arrayre === 'undefined')
arrayre = true;
var editor = new JSONEditor(document.getElementById(container),
{
theme: 'bootstrap3',
@@ -338,18 +359,18 @@ function createJsonEditor(container,schema,setconfig,usePanel,arrayre)
}
function buildWL(link,linkt,cl)
{
{
var baseLink = "https://docs.hyperion-project.org/";
var lang;
if(typeof linkt == "undefined")
linkt = "Placeholder";
if(storedLang == "de" || navigator.locale == "de")
lang = "de";
else
lang = "en";
if(cl === true)
{
linkt = $.i18n(linkt);
@@ -366,7 +387,7 @@ function rgbToHex(rgb)
return "#" +
("0" + parseInt(rgb[0],10).toString(16)).slice(-2) +
("0" + parseInt(rgb[1],10).toString(16)).slice(-2) +
("0" + parseInt(rgb[2],10).toString(16)).slice(-2);
("0" + parseInt(rgb[2],10).toString(16)).slice(-2);
}
else
debugMessage('rgbToHex: Given rgb is no array or has wrong length');
@@ -381,6 +402,57 @@ function hexToRgb(hex) {
} : null;
}
/*
Show a notification
@param type Valid types are "info","success","warning","danger"
@param message The message to show
@param title A title (optional)
*/
function showNotification(type, message, title="")
{
if(title == "")
{
switch(type)
{
case "info":
title = $.i18n('infoDialog_general_info_title');
break;
case "success":
title = $.i18n('infoDialog_general_success_title');
break;
case "warning":
title = $.i18n('infoDialog_general_warning_title');
break;
case "danger":
title = $.i18n('infoDialog_general_error_title');
break;
}
}
$.notify({
// options
title: title,
message: message
},{
// settings
type: type,
animate: {
enter: 'animated fadeInRight',
exit: 'animated fadeOutRight'
},
mouse_over : 'pause',
template: '<div data-notify="container" class="bg-w col-xs-11 col-sm-3 bs-callout bs-callout-{0}" role="alert">' +
'<button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button>' +
'<span data-notify="icon"></span> ' +
'<h4 data-notify="title">{1}</h4> ' +
'<span data-notify="message">{2}</span>' +
'<div class="progress" data-notify="progressbar">' +
'<div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' +
'</div>' +
'<a href="{3}" target="{4}" data-notify="url"></a>' +
'</div>'
});
}
function createCP(id, color, cb)
{
@@ -388,7 +460,7 @@ function createCP(id, color, cb)
color = rgbToHex(color);
else if(color == "undefined")
color = "#AA3399";
if(color.startsWith("#"))
{
$('#'+id).colorpicker({
@@ -425,7 +497,7 @@ function createTable(hid, bid, cont, bless, tclass)
var table = document.createElement('table');
var thead = document.createElement('thead');
var tbody = document.createElement('tbody');
table.className = "table";
if(bless === true)
table.className += " borderless";
@@ -438,30 +510,30 @@ function createTable(hid, bid, cont, bless, tclass)
if(hid != "")
table.appendChild(thead);
table.appendChild(tbody);
$('#'+cont).append(table);
}
// Creates a table row <tr>
// @param array list :innerHTML content for <td>/<th>
// @param bool head :if null or false it's body
// @param bool align :if null or false no alignment
// @param bool align :if null or false no alignment
//
// @return : <tr> with <td> or <th> as child(s)
function createTableRow(list, head, align)
{
var row = document.createElement('tr');
for(var i = 0; i < list.length; i++)
{
if(head === true)
var el = document.createElement('th');
else
var el = document.createElement('td');
if(align)
el.style.verticalAlign = "middle";
el.innerHTML = list[i];
row.appendChild(el);
}
@@ -483,7 +555,7 @@ function createOptPanel(phicon, phead, bodyid, footerid)
pfooter.className = "btn btn-primary";
pfooter.setAttribute("id", footerid);
pfooter.innerHTML = '<i class="fa fa-fw fa-save"></i>'+$.i18n('general_button_savesettings');
return createPanel(phead, "", pfooter, "panel-default", bodyid);
}
@@ -506,30 +578,30 @@ function createHelpTable(list, phead){
var thead = document.createElement('thead');
var tbody = document.createElement('tbody');
list = sortProperties(list);
phead = '<i class="fa fa-fw fa-info-circle"></i>'+phead+' '+$.i18n("conf_helptable_expl");
table.className = 'table table-hover borderless';
thead.appendChild(createTableRow([$.i18n('conf_helptable_option'), $.i18n('conf_helptable_expl')], true, false));
for (key in list)
{
if(list[key].access != 'system')
{
var text = list[key].title.replace('title', 'expl');
tbody.appendChild(createTableRow([$.i18n(list[key].title), $.i18n(text)], false, false));
if(list[key].items && list[key].items.properties)
{
var ilist = sortProperties(list[key].items.properties);
for (ikey in ilist)
{
var itext = ilist[ikey].title.replace('title', 'expl');
tbody.appendChild(createTableRow([$.i18n(ilist[ikey].title), $.i18n(itext)], false, false));
}
}
}
}
}
table.appendChild(thead);
@@ -544,42 +616,42 @@ function createPanel(head, body, footer, type, bodyid){
var phead = document.createElement('div');
var pbody = document.createElement('div');
var pfooter = document.createElement('div');
cont.className = "col-lg-6";
if(typeof type == 'undefined')
type = 'panel-default';
p.className = 'panel '+type;
phead.className = 'panel-heading';
pbody.className = 'panel-body';
pfooter.className = 'panel-footer';
phead.innerHTML = head;
if(typeof bodyid != 'undefined')
{
pfooter.style.textAlign = 'right';
pbody.setAttribute("id", bodyid)
}
if(typeof body != 'undefined' && body != "")
pbody.appendChild(body);
if(typeof footer != 'undefined')
pfooter.appendChild(footer);
p.appendChild(phead);
p.appendChild(pbody);
if(typeof footer != 'undefined')
{
pfooter.style.textAlign = "right";
p.appendChild(pfooter);
}
cont.appendChild(p);
return cont;
}
@@ -589,12 +661,12 @@ function createSelGroup(group)
el.setAttribute('label', group);
return el;
}
function createSelOpt(opt, title)
{
var el = document.createElement('option');
el.setAttribute('value', opt);
if (typeof title == 'undefined')
if (typeof title == 'undefined')
el.innerHTML = opt;
else
el.innerHTML = title;