mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
@@ -1,5 +1,9 @@
|
||||
$(document).ready(function () {
|
||||
performTranslation();
|
||||
|
||||
// update instance listing
|
||||
updateHyperionInstanceListing();
|
||||
|
||||
var editor_color = null;
|
||||
var editor_smoothing = null;
|
||||
var editor_blackborder = null;
|
||||
@@ -13,12 +17,12 @@ $(document).ready(function () {
|
||||
//smoothing
|
||||
$('#conf_cont').append(createRow('conf_cont_smoothing'));
|
||||
$('#conf_cont_smoothing').append(createOptPanel('fa-photo', $.i18n("edt_conf_smooth_heading_title"), 'editor_container_smoothing', 'btn_submit_smoothing'));
|
||||
$('#conf_cont_smoothing').append(createHelpTable(window.schema.smoothing.properties, $.i18n("edt_conf_smooth_heading_title")));
|
||||
$('#conf_cont_smoothing').append(createHelpTable(window.schema.smoothing.properties, $.i18n("edt_conf_smooth_heading_title"), "smoothingHelpPanelId"));
|
||||
|
||||
//blackborder
|
||||
$('#conf_cont').append(createRow('conf_cont_blackborder'));
|
||||
$('#conf_cont_blackborder').append(createOptPanel('fa-photo', $.i18n("edt_conf_bb_heading_title"), 'editor_container_blackborder', 'btn_submit_blackborder'));
|
||||
$('#conf_cont_blackborder').append(createHelpTable(window.schema.blackborderdetector.properties, $.i18n("edt_conf_bb_heading_title")));
|
||||
$('#conf_cont_blackborder').append(createHelpTable(window.schema.blackborderdetector.properties, $.i18n("edt_conf_bb_heading_title"), "blackborderHelpPanelId"))
|
||||
}
|
||||
else {
|
||||
$('#conf_cont').addClass('row');
|
||||
@@ -46,6 +50,14 @@ $(document).ready(function () {
|
||||
}, true, true);
|
||||
|
||||
editor_smoothing.on('change', function () {
|
||||
var smoothingEnable = editor_smoothing.getEditor("root.smoothing.enable").getValue();
|
||||
if (smoothingEnable) {
|
||||
showInputOptionsForKey(editor_smoothing, "smoothing", "enable", true);
|
||||
$('#smoothingHelpPanelId').show();
|
||||
} else {
|
||||
showInputOptionsForKey(editor_smoothing, "smoothing", "enable", false);
|
||||
$('#smoothingHelpPanelId').hide();
|
||||
}
|
||||
editor_smoothing.validate().length || window.readOnlyMode ? $('#btn_submit_smoothing').attr('disabled', true) : $('#btn_submit_smoothing').attr('disabled', false);
|
||||
});
|
||||
|
||||
@@ -59,6 +71,17 @@ $(document).ready(function () {
|
||||
}, true, true);
|
||||
|
||||
editor_blackborder.on('change', function () {
|
||||
var blackborderEnable = editor_blackborder.getEditor("root.blackborderdetector.enable").getValue();
|
||||
if (blackborderEnable) {
|
||||
showInputOptionsForKey(editor_blackborder, "blackborderdetector", "enable", true);
|
||||
$('#blackborderHelpPanelId').show();
|
||||
$('#blackborderWikiLinkId').show();
|
||||
|
||||
} else {
|
||||
showInputOptionsForKey(editor_blackborder, "blackborderdetector", "enable", false);
|
||||
$('#blackborderHelpPanelId').hide();
|
||||
$('#blackborderWikiLinkId').hide();
|
||||
}
|
||||
editor_blackborder.validate().length || window.readOnlyMode ? $('#btn_submit_blackborder').attr('disabled', true) : $('#btn_submit_blackborder').attr('disabled', false);
|
||||
});
|
||||
|
||||
@@ -67,7 +90,9 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
//wiki links
|
||||
$('#editor_container_blackborder').append(buildWL("user/advanced/Advanced.html#blackbar-detection", "edt_conf_bb_mode_title", true));
|
||||
var wikiElement = $(buildWL("user/advanced/Advanced.html#blackbar-detection", "edt_conf_bb_mode_title", true));
|
||||
wikiElement.attr('id', 'blackborderWikiLinkId');
|
||||
$('#editor_container_blackborder').append(wikiElement);
|
||||
|
||||
//create introduction
|
||||
if (window.showOptHelp) {
|
||||
|
@@ -1,126 +1,127 @@
|
||||
$(document).ready( function() {
|
||||
performTranslation();
|
||||
$(document).ready(function () {
|
||||
performTranslation();
|
||||
|
||||
// function newsCont(t,e,l)
|
||||
// {
|
||||
// var h = '<div style="padding-left:9px;border-left:6px solid #0088cc;">';
|
||||
// h += '<h4 style="font-weight:bold;font-size:17px">'+t+'</h4>';
|
||||
// h += e;
|
||||
// h += '<a href="'+l+'" class="" target="_blank"><i class="fa fa-fw fa-newspaper-o"></i>'+$.i18n('dashboard_newsbox_readmore')+'</a>';
|
||||
// h += '</div><hr/>';
|
||||
// $('#dash_news').append(h);
|
||||
// }
|
||||
function updateComponents() {
|
||||
$("div[class*='currentInstance']").remove();
|
||||
|
||||
// function createNews(d)
|
||||
// {
|
||||
// for(var i = 0; i<d.length; i++)
|
||||
// {
|
||||
// if(i > 5)
|
||||
// break;
|
||||
//
|
||||
// var title = d[i].title.rendered;
|
||||
// var excerpt = d[i].excerpt.rendered;
|
||||
// var 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>';
|
||||
// $.ajax({
|
||||
// url: 'https://hyperion-project.org/wp-json/wp/v2/posts?_embed',
|
||||
// dataType: 'json',
|
||||
// type: 'GET',
|
||||
// timeout: 2000
|
||||
// })
|
||||
// .done( function( data, textStatus, jqXHR ) {
|
||||
// if(jqXHR.status == 200)
|
||||
// createNews(data);
|
||||
// else
|
||||
// $('#dash_news').html(h);
|
||||
// })
|
||||
// .fail( function( jqXHR, textStatus ) {
|
||||
// $('#dash_news').html(h);
|
||||
// });
|
||||
// }
|
||||
|
||||
// getNews();
|
||||
|
||||
function updateComponents()
|
||||
{
|
||||
var components = window.comps;
|
||||
var components_html = "";
|
||||
for (var idx=0; idx<components.length;idx++)
|
||||
{
|
||||
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
|
||||
var hyperion_enabled = true;
|
||||
|
||||
components.forEach( function(obj) {
|
||||
if (obj.name == "ALL")
|
||||
{
|
||||
hyperion_enabled = obj.enabled
|
||||
}
|
||||
});
|
||||
|
||||
var instancename = window.currentHyperionInstanceName;
|
||||
|
||||
$('#dash_statush').html(hyperion_enabled ? '<span style="color:green">'+$.i18n('general_btn_on')+'</span>' : '<span style="color:red">'+$.i18n('general_btn_off')+'</span>');
|
||||
$('#btn_hsc').html(hyperion_enabled ? '<button class="btn btn-sm btn-danger" onClick="requestSetComponentState(\'ALL\',false)">'+$.i18n('dashboard_infobox_label_disableh', instancename)+'</button>' : '<button class="btn btn-sm btn-success" onClick="requestSetComponentState(\'ALL\',true)">'+$.i18n('dashboard_infobox_label_enableh', instancename)+'</button>');
|
||||
}
|
||||
|
||||
// add more info
|
||||
$('#dash_leddevice').html(window.serverConfig.device.type);
|
||||
$('#dash_currv').html(window.currentVersion);
|
||||
$('#dash_instance').html(window.currentHyperionInstanceName);
|
||||
$('#dash_ports').html(window.serverConfig.flatbufServer.port+' | '+window.serverConfig.protoServer.port);
|
||||
$('#dash_watchedversionbranch').html(window.serverConfig.general.watchedVersionBranch);
|
||||
|
||||
getReleases(function(callback){
|
||||
if(callback)
|
||||
{
|
||||
$('#dash_latev').html(window.latestVersion.tag_name);
|
||||
|
||||
if (semverLite.gt(window.latestVersion.tag_name, window.currentVersion))
|
||||
$('#versioninforesult').html('<div class="bs-callout bs-callout-warning" style="margin:0px"><a target="_blank" href="' + window.latestVersion.html_url + '">'+$.i18n('dashboard_infobox_message_updatewarning', window.latestVersion.tag_name) + '</a></div>');
|
||||
else
|
||||
$('#versioninforesult').html('<div class="bs-callout bs-callout-success" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
|
||||
|
||||
}
|
||||
});
|
||||
var instances_html = '<div class="col-md-6 col-xxl-4 currentInstance-"><div class="panel panel-default">';
|
||||
instances_html += '<div class="panel-heading panel-instance">';
|
||||
instances_html += '<div class="dropdown">';
|
||||
instances_html += '<a id="active_instance_dropdown" class="dropdown-toggle" data-toggle="dropdown" href="#" style="text-decoration:none;display:flex;align-items:center;">';
|
||||
instances_html += '<div id="active_instance_friendly_name"></div>';
|
||||
instances_html += '<div id="btn_hypinstanceswitch" style="white-space:nowrap;"><span class="mdi mdi-lightbulb-group mdi-24px" style="margin-right:0;margin-left:5px;"></span><span class="mdi mdi-menu-down mdi-24px"></span></div>';
|
||||
instances_html += '</a><ul id="hyp_inst_listing" class="dropdown-menu dropdown-alerts" style="cursor:pointer;"></ul>'
|
||||
instances_html += '</div></div>';
|
||||
|
||||
|
||||
instances_html += '<div class="panel-body">';
|
||||
instances_html += '<table class="table borderless">';
|
||||
instances_html += '<thead><tr><th style="vertical-align:middle"><i class="mdi mdi-lightbulb-on fa-fw"></i>';
|
||||
instances_html += '<span>' + $.i18n('dashboard_componentbox_label_status') + '</span></th>';
|
||||
|
||||
//determine platform
|
||||
var grabbers = window.serverInfo.grabbers.available;
|
||||
var html = "";
|
||||
var components = window.comps;
|
||||
var hyperion_enabled = true;
|
||||
components.forEach(function (obj) {
|
||||
if (obj.name == "ALL") {
|
||||
hyperion_enabled = obj.enabled;
|
||||
}
|
||||
});
|
||||
|
||||
if(grabbers.indexOf('dispmanx') > -1)
|
||||
html += 'Raspberry Pi';
|
||||
else if(grabbers.indexOf('x11') > -1 || grabbers.indexOf('xcb') > -1)
|
||||
html += 'X86';
|
||||
else if(grabbers.indexOf('osx') > -1)
|
||||
html += 'OSX';
|
||||
else if(grabbers.indexOf('amlogic') > -1)
|
||||
html += 'Amlogic';
|
||||
else
|
||||
html += 'Framebuffer';
|
||||
var instBtn = '<span style="display:block; margin:3px"><input id="instanceButton"'
|
||||
+ (hyperion_enabled ? "checked" : "") + ' type="checkbox" data-toggle="toggle" data-size="small" data-onstyle="success" data-on="'
|
||||
+ $.i18n('general_btn_on') + '" data-off="'
|
||||
+ $.i18n('general_btn_off') + '"></span>';
|
||||
|
||||
$('#dash_platform').html(html);
|
||||
instances_html += '<th style="width:1px;text-align:right">' + instBtn + '</th></tr></thead></table>';
|
||||
|
||||
instances_html += '<table class="table borderless">';
|
||||
instances_html += '<thead><tr><th colspan="3">';
|
||||
instances_html += '<i class="fa fa-info-circle fa-fw"></i>';
|
||||
instances_html += '<span>' + $.i18n('dashboard_infobox_label_title') + '</span>';
|
||||
instances_html += '</th></tr></thead>';
|
||||
instances_html += '<tbody><tr><td></td>';
|
||||
instances_html += '<td>' + $.i18n('conf_leds_contr_label_contrtype') + '</td>';
|
||||
instances_html += '<td style="text-align:right">' + window.serverConfig.device.type + '</td>';
|
||||
instances_html += '</tr><tr></tbody></table>';
|
||||
|
||||
//interval update
|
||||
updateComponents();
|
||||
$(window.hyperion).on("components-updated",updateComponents);
|
||||
instances_html += '<table class="table first_cell_borderless">';
|
||||
instances_html += '<thead><tr><th colspan="3">';
|
||||
instances_html += '<i class="fa fa-eye fa-fw"></i>';
|
||||
instances_html += '<span>' + $.i18n('dashboard_componentbox_label_title') + '</span>';
|
||||
instances_html += '</th></tr></thead>';
|
||||
|
||||
if(window.showOptHelp)
|
||||
createHintH("intro", $.i18n('dashboard_label_intro'), "dash_intro");
|
||||
var tab_components = "";
|
||||
for (var idx = 0; idx < components.length; idx++) {
|
||||
if (components[idx].name != "ALL") {
|
||||
var comp_enabled = components[idx].enabled ? "checked" : "";
|
||||
const general_comp = "general_comp_" + components[idx].name;
|
||||
var componentBtn = '<input ' +
|
||||
'id="' + general_comp + '" ' + comp_enabled +
|
||||
' type="checkbox" ' +
|
||||
'data-toggle="toggle" ' +
|
||||
'data-size="mini" ' +
|
||||
'data-onstyle="success" ' +
|
||||
'data-on="' + $.i18n('general_btn_on') + '" ' +
|
||||
'data-off="' + $.i18n('general_btn_off') + '">';
|
||||
|
||||
removeOverlay();
|
||||
tab_components += '<tr><td></td><td>' + $.i18n('general_comp_' + components[idx].name) + '</td><td style="text-align:right">' + componentBtn + '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
instances_html += '<tbody>' + tab_components + '</tbody></table>';
|
||||
instances_html += '</div></div></div>';
|
||||
|
||||
$('.instances').prepend(instances_html);
|
||||
updateUiOnInstance(window.currentHyperionInstance);
|
||||
updateHyperionInstanceListing();
|
||||
|
||||
$('#instanceButton').bootstrapToggle();
|
||||
$('#instanceButton').change(e => {
|
||||
requestSetComponentState('ALL', e.currentTarget.checked);
|
||||
});
|
||||
|
||||
for (var idx = 0; idx < components.length; idx++) {
|
||||
if (components[idx].name != "ALL") {
|
||||
$("#general_comp_" + components[idx].name).bootstrapToggle();
|
||||
$("#general_comp_" + components[idx].name).bootstrapToggle(hyperion_enabled ? "enable" : "disable")
|
||||
$("#general_comp_" + components[idx].name).change(e => {
|
||||
requestSetComponentState(e.currentTarget.id.split('_')[2], e.currentTarget.checked);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add more info
|
||||
var fbPort = window.serverConfig.flatbufServer.enable ? window.serverConfig.flatbufServer.port : $.i18n('general_disabled');
|
||||
$('#dash_fbPort').html(fbPort);
|
||||
var pbPort = window.serverConfig.protoServer.enable ? window.serverConfig.protoServer.port : $.i18n('general_disabled');
|
||||
$('#dash_pbPort').html(pbPort);
|
||||
|
||||
var jsonPort = window.serverConfig.jsonServer.port;
|
||||
$('#dash_jsonPort').html(jsonPort);
|
||||
var wsPorts = window.serverConfig.webConfig.port + ' | ' + window.serverConfig.webConfig.sslPort
|
||||
$('#dash_wsPorts').html(wsPorts);
|
||||
|
||||
$('#dash_currv').html(window.currentVersion);
|
||||
$('#dash_watchedversionbranch').html(window.serverConfig.general.watchedVersionBranch);
|
||||
|
||||
getReleases(function (callback) {
|
||||
if (callback) {
|
||||
$('#dash_latev').html(window.latestVersion.tag_name);
|
||||
|
||||
if (semverLite.gt(window.latestVersion.tag_name, window.currentVersion))
|
||||
$('#versioninforesult').html('<div class="bs-callout bs-callout-warning" style="margin:0px"><a target="_blank" href="' + window.latestVersion.html_url + '">' + $.i18n('dashboard_infobox_message_updatewarning', window.latestVersion.tag_name) + '</a></div>');
|
||||
else
|
||||
$('#versioninforesult').html('<div class="bs-callout bs-callout-info" style="margin:0px">' + $.i18n('dashboard_infobox_message_updatesuccess') + '</div>');
|
||||
}
|
||||
});
|
||||
|
||||
//interval update
|
||||
updateComponents();
|
||||
$(window.hyperion).on("components-updated", updateComponents);
|
||||
|
||||
if (window.showOptHelp)
|
||||
createHintH("intro", $.i18n('dashboard_label_intro'), "dash_intro");
|
||||
|
||||
removeOverlay();
|
||||
});
|
||||
|
@@ -1,5 +1,9 @@
|
||||
$(document).ready( function() {
|
||||
performTranslation();
|
||||
|
||||
// update instance listing
|
||||
updateHyperionInstanceListing();
|
||||
|
||||
var oldEffects = [];
|
||||
var effects_editor = null;
|
||||
var confFgEff = window.serverConfig.foregroundEffect.effect;
|
||||
@@ -12,12 +16,12 @@ $(document).ready( function() {
|
||||
//foreground effect
|
||||
$('#conf_cont').append(createRow('conf_cont_fge'));
|
||||
$('#conf_cont_fge').append(createOptPanel('fa-spinner', $.i18n("edt_conf_fge_heading_title"), 'editor_container_foregroundEffect', 'btn_submit_foregroundEffect'));
|
||||
$('#conf_cont_fge').append(createHelpTable(window.schema.foregroundEffect.properties, $.i18n("edt_conf_fge_heading_title")));
|
||||
$('#conf_cont_fge').append(createHelpTable(window.schema.foregroundEffect.properties, $.i18n("edt_conf_fge_heading_title"), "foregroundEffectHelpPanelId"));
|
||||
|
||||
//background effect
|
||||
$('#conf_cont').append(createRow('conf_cont_bge'));
|
||||
$('#conf_cont_bge').append(createOptPanel('fa-spinner', $.i18n("edt_conf_bge_heading_title"), 'editor_container_backgroundEffect', 'btn_submit_backgroundEffect'));
|
||||
$('#conf_cont_bge').append(createHelpTable(window.schema.backgroundEffect.properties, $.i18n("edt_conf_bge_heading_title")));
|
||||
$('#conf_cont_bge').append(createHelpTable(window.schema.backgroundEffect.properties, $.i18n("edt_conf_bge_heading_title"), "backgroundEffectHelpPanelId"));
|
||||
|
||||
//effect path
|
||||
if(storedAccess != 'default')
|
||||
@@ -64,11 +68,31 @@ $(document).ready( function() {
|
||||
updateEffectlist();
|
||||
});
|
||||
|
||||
foregroundEffect_editor.on('change',function() {
|
||||
foregroundEffect_editor.on('change', function () {
|
||||
var foregroundEffectEnable = foregroundEffect_editor.getEditor("root.foregroundEffect.enable").getValue();
|
||||
if (foregroundEffectEnable) {
|
||||
showInputOptionsForKey(foregroundEffect_editor, "foregroundEffect", "enable", true);
|
||||
$('#foregroundEffectHelpPanelId').show();
|
||||
|
||||
} else {
|
||||
showInputOptionsForKey(foregroundEffect_editor, "foregroundEffect", "enable", false);
|
||||
$('#foregroundEffectHelpPanelId').hide();
|
||||
}
|
||||
|
||||
foregroundEffect_editor.validate().length || window.readOnlyMode ? $('#btn_submit_foregroundEffect').attr('disabled', true) : $('#btn_submit_foregroundEffect').attr('disabled', false);
|
||||
});
|
||||
|
||||
backgroundEffect_editor.on('change',function() {
|
||||
backgroundEffect_editor.on('change', function () {
|
||||
var backgroundEffectEnable = backgroundEffect_editor.getEditor("root.backgroundEffect.enable").getValue();
|
||||
if (backgroundEffectEnable) {
|
||||
showInputOptionsForKey(backgroundEffect_editor, "backgroundEffect", "enable", true);
|
||||
$('#backgroundEffectHelpPanelId').show();
|
||||
|
||||
} else {
|
||||
showInputOptionsForKey(backgroundEffect_editor, "backgroundEffect", "enable", false);
|
||||
$('#backgroundEffectHelpPanelId').hide();
|
||||
}
|
||||
|
||||
backgroundEffect_editor.validate().length || window.readOnlyMode ? $('#btn_submit_backgroundEffect').attr('disabled', true) : $('#btn_submit_backgroundEffect').attr('disabled', false);
|
||||
});
|
||||
|
||||
|
@@ -1,5 +1,9 @@
|
||||
$(document).ready(function () {
|
||||
performTranslation();
|
||||
|
||||
// update instance listing
|
||||
updateHyperionInstanceListing();
|
||||
|
||||
var oldDelList = [];
|
||||
var effectName = "";
|
||||
var imageData = "";
|
||||
@@ -92,7 +96,7 @@ $(document).ready(function () {
|
||||
|
||||
var desc = $.i18n(effects[idx].schemaContent.title + '_desc');
|
||||
if (desc === effects[idx].schemaContent.title + '_desc') {
|
||||
desc = ""
|
||||
desc = "";
|
||||
}
|
||||
|
||||
$("#eff_desc").html(createEffHint($.i18n(effects[idx].schemaContent.title), desc));
|
||||
|
@@ -5,7 +5,7 @@ $(document).ready( function() {
|
||||
var confName;
|
||||
var conf_editor = null;
|
||||
|
||||
$('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_gen_heading_title"), 'editor_container', 'btn_submit'));
|
||||
$('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_gen_heading_title"), 'editor_container', 'btn_submit', 'panel-system'));
|
||||
if(window.showOptHelp)
|
||||
{
|
||||
$('#conf_cont').append(createHelpTable(window.schema.general.properties, $.i18n("edt_conf_gen_heading_title")));
|
||||
@@ -28,12 +28,12 @@ $(document).ready( function() {
|
||||
// Instance handling
|
||||
function handleInstanceRename(e)
|
||||
{
|
||||
|
||||
|
||||
conf_editor.on('change',function() {
|
||||
window.readOnlyMode ? $('#btn_cl_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
window.readOnlyMode ? $('#btn_ma_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
});
|
||||
|
||||
|
||||
var inst = e.currentTarget.id.split("_")[1];
|
||||
showInfoDialog('renInst', $.i18n('conf_general_inst_renreq_t'), getInstanceNameByIndex(inst));
|
||||
|
||||
@@ -46,13 +46,6 @@ $(document).ready( function() {
|
||||
});
|
||||
}
|
||||
|
||||
function handleInstanceStartStop(e)
|
||||
{
|
||||
var inst = e.currentTarget.id.split("_")[1];
|
||||
var start = (e.currentTarget.className == "btn btn-danger")
|
||||
requestInstanceStartStop(inst, start)
|
||||
}
|
||||
|
||||
function handleInstanceDelete(e)
|
||||
{
|
||||
var inst = e.currentTarget.id.split("_")[1];
|
||||
@@ -68,22 +61,25 @@ $(document).ready( function() {
|
||||
$('.itbody').html("");
|
||||
for(var key in inst)
|
||||
{
|
||||
var startBtnColor = inst[key].running ? "success" : "danger";
|
||||
var startBtnIcon = inst[key].running ? "stop" : "play";
|
||||
var startBtnText = inst[key].running ? $.i18n('general_btn_stop') : $.i18n('general_btn_start');
|
||||
var renameBtn = '<button id="instren_'+inst[key].instance+'" type="button" class="btn btn-primary"><i class="fa fa-fw fa-pencil"></i>'+$.i18n('general_btn_rename')+'</button>';
|
||||
var enable_style = inst[key].running ? "checked" : "";
|
||||
var renameBtn = '<button id="instren_'+inst[key].instance+'" type="button" class="btn btn-primary"><i class="mdi mdi-lead-pencil""></i></button>';
|
||||
var startBtn = ""
|
||||
var delBtn = "";
|
||||
if(inst[key].instance > 0)
|
||||
{
|
||||
delBtn = '<button id="instdel_'+inst[key].instance+'" type="button" class="btn btn-warning"><i class="fa fa-fw fa-remove"></i>'+$.i18n('general_btn_delete')+'</button>';
|
||||
startBtn = '<button id="inst_'+inst[key].instance+'" type="button" class="btn btn-'+startBtnColor+'"><i class="fa fa-fw fa-'+startBtnIcon+'"></i>'+startBtnText+'</button>';
|
||||
delBtn = '<button id="instdel_'+inst[key].instance+'" type="button" class="btn btn-danger"><i class="mdi mdi-delete-forever""></i></button>';
|
||||
startBtn = '<input id="inst_'+inst[key].instance+'"'+enable_style+' type="checkbox" data-toggle="toggle" data-onstyle="success font-weight-bold" data-on="'+$.i18n('general_btn_on')+'" data-offstyle="default font-weight-bold" data-off="'+$.i18n('general_btn_off')+'">';
|
||||
|
||||
}
|
||||
$('.itbody').append(createTableRow([inst[key].friendly_name, renameBtn, startBtn, delBtn], false, true));
|
||||
$('.itbody').append(createTableRow([inst[key].friendly_name, startBtn, renameBtn, delBtn], false, true));
|
||||
$('#instren_'+inst[key].instance).off().on('click', handleInstanceRename);
|
||||
$('#inst_'+inst[key].instance).off().on('click', handleInstanceStartStop);
|
||||
|
||||
$('#inst_'+inst[key].instance).bootstrapToggle();
|
||||
$('#inst_'+inst[key].instance).change(e => {
|
||||
requestInstanceStartStop(e.currentTarget.id.split('_').pop(), e.currentTarget.checked);
|
||||
});
|
||||
$('#instdel_'+inst[key].instance).off().on('click', handleInstanceDelete);
|
||||
|
||||
|
||||
window.readOnlyMode ? $('#instren_'+inst[key].instance).attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
window.readOnlyMode ? $('#inst_'+inst[key].instance).attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
window.readOnlyMode ? $('#instdel_'+inst[key].instance).attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
|
@@ -306,6 +306,13 @@ $(document).ready(function () {
|
||||
loadContent(e);
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
|
||||
$(window).scroll(function(){
|
||||
if ($(window).scrollTop() > 65)
|
||||
$("#navbar_brand_logo").css("display", "none");
|
||||
else
|
||||
$("#navbar_brand_logo").css("display", "");
|
||||
});
|
||||
});
|
||||
|
||||
function suppressDefaultPwWarning() {
|
||||
|
@@ -5,6 +5,9 @@ var finalLedArray = [];
|
||||
var conf_editor = null;
|
||||
var blacklist_editor = null;
|
||||
var aceEdt = null;
|
||||
var imageCanvasNodeCtx;
|
||||
var canvas_height;
|
||||
var canvas_width;
|
||||
|
||||
var devRPiSPI = ['apa102', 'apa104', 'ws2801', 'lpd6803', 'lpd8806', 'p9813', 'sk6812spi', 'sk6822spi', 'sk9822', 'ws2812spi'];
|
||||
var devRPiPWM = ['ws281x'];
|
||||
@@ -39,8 +42,11 @@ function createLedPreview(leds, origin) {
|
||||
|
||||
$('.st_helper').css("border", "8px solid grey");
|
||||
|
||||
var canvas_height = $('#leds_preview').innerHeight();
|
||||
var canvas_width = $('#leds_preview').innerWidth();
|
||||
canvas_height = $('#leds_preview').innerHeight();
|
||||
canvas_width = $('#leds_preview').innerWidth();
|
||||
|
||||
imageCanvasNodeCtx = document.getElementById("image_preview").getContext("2d");
|
||||
$('#image_preview').css({"width":canvas_width, "height":canvas_height});
|
||||
|
||||
var leds_html = "";
|
||||
for (var idx = 0; idx < leds.length; idx++) {
|
||||
@@ -415,6 +421,9 @@ $(document).ready(function () {
|
||||
// translate
|
||||
performTranslation();
|
||||
|
||||
// update instance listing
|
||||
updateHyperionInstanceListing();
|
||||
|
||||
//add intros
|
||||
if (window.showOptHelp) {
|
||||
createHintH("intro", $.i18n('conf_leds_device_intro'), "leddevice_intro");
|
||||
@@ -552,6 +561,31 @@ $(document).ready(function () {
|
||||
toggleClass('#leds_prev_toggle_num', "btn-danger", "btn-success");
|
||||
});
|
||||
|
||||
// toggle live video
|
||||
$('#leds_prev_toggle_live_video').off().on("click", function() {
|
||||
setClassByBool('#leds_prev_toggle_live_video', window.imageStreamActive, "btn-success", "btn-danger");
|
||||
if (window.imageStreamActive)
|
||||
{
|
||||
requestLedImageStop();
|
||||
imageCanvasNodeCtx.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
requestLedImageStart();
|
||||
}
|
||||
});
|
||||
|
||||
$(window.hyperion).on("cmd-ledcolors-imagestream-update",function(event){
|
||||
setClassByBool('#leds_prev_toggle_live_video', window.imageStreamActive, "btn-danger", "btn-success");
|
||||
var imageData = (event.response.result.image);
|
||||
|
||||
var image = new Image();
|
||||
image.onload = function() {
|
||||
imageCanvasNodeCtx.drawImage(image, 0, 0, imageCanvasNodeCtx.canvas.width, imageCanvasNodeCtx.canvas.height);
|
||||
};
|
||||
image.src = imageData;
|
||||
});
|
||||
|
||||
// open checklist
|
||||
$('#leds_prev_checklist').off().on("click", function () {
|
||||
var liList = [$.i18n('conf_leds_layout_checkp1'), $.i18n('conf_leds_layout_checkp3'), $.i18n('conf_leds_layout_checkp2'), $.i18n('conf_leds_layout_checkp4')];
|
||||
@@ -725,11 +759,11 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
if (ledType !== window.serverConfig.device.type) {
|
||||
var hwLedCount = conf_editor.getEditor("root.generalOptions.hardwareLedCount")
|
||||
var hwLedCount = conf_editor.getEditor("root.generalOptions.hardwareLedCount");
|
||||
if (hwLedCount) {
|
||||
hwLedCount.setValue(hwLedCountDefault);
|
||||
}
|
||||
var colorOrder = conf_editor.getEditor("root.generalOptions.colorOrder")
|
||||
var colorOrder = conf_editor.getEditor("root.generalOptions.colorOrder");
|
||||
if (colorOrder) {
|
||||
colorOrder.setValue(colorOrderDefault);
|
||||
}
|
||||
@@ -830,7 +864,7 @@ $(document).ready(function () {
|
||||
//Disable General Options, as LED count will be resolved from device itself
|
||||
conf_editor.getEditor("root.generalOptions").disable();
|
||||
|
||||
var hostList = conf_editor.getEditor("root.specificOptions.hostList")
|
||||
var hostList = conf_editor.getEditor("root.specificOptions.hostList");
|
||||
if (hostList) {
|
||||
var val = hostList.getValue();
|
||||
var showOptions = true;
|
||||
@@ -875,7 +909,7 @@ $(document).ready(function () {
|
||||
case "nanoleaf":
|
||||
var token = conf_editor.getEditor("root.specificOptions.token").getValue();
|
||||
if (token === "") {
|
||||
return
|
||||
return;
|
||||
}
|
||||
params = { host: host, token: token };
|
||||
break;
|
||||
@@ -1400,7 +1434,7 @@ var updateSelectList = function (ledType, discoveryInfo) {
|
||||
if (enumVals.length > 0) {
|
||||
updateJsonEditorSelection(specOpt, key, addSchemaElements, enumVals, enumTitelVals, enumDefaultVal, addSelect, addCustom);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
async function discover_device(ledType, params) {
|
||||
const result = await requestLedDeviceDiscovery(ledType, params);
|
||||
@@ -1519,27 +1553,6 @@ function updateElements(ledType, key) {
|
||||
}
|
||||
}
|
||||
|
||||
function showInputOptions(path, elements, state) {
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
$('[data-schemapath="' + path + '.' + elements[i] + '"]').toggle(state);
|
||||
}
|
||||
}
|
||||
|
||||
function showInputOptionsForKey(editor, item, showForKey, state) {
|
||||
var elements = [];
|
||||
for (var key in editor.schema.properties[item].properties) {
|
||||
if (showForKey !== key) {
|
||||
var accessLevel = editor.schema.properties[item].properties[key].access;
|
||||
|
||||
//Only enable elements, if access level compliant
|
||||
if (state && isAccessLevelCompliant(accessLevel)) {
|
||||
elements.push(key);
|
||||
}
|
||||
}
|
||||
showInputOptions("root." + item, elements, state);
|
||||
}
|
||||
}
|
||||
|
||||
function showAllDeviceInputOptions(showForKey, state) {
|
||||
showInputOptionsForKey(conf_editor, "generalOptions", showForKey, state);
|
||||
showInputOptionsForKey(conf_editor, "specificOptions", showForKey, state);
|
||||
|
@@ -153,16 +153,13 @@ $(document).ready(function () {
|
||||
|
||||
$(window.hyperion).on("cmd-logging-update", function (event) {
|
||||
|
||||
messages = (event.response.result.messages);
|
||||
var messages = (event.response.result.messages);
|
||||
|
||||
if (messages.length != 0) {
|
||||
if (!createdCont) {
|
||||
createLogContainer();
|
||||
createdCont = true;
|
||||
}
|
||||
|
||||
var currentlogLevel = window.serverConfig.logger.level;
|
||||
|
||||
updateLogOutput(messages)
|
||||
}
|
||||
});
|
||||
@@ -177,13 +174,8 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
var currentlogLevel = window.serverConfig.logger.level;
|
||||
var displayedLogLevel = conf_editor.getEditor("root.logger.level").getValue();
|
||||
|
||||
//if ( currentlogLevel !== displayedLogLevel )
|
||||
{
|
||||
conf_editor.getEditor("root.logger.level").setValue(currentlogLevel);
|
||||
location.reload();
|
||||
}
|
||||
conf_editor.getEditor("root.logger.level").setValue(currentlogLevel);
|
||||
location.reload();
|
||||
}
|
||||
|
||||
});
|
||||
|
@@ -12,35 +12,35 @@ $(document).ready( function() {
|
||||
{
|
||||
//network
|
||||
$('#conf_cont').append(createRow('conf_cont_net'))
|
||||
$('#conf_cont_net').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_net_heading_title"), 'editor_container_net', 'btn_submit_net'));
|
||||
$('#conf_cont_net').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_net_heading_title"), 'editor_container_net', 'btn_submit_net', 'panel-system'));
|
||||
$('#conf_cont_net').append(createHelpTable(window.schema.network.properties, $.i18n("edt_conf_net_heading_title")));
|
||||
|
||||
//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(createOptPanel('fa-sitemap', $.i18n("edt_conf_js_heading_title"), 'editor_container_jsonserver', 'btn_submit_jsonserver', 'panel-system'));
|
||||
$('#conf_cont_json').append(createHelpTable(window.schema.jsonServer.properties, $.i18n("edt_conf_js_heading_title")));
|
||||
|
||||
//flatbufserver
|
||||
$('#conf_cont').append(createRow('conf_cont_flatbuf'))
|
||||
$('#conf_cont_flatbuf').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_fbs_heading_title"), 'editor_container_fbserver', 'btn_submit_fbserver'));
|
||||
$('#conf_cont_flatbuf').append(createHelpTable(window.schema.flatbufServer.properties, $.i18n("edt_conf_fbs_heading_title")));
|
||||
$('#conf_cont_flatbuf').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_fbs_heading_title"), 'editor_container_fbserver', 'btn_submit_fbserver', 'panel-system'));
|
||||
$('#conf_cont_flatbuf').append(createHelpTable(window.schema.flatbufServer.properties, $.i18n("edt_conf_fbs_heading_title"),"flatbufServerHelpPanelId"));
|
||||
|
||||
//protoserver
|
||||
$('#conf_cont').append(createRow('conf_cont_proto'))
|
||||
$('#conf_cont_proto').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_pbs_heading_title"), 'editor_container_protoserver', 'btn_submit_protoserver'));
|
||||
$('#conf_cont_proto').append(createHelpTable(window.schema.protoServer.properties, $.i18n("edt_conf_pbs_heading_title")));
|
||||
$('#conf_cont_proto').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_pbs_heading_title"), 'editor_container_protoserver', 'btn_submit_protoserver', 'panel-system'));
|
||||
$('#conf_cont_proto').append(createHelpTable(window.schema.protoServer.properties, $.i18n("edt_conf_pbs_heading_title"),"protoServerHelpPanelId"));
|
||||
|
||||
//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'));
|
||||
$('#conf_cont_bobl').append(createHelpTable(window.schema.boblightServer.properties, $.i18n("edt_conf_bobls_heading_title")));
|
||||
$('#conf_cont_bobl').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_bobls_heading_title"), 'editor_container_boblightserver', 'btn_submit_boblightserver', 'panel-system'));
|
||||
$('#conf_cont_bobl').append(createHelpTable(window.schema.boblightServer.properties, $.i18n("edt_conf_bobls_heading_title"), "boblightServerHelpPanelId"));
|
||||
|
||||
//forwarder
|
||||
if(storedAccess != 'default')
|
||||
{
|
||||
$('#conf_cont').append(createRow('conf_cont_fw'))
|
||||
$('#conf_cont_fw').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_fw_heading_title"), 'editor_container_forwarder', 'btn_submit_forwarder'));
|
||||
$('#conf_cont_fw').append(createHelpTable(window.schema.forwarder.properties, $.i18n("edt_conf_fw_heading_title")));
|
||||
$('#conf_cont_fw').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_fw_heading_title"), 'editor_container_forwarder', 'btn_submit_forwarder', 'panel-system'));
|
||||
$('#conf_cont_fw').append(createHelpTable(window.schema.forwarder.properties, $.i18n("edt_conf_fw_heading_title"),"forwarderHelpPanelId"));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -87,7 +87,15 @@ $(document).ready( function() {
|
||||
flatbufServer : window.schema.flatbufServer
|
||||
}, true, true);
|
||||
|
||||
conf_editor_fbs.on('change',function() {
|
||||
conf_editor_fbs.on('change', function () {
|
||||
var flatbufServerEnable = conf_editor_fbs.getEditor("root.flatbufServer.enable").getValue();
|
||||
if (flatbufServerEnable) {
|
||||
showInputOptionsForKey(conf_editor_fbs, "flatbufServer", "enable", true);
|
||||
$('#flatbufServerHelpPanelId').show();
|
||||
} else {
|
||||
showInputOptionsForKey(conf_editor_fbs, "flatbufServer", "enable", false);
|
||||
$('#flatbufServerHelpPanelId').hide();
|
||||
}
|
||||
conf_editor_fbs.validate().length || window.readOnlyMode ? $('#btn_submit_fbserver').attr('disabled', true) : $('#btn_submit_fbserver').attr('disabled', false);
|
||||
});
|
||||
|
||||
@@ -100,7 +108,15 @@ $(document).ready( function() {
|
||||
protoServer : window.schema.protoServer
|
||||
}, true, true);
|
||||
|
||||
conf_editor_proto.on('change',function() {
|
||||
conf_editor_proto.on('change', function () {
|
||||
var protoServerEnable = conf_editor_proto.getEditor("root.protoServer.enable").getValue();
|
||||
if (protoServerEnable) {
|
||||
showInputOptionsForKey(conf_editor_proto, "protoServer", "enable", true);
|
||||
$('#protoServerHelpPanelId').show();
|
||||
} else {
|
||||
showInputOptionsForKey(conf_editor_proto, "protoServer", "enable", false);
|
||||
$('#protoServerHelpPanelId').hide();
|
||||
}
|
||||
conf_editor_proto.validate().length || window.readOnlyMode ? $('#btn_submit_protoserver').attr('disabled', true) : $('#btn_submit_protoserver').attr('disabled', false);
|
||||
});
|
||||
|
||||
@@ -113,11 +129,19 @@ $(document).ready( function() {
|
||||
boblightServer : window.schema.boblightServer
|
||||
}, true, true);
|
||||
|
||||
conf_editor_bobl.on('change',function() {
|
||||
conf_editor_bobl.on('change', function () {
|
||||
var boblightServerEnable = conf_editor_bobl.getEditor("root.boblightServer.enable").getValue();
|
||||
if (boblightServerEnable) {
|
||||
showInputOptionsForKey(conf_editor_bobl, "boblightServer", "enable", true);
|
||||
$('#boblightServerHelpPanelId').show();
|
||||
} else {
|
||||
showInputOptionsForKey(conf_editor_bobl, "boblightServer", "enable", false);
|
||||
$('#boblightServerHelpPanelId').hide();
|
||||
}
|
||||
conf_editor_bobl.validate().length || window.readOnlyMode ? $('#btn_submit_boblightserver').attr('disabled', true) : $('#btn_submit_boblightserver').attr('disabled', false);
|
||||
});
|
||||
|
||||
$('#btn_submit_boblightserver').off().on('click',function() {
|
||||
$('#btn_submit_boblightserver').off().on('click', function () {
|
||||
requestWriteConfig(conf_editor_bobl.getValue());
|
||||
});
|
||||
|
||||
@@ -128,7 +152,15 @@ $(document).ready( function() {
|
||||
forwarder : window.schema.forwarder
|
||||
}, true, true);
|
||||
|
||||
conf_editor_forw.on('change',function() {
|
||||
conf_editor_forw.on('change', function () {
|
||||
var forwarderEnable = conf_editor_forw.getEditor("root.forwarder.enable").getValue();
|
||||
if (forwarderEnable) {
|
||||
showInputOptionsForKey(conf_editor_forw, "forwarder", "enable", true);
|
||||
$('#forwarderHelpPanelId').show();
|
||||
} else {
|
||||
showInputOptionsForKey(conf_editor_forw, "forwarder", "enable", false);
|
||||
$('#forwarderHelpPanelId').hide();
|
||||
}
|
||||
conf_editor_forw.validate().length || window.readOnlyMode ? $('#btn_submit_forwarder').attr('disabled', true) : $('#btn_submit_forwarder').attr('disabled', false);
|
||||
});
|
||||
|
||||
@@ -213,6 +245,6 @@ $(document).ready( function() {
|
||||
})
|
||||
|
||||
checkApiTokenState(window.serverConfig.network.apiAuth);
|
||||
|
||||
|
||||
removeOverlay();
|
||||
});
|
||||
|
@@ -1,6 +1,9 @@
|
||||
$(document).ready(function () {
|
||||
performTranslation();
|
||||
|
||||
// update instance listing
|
||||
updateHyperionInstanceListing();
|
||||
|
||||
var oldEffects = [];
|
||||
var cpcolor = '#B500FF';
|
||||
var mappingList = window.serverSchema.properties.color.properties.imageToLedMappingType.enum;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
var conf_editor = null;
|
||||
|
||||
$('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_webc_heading_title"), 'editor_container', 'btn_submit'));
|
||||
$('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_webc_heading_title"), 'editor_container', 'btn_submit', 'panel-system'));
|
||||
if(window.showOptHelp)
|
||||
{
|
||||
$('#conf_cont').append(createHelpTable(window.schema.webConfig.properties, $.i18n("edt_conf_webc_heading_title")));
|
||||
|
@@ -82,7 +82,7 @@ function initWebSocket()
|
||||
else if (document.location.port == '' && document.location.protocol == "https:")
|
||||
window.jsonPort = '443';
|
||||
else
|
||||
window.jsonPort = document.location.port;
|
||||
window.jsonPort = document.location.port;
|
||||
window.websocket = (document.location.protocol == "https:") ? new WebSocket('wss://'+document.location.hostname+":"+window.jsonPort) : new WebSocket('ws://'+document.location.hostname+":"+window.jsonPort);
|
||||
|
||||
window.websocket.onopen = function (event) {
|
||||
|
File diff suppressed because one or more lines are too long
@@ -190,19 +190,15 @@ function initLanguageSelection() {
|
||||
}
|
||||
|
||||
function updateUiOnInstance(inst) {
|
||||
if (inst != 0) {
|
||||
var currentURL = $(location).attr("href");
|
||||
if (currentURL.indexOf('#conf_network') != -1 || currentURL.indexOf('#update') != -1 || currentURL.indexOf('#conf_webconfig') != -1 || currentURL.indexOf('#conf_grabber') != -1 || currentURL.indexOf('#conf_logging') != -1)
|
||||
$("#hyperion_global_setting_notify").fadeIn("fast");
|
||||
else
|
||||
$("#hyperion_global_setting_notify").attr("style", "display:none");
|
||||
|
||||
$("#dashboard_active_instance_friendly_name").html($.i18n('dashboard_active_instance') + ': ' + window.serverInfo.instance[inst].friendly_name);
|
||||
$("#dashboard_active_instance").removeAttr("style");
|
||||
}
|
||||
else {
|
||||
$("#hyperion_global_setting_notify").fadeOut("fast");
|
||||
$("#dashboard_active_instance").attr("style", "display:none");
|
||||
$("#active_instance_friendly_name").text(window.serverInfo.instance[inst].friendly_name);
|
||||
if (window.serverInfo.instance.filter(entry => entry.running).length > 1) {
|
||||
$('#btn_hypinstanceswitch').toggle(true);
|
||||
$('#active_instance_dropdown').prop('disabled', false);
|
||||
$('#active_instance_dropdown').css('cursor', 'pointer');
|
||||
} else {
|
||||
$('#btn_hypinstanceswitch').toggle(false);
|
||||
$('#active_instance_dropdown').prop('disabled', true);
|
||||
$("#active_instance_dropdown").css('cursor', 'default');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,17 +256,17 @@ function showInfoDialog(type, header, message) {
|
||||
$('#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_body').html('<img style="margin-bottom:20px" id="id_logo" src="img/hyperion/logo_positiv.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>');
|
||||
$('#id_footer').append('<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
|
||||
}
|
||||
else if (type == "iswitch") {
|
||||
$('#id_body').html('<img style="margin-bottom:20px" src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!">');
|
||||
$('#id_body').html('<img style="margin-bottom:20px" id="id_logo" src="img/hyperion/logo_positiv.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-exchange"></i>' + $.i18n('general_btn_iswitch') + '</button>');
|
||||
$('#id_footer').append('<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
|
||||
}
|
||||
else if (type == "uilock") {
|
||||
$('#id_body').html('<img src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!">');
|
||||
$('#id_body').html('<img id="id_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!">');
|
||||
$('#id_footer').html('<b>' + $.i18n('InfoDialog_nowrite_foottext') + '</b>');
|
||||
}
|
||||
else if (type == "import") {
|
||||
@@ -294,22 +290,22 @@ function showInfoDialog(type, header, message) {
|
||||
$('#id_body_rename').html('<i style="margin-bottom:20px" class="fa fa-key modal-icon-edit"><br>');
|
||||
$('#id_body_rename').append('<h4>' + header + '</h4>');
|
||||
$('#id_body_rename').append('<input class="form-control" id="oldPw" placeholder="Old" type="text"> <br />');
|
||||
$('#id_body_rename').append('<input class="form-control" id="newPw" placeholder="New" type="text">');
|
||||
$('#id_body_rename').append('<input class="form-control" id="newPw" placeholder="New" type="password">');
|
||||
$('#id_footer_rename').html('<button type="button" id="id_btn_ok" class="btn btn-success" data-dismiss-modal="#modal_dialog_rename" disabled><i class="fa fa-fw fa-save"></i>' + $.i18n('general_btn_ok') + '</button>');
|
||||
$('#id_footer_rename').append('<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
|
||||
}
|
||||
else if (type == "checklist") {
|
||||
$('#id_body').html('<img style="margin-bottom:20px" src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!">');
|
||||
$('#id_body').html('<img style="margin-bottom:20px" id="id_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!">');
|
||||
$('#id_body').append('<h4 style="font-weight:bold;text-transform:uppercase;">' + $.i18n('infoDialog_checklist_title') + '</h4>');
|
||||
$('#id_body').append(header);
|
||||
$('#id_footer').html('<button type="button" class="btn btn-primary" data-dismiss="modal">' + $.i18n('general_btn_ok') + '</button>');
|
||||
}
|
||||
else if (type == "newToken") {
|
||||
$('#id_body').html('<img style="margin-bottom:20px" src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!">');
|
||||
$('#id_body').html('<img style="margin-bottom:20px" id="id_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!">');
|
||||
$('#id_footer').html('<button type="button" class="btn btn-primary" data-dismiss="modal">' + $.i18n('general_btn_ok') + '</button>');
|
||||
}
|
||||
else if (type == "grantToken") {
|
||||
$('#id_body').html('<img style="margin-bottom:20px" src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!">');
|
||||
$('#id_body').html('<img style="margin-bottom:20px" id="id_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!">');
|
||||
$('#id_footer').html('<button type="button" class="btn btn-primary" data-dismiss="modal" id="tok_grant_acc">' + $.i18n('general_btn_grantAccess') + '</button>');
|
||||
$('#id_footer').append('<button type="button" class="btn btn-danger" data-dismiss="modal" id="tok_deny_acc">' + $.i18n('general_btn_denyAccess') + '</button>');
|
||||
}
|
||||
@@ -322,6 +318,9 @@ function showInfoDialog(type, header, message) {
|
||||
if (type == "select" || type == "iswitch")
|
||||
$('#id_body').append('<select id="id_select" class="form-control" style="margin-top:10px;width:auto;"></select>');
|
||||
|
||||
if (getStorage("darkMode", false) == "on")
|
||||
$('#id_logo').attr("src", 'img/hyperion/logo_negativ.png');
|
||||
|
||||
$(type == "renInst" || type == "changePassword" ? "#modal_dialog_rename" : "#modal_dialog").modal({
|
||||
backdrop: "static",
|
||||
keyboard: false,
|
||||
@@ -330,7 +329,7 @@ function showInfoDialog(type, header, message) {
|
||||
|
||||
$(document).on('click', '[data-dismiss-modal]', function () {
|
||||
var target = $(this).attr('data-dismiss-modal');
|
||||
$(target).modal('hide');
|
||||
$(target).modal('hide'); // lgtm [js/xss-through-dom]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -808,14 +807,14 @@ function createRow(id) {
|
||||
return el;
|
||||
}
|
||||
|
||||
function createOptPanel(phicon, phead, bodyid, footerid) {
|
||||
function createOptPanel(phicon, phead, bodyid, footerid, css) {
|
||||
phead = '<i class="fa ' + phicon + ' fa-fw"></i>' + phead;
|
||||
var pfooter = document.createElement('button');
|
||||
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);
|
||||
return createPanel(phead, "", pfooter, "panel-default", bodyid, css);
|
||||
}
|
||||
|
||||
function compareTwoValues(key1, key2, order = 'asc') {
|
||||
@@ -872,7 +871,7 @@ function sortProperties(list) {
|
||||
});
|
||||
}
|
||||
|
||||
function createHelpTable(list, phead) {
|
||||
function createHelpTable(list, phead, panelId) {
|
||||
var table = document.createElement('table');
|
||||
var thead = document.createElement('thead');
|
||||
var tbody = document.createElement('tbody');
|
||||
@@ -911,10 +910,10 @@ function createHelpTable(list, phead) {
|
||||
table.appendChild(thead);
|
||||
table.appendChild(tbody);
|
||||
|
||||
return createPanel(phead, table);
|
||||
return createPanel(phead, table, undefined, undefined, undefined, undefined, panelId);
|
||||
}
|
||||
|
||||
function createPanel(head, body, footer, type, bodyid) {
|
||||
function createPanel(head, body, footer, type, bodyid, css, panelId) {
|
||||
var cont = document.createElement('div');
|
||||
var p = document.createElement('div');
|
||||
var phead = document.createElement('div');
|
||||
@@ -927,7 +926,11 @@ function createPanel(head, body, footer, type, bodyid) {
|
||||
type = 'panel-default';
|
||||
|
||||
p.className = 'panel ' + type;
|
||||
phead.className = 'panel-heading';
|
||||
if (typeof panelId != 'undefined') {
|
||||
p.setAttribute("id", panelId);
|
||||
}
|
||||
|
||||
phead.className = 'panel-heading ' + css;
|
||||
pbody.className = 'panel-body';
|
||||
pfooter.className = 'panel-footer';
|
||||
|
||||
@@ -1116,7 +1119,8 @@ function handleDarkMode() {
|
||||
|
||||
setStorage("darkMode", "on", false);
|
||||
$('#btn_darkmode_icon').removeClass('fa fa-moon-o');
|
||||
$('#btn_darkmode_icon').addClass('fa fa-sun-o');
|
||||
$('#btn_darkmode_icon').addClass('mdi mdi-white-balance-sunny');
|
||||
$('#navbar_brand_logo').attr("src", 'img/hyperion/logo_negativ.png');
|
||||
}
|
||||
|
||||
function isAccessLevelCompliant(accessLevel) {
|
||||
@@ -1134,3 +1138,24 @@ function isAccessLevelCompliant(accessLevel) {
|
||||
}
|
||||
return isOK
|
||||
}
|
||||
|
||||
function showInputOptions(path, elements, state) {
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
$('[data-schemapath="' + path + '.' + elements[i] + '"]').toggle(state);
|
||||
}
|
||||
}
|
||||
|
||||
function showInputOptionsForKey(editor, item, showForKey, state) {
|
||||
var elements = [];
|
||||
for (var key in editor.schema.properties[item].properties) {
|
||||
if (showForKey !== key) {
|
||||
var accessLevel = editor.schema.properties[item].properties[key].access;
|
||||
|
||||
//Always disable all elements, but only enable elements, if access level compliant
|
||||
if (!state || isAccessLevelCompliant(accessLevel)) {
|
||||
elements.push(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
showInputOptions("root." + item, elements, state);
|
||||
}
|
||||
|
@@ -53,6 +53,9 @@ function startWizardRGB() {
|
||||
$('#wizp2_body').append('<table class="table borderless" style="width:200px"><tbody><tr><td class="ltd"><label>' + $.i18n('wiz_rgb_qrend') + '</label></td><td class="itd"><select id="wiz_r_select" class="form-control wselect"></select></td></tr><tr><td class="ltd"><label>' + $.i18n('wiz_rgb_qgend') + '</label></td><td class="itd"><select id="wiz_g_select" class="form-control wselect"></select></td></tr></tbody></table>');
|
||||
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_save"><i class="fa fa-fw fa-save"></i>' + $.i18n('general_btn_save') + '</button><button type="button" class="btn btn-primary" id="btn_wiz_checkok" style="display:none" data-dismiss="modal"><i class="fa fa-fw fa-check"></i>' + $.i18n('general_btn_ok') + '</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
|
||||
|
||||
if (getStorage("darkMode", false) == "on")
|
||||
$('#wizard_logo').attr("src", 'img/hyperion/logo_negativ.png');
|
||||
|
||||
//open modal
|
||||
$("#wizard_modal").modal({
|
||||
backdrop: "static",
|
||||
@@ -429,6 +432,9 @@ function startWizardCC() {
|
||||
$('#wizp2_body').html('<div id="wiz_cc_desc" style="font-weight:bold"></div><div id="editor_container_wiz"></div>');
|
||||
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_back"><i class="fa fa-fw fa-chevron-left"></i>' + $.i18n('general_btn_back') + '</button><button type="button" class="btn btn-primary" id="btn_wiz_next">' + $.i18n('general_btn_next') + '<i style="margin-left:4px;"class="fa fa-fw fa-chevron-right"></i></button><button type="button" class="btn btn-warning" id="btn_wiz_save" style="display:none"><i class="fa fa-fw fa-save"></i>' + $.i18n('general_btn_save') + '</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
|
||||
|
||||
if (getStorage("darkMode", false) == "on")
|
||||
$('#wizard_logo').attr("src", 'img/hyperion/logo_negativ.png');
|
||||
|
||||
//open modal
|
||||
$("#wizard_modal").modal({
|
||||
backdrop: "static",
|
||||
@@ -669,6 +675,9 @@ function startWizardPhilipsHue(e) {
|
||||
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_save" style="display:none"><i class="fa fa-fw fa-save"></i>' + $.i18n('general_btn_save') + '</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
|
||||
$('#wizp3_body').html('<span>' + $.i18n('wiz_hue_press_link') + '</span> <br /><br /><center><span id="connectionTime"></span><br /><i class="fa fa-cog fa-spin" style="font-size:100px"></i></center>');
|
||||
|
||||
if (getStorage("darkMode", false) == "on")
|
||||
$('#wizard_logo').attr("src", 'img/hyperion/logo_negativ.png');
|
||||
|
||||
//open modal
|
||||
$("#wizard_modal").modal({
|
||||
backdrop: "static",
|
||||
@@ -832,8 +841,8 @@ async function identify_hue_device(hostAddress, username, id) {
|
||||
await requestLedDeviceIdentification('philipshue', params);
|
||||
|
||||
if (!window.readOnlyMode) {
|
||||
$('#btn_wiz_save').attr('disabled', false);
|
||||
}
|
||||
$('#btn_wiz_save').attr('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
function getHueIPs() {
|
||||
@@ -1233,6 +1242,9 @@ function startWizardYeelight(e) {
|
||||
+ $.i18n('general_btn_save') + '</button><buttowindow.serverConfig.device = d;n type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'
|
||||
+ $.i18n('general_btn_cancel') + '</button>');
|
||||
|
||||
if (getStorage("darkMode", false) == "on")
|
||||
$('#wizard_logo').attr("src", 'img/hyperion/logo_negativ.png');
|
||||
|
||||
//open modal
|
||||
$("#wizard_modal").modal({ backdrop: "static", keyboard: false, show: true });
|
||||
|
||||
@@ -1499,6 +1511,9 @@ function startWizardAtmoOrb(e) {
|
||||
+ $.i18n('general_btn_save') + '</button><buttowindow.serverConfig.device = d;n type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'
|
||||
+ $.i18n('general_btn_cancel') + '</button>');
|
||||
|
||||
if (getStorage("darkMode", false) == "on")
|
||||
$('#wizard_logo').attr("src", 'img/hyperion/logo_negativ.png');
|
||||
|
||||
//open modal
|
||||
$("#wizard_modal").modal({ backdrop: "static", keyboard: false, show: true });
|
||||
|
||||
|
Reference in New Issue
Block a user