UI System Log - Fixes and enhancements (#1223)

This commit is contained in:
LordGrey 2021-04-25 17:22:59 +02:00 committed by GitHub
parent 724d90bfdb
commit 71e34a6a55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 351 additions and 393 deletions

View File

@ -31,39 +31,9 @@
libh += "<br/>" + $.i18n("about_credits"); libh += "<br/>" + $.i18n("about_credits");
lang = lang.toString().replace(/,/g, ", "); lang = lang.toString().replace(/,/g, ", ");
// Github Issue bugreport infos // Github Issue bugreport infos
var sys = window.sysInfo.system; var sysInfo = getSystemInfo();
var shy = window.sysInfo.hyperion; var info = '<pre>' + sysInfo + '</pre>';
var info = "<pre>Hyperion Server: \n";
info += '- Build: ' + shy.build + '\n';
info += '- Build time: ' + shy.time + '\n';
info += '- Git Remote: ' + shy.gitremote + '\n';
info += '- Version: ' + shy.version + '\n';
info += '- UI Lang: ' + storedLang + ' (BrowserLang: ' + navigator.language + ')\n';
info += '- UI Access: ' + storedAccess + '\n';
//info += '- Log lvl: ' + window.serverConfig.logger.level + '\n';
info += '- Avail Capt: ' + window.serverInfo.grabbers.available + '\n';
info += '- Database: ' + (shy.readOnlyMode ? "ready-only" : "read/write") + '\n';
info += '\n';
info += 'Hyperion Server OS: \n';
info += '- Distribution: ' + sys.prettyName + '\n';
info += '- Architecture: ' + sys.architecture + '\n';
if (sys.cpuModelName)
info += '- CPU Model: ' + sys.cpuModelName + '\n';
if (sys.cpuModelType)
info += '- CPU Type: ' + sys.cpuModelType + '\n';
if (sys.cpuRevision)
info += '- CPU Revision: ' + sys.cpuRevision + '\n';
if (sys.cpuHardware)
info += '- CPU Hardware: ' + sys.cpuHardware + '\n';
info += '- Kernel: ' + sys.kernelType + ' (' + sys.kernelVersion + ' (WS: ' + sys.wordSize + '))\n';
info += '- Qt Version: ' + sys.qtVersion + '\n';
info += '- Python Version: ' + sys.pyVersion + '\n';
info += '- Browser: ' + navigator.userAgent + ' </pre>';
var fc = ['<span id="danger_trig">' + $.i18n("about_version") + '<span>', $.i18n("about_build"), $.i18n("about_builddate"), $.i18n("about_translations"), $.i18n("about_resources", $.i18n("general_webui_title")), "System info (Github Issue)", $.i18n("about_3rd_party_licenses")]; var fc = ['<span id="danger_trig">' + $.i18n("about_version") + '<span>', $.i18n("about_build"), $.i18n("about_builddate"), $.i18n("about_translations"), $.i18n("about_resources", $.i18n("general_webui_title")), "System info (Github Issue)", $.i18n("about_3rd_party_licenses")];
var sc = [currentVersion, si.build, si.time, '(' + availLang.length + ')<p>' + lang + '</p><p><a href="https://github.com/hyperion-project/hyperion.ng" target="_blank">' + $.i18n("about_contribute") + '</a></p>', libh, info, '<pre><div id="3rdpartylicenses" style="overflow:scroll;max-height:400px"></div></pre>']; var sc = [currentVersion, si.build, si.time, '(' + availLang.length + ')<p>' + lang + '</p><p><a href="https://github.com/hyperion-project/hyperion.ng" target="_blank">' + $.i18n("about_contribute") + '</a></p>', libh, info, '<pre><div id="3rdpartylicenses" style="overflow:scroll;max-height:400px"></div></pre>'];

View File

@ -1,21 +1,22 @@
<div class="container-fluid" id="trans_conf_logging"> <div class="container-fluid" id="trans_conf_logging">
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<h3 class="page-header"><i class="fa fa-reorder fa-fw"></i><span data-i18n="main_menu_logging_token">Log</span></h3> <h3 class="page-header"><i class="fa fa-reorder fa-fw"></i><span data-i18n="main_menu_logging_token">Log</span></h3>
<div id="log_head"></div> <div id="log_head"></div>
<div class="row" id='conf_cont'></div> <div class="row" id='conf_cont'></div>
<hr /> </div>
<div id="log_content"><span style="font-weight:bold;font-size:17px" data-i18n="conf_logging_nomessage"></span></div> <div class="col-lg-12">
<hr> <div class="panel panel-default">
<div style="display:none"> <div class="panel-heading"><i class="fa fa-book fa-fw"></i><span data-i18n="conf_logging_logoutput"></span></div>
<h4 style="font-weight:bold"><i class="fa fa-reorder fa-fw"></i><span data-i18n="conf_logging_report">Bericht</span></h4> <div class="panel-body">
<button class="btn btn-primary" id="btn_logupload"><i class="fa fa-upload fa-fw"></i><span data-i18n="conf_logging_btn_pbupload"></span></button> <div id="log_content"><span style="font-weight:bold;font-size:17px" data-i18n="conf_logging_nomessage"></span></div>
<div id="log_upl_pol"></div> </div>
<div id="upl_link" style="margin-top:10px;font-weight:bold;"></div> <div class="panel-footer" id="log_footer">
<div id="prev_reports"></div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script src="/js/content_logging.js"></script> <script src="/js/content_logging.js"></script>

View File

@ -125,6 +125,7 @@
"conf_logging_label_intro": "Area to check log messages, you will see more or less information depending on the logging level set.", "conf_logging_label_intro": "Area to check log messages, you will see more or less information depending on the logging level set.",
"conf_logging_lastreports": "Previous reports", "conf_logging_lastreports": "Previous reports",
"conf_logging_nomessage": "No log messages available.", "conf_logging_nomessage": "No log messages available.",
"conf_logging_logoutput": "Log output",
"conf_logging_report": "Report", "conf_logging_report": "Report",
"conf_logging_uplfailed": "Upload failed! Please check your internet connection!", "conf_logging_uplfailed": "Upload failed! Please check your internet connection!",
"conf_logging_uploading": "Prepare data...", "conf_logging_uploading": "Prepare data...",

View File

@ -24,8 +24,6 @@ $(document).ready(function () {
$(window.hyperion).on("cmd-serverinfo", function (event) { $(window.hyperion).on("cmd-serverinfo", function (event) {
window.serverInfo = event.response.info; window.serverInfo = event.response.info;
window.readOnlyMode = window.sysInfo.hyperion.readOnlyMode;
// comps // comps
window.comps = event.response.info.components window.comps = event.response.info.components
@ -123,6 +121,7 @@ $(document).ready(function () {
window.currentVersion = window.sysInfo.hyperion.version; window.currentVersion = window.sysInfo.hyperion.version;
window.currentChannel = window.sysInfo.hyperion.channel; window.currentChannel = window.sysInfo.hyperion.channel;
window.readOnlyMode = window.sysInfo.hyperion.readOnlyMode;
}); });
$(window.hyperion).one("cmd-config-getschema", function (event) { $(window.hyperion).one("cmd-config-getschema", function (event) {
@ -340,7 +339,6 @@ $("#btn_darkmode").off().on("click", function (e) {
setStorage("darkModeOverwrite", true, true); setStorage("darkModeOverwrite", true, true);
location.reload(); location.reload();
} }
}); });
// Menuitem toggle; // Menuitem toggle;

View File

@ -1,212 +1,192 @@
var conf_editor = null; var conf_editor = null;
var createdCont = false; var createdCont = false;
var isScroll = true;
performTranslation(); performTranslation();
requestLoggingStop();
requestLoggingStart(); requestLoggingStart();
$(document).ready(function() { $(document).ready(function () {
var messages;
var loguplmess = "";
var reportUrl = 'https://report.hyperion-project.org/#';
$('#conf_cont').append(createOptPanel('fa-reorder', $.i18n("edt_conf_log_heading_title"), 'editor_container', 'btn_submit')); $('#conf_cont').append(createOptPanel('fa-reorder', $.i18n("edt_conf_log_heading_title"), 'editor_container', 'btn_submit'));
if(window.showOptHelp) if (window.showOptHelp) {
{ $('#conf_cont').append(createHelpTable(window.schema.logger.properties, $.i18n("edt_conf_log_heading_title")));
$('#conf_cont').append(createHelpTable(window.schema.logger.properties, $.i18n("edt_conf_log_heading_title"))); createHintH("intro", $.i18n('conf_logging_label_intro'), "log_head");
createHintH("intro", $.i18n('conf_logging_label_intro'), "log_head"); }
}
$("#log_upl_pol").append('<span style="color:grey;font-size:80%">'+$.i18n("conf_logging_uplpolicy")+' '+buildWL("user/support#report_privacy_policy",$.i18n("conf_logging_contpolicy")));
conf_editor = createJsonEditor('editor_container', { conf_editor = createJsonEditor('editor_container', {
logger : window.schema.logger logger: window.schema.logger
}, true, true); }, true, true);
conf_editor.on('change',function() { conf_editor.on('change', function () {
conf_editor.validate().length || window.readOnlyMode ? $('#btn_submit').attr('disabled', true) : $('#btn_submit').attr('disabled', false); conf_editor.validate().length || window.readOnlyMode ? $('#btn_submit').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
}); });
$('#btn_submit').off().on('click',function() { $('#btn_submit').off().on('click', function () {
requestWriteConfig(conf_editor.getValue());
});
$('#btn_logupload').off().on('click',function() { var displayedLogLevel = conf_editor.getEditor("root.logger.level").getValue();
uploadLog(); var newLogLevel = {logger:{}};
$(this).attr("disabled", true); newLogLevel.logger.level = displayedLogLevel;
$('#upl_link').html($.i18n('conf_logging_uploading'))
});
//show prev uploads requestWriteConfig(newLogLevel);
var ent; });
if(getStorage("prev_reports")) function infoSummary() {
{ var info = "";
ent = JSON.parse(getStorage("prev_reports"));
$('#prev_reports').append('<h4 style="margin-top:30px">'+$.i18n('conf_logging_lastreports')+'</h4>');
for(var i = 0; i<ent.length; i++)
{
$('#prev_reports').append('<p><a href="'+reportUrl+ent[i].id+'" target="_blank">'+ent[i].title+'('+ent[i].time+')</a></p>');
}
}
else
ent = [];
function updateLastReports(id,time,title) info += 'Hyperion System Summary Report (' + window.serverConfig.general.name + '), Reported instance: ' + window.currentHyperionInstanceName + '\n';
{
if(ent.length > 4)
ent.pop();
ent.unshift({"id": id ,"time": time,"title": title})
setStorage("prev_reports",JSON.stringify(ent));
}
function uploadLog() info += "\n< ----- System information -------------------- >\n";
{ info += getSystemInfo() + '\n';
var log = "";
var config = JSON.stringify(window.serverConfig, null).replace(/"/g, '\\"');
var prios = window.serverInfo.priorities;
var comps = window.serverInfo.components;
var sys = window.sysInfo.system;
var shy = window.sysInfo.hyperion;
var info;
//create log info += "\n< ----- Configured Instances ------------------ >\n";
log = (messages ? loguplmess : "Log was empty!"); var instances = window.serverInfo.instance;
for (var i = 0; i < instances.length; i++) {
info += instances[i].instance + ': ' + instances[i].friendly_name + ' Running: ' + instances[i].running + '\n';
}
//create general info info += "\n< ----- This instance's priorities ------------ >\n";
info = "### GENERAL ### \n"; var prios = window.serverInfo.priorities;
info += 'Build: '+shy.build+'\n'; for (var i = 0; i < prios.length; i++) {
info += 'Build time: '+shy.time+'\n'; info += prios[i].priority + ': ';
info += 'Version: '+shy.version+'\n'; if (prios[i].visible) {
info += 'UI Lang: '+storedLang+' (BrowserL: '+navigator.language+')\n'; info += ' VISIBLE!';
info += 'UI Access: '+storedAccess+'\n'; }
info += 'Log lvl: '+window.serverConfig.logger.level+'\n'; else {
info += 'Avail Capt: '+window.serverInfo.grabbers.available+'\n'; info += ' ';
info += 'Database: '+(shy.readOnlyMode ? "ready-only" : "read/write")+'\n'; }
info += '\n'; info += ' (' + prios[i].componentId + ') Owner: ' + prios[i].owner + '\n';
}
info += 'priorities_autoselect: ' + window.serverInfo.priorities_autoselect + '\n';
info += 'Distribution: '+sys.prettyName+'\n'; info += "\n< ----- This instance components' status ------->\n";
info += 'Architecture: '+sys.architecture+'\n'; var comps = window.serverInfo.components;
for (var i = 0; i < comps.length; i++) {
info += comps[i].name + ' - ' + comps[i].enabled + '\n';
}
if (sys.cpuModelName) info += "\n< ----- This instance's configuration --------- >\n";
info += 'CPU Model: ' + sys.cpuModelName + '\n'; info += JSON.stringify(window.serverConfig) + '\n';
if (sys.cpuModelType)
info += 'CPU Type: ' + sys.cpuModelType + '\n';
if (sys.cpuRevision)
info += 'CPU Revision: ' + sys.cpuRevision + '\n';
if (sys.cpuHardware)
info += 'CPU Hardware: ' + sys.cpuHardware + '\n';
info += 'Kernel: ' + sys.kernelType+' ('+sys.kernelVersion+' (WS: '+sys.wordSize+'))' + '\n'; info += "\n< ----- Current Log --------------------------- >\n";
info += 'Qt Version: ' + sys.qtVersion + '\n'; var logMsgs = document.getElementById("logmessages").textContent;
info += 'Python Version: ' + sys.pyVersion + '\n'; if (logMsgs.length !== 0) {
info += 'Browser/OS: ' + navigator.userAgent + '\n\n'; info += logMsgs;
} else {
info += "Log is empty!";
}
//create prios return info;
info += "### PRIORITIES ### \n"; }
for(var i = 0; i<prios.length; i++)
{
info += prios[i].priority;
if(prios[i].visible)
info += ' VISIBLE!';
else
info += ' ';
info += ' ('+prios[i].component+') Owner: '+prios[i].owner+'\n';
}
info += '\npriorities_autoselect: '+window.serverInfo.priorities_autoselect+'\n\n';
//create comps function createLogContainer() {
info += '### COMPONENTS ### \n';
for(var i = 0; i<comps.length; i++)
{
info += comps[i].enabled+' - '+comps[i].name+'\n';
}
//escape data const isScrollEnableStyle = (isScroll ? "checked" : "");
info = JSON.stringify(info);
log = JSON.stringify(log);
config = JSON.stringify(config);
var title = 'Hyperion '+window.currentVersion+' Report ('+window.serverConfig.general.name+' ('+window.serverInfo.ledDevices.active+'))';
$.ajax({ $('#log_content').html('<pre><div id="logmessages" style="overflow:scroll;max-height:400px"></div></pre>');
url: 'https://api.hyperion-project.org/report.php', $('#log_footer').append('<label class="checkbox-inline">'
crossDomain: true, + '<input id = "btn_scroll"' + isScrollEnableStyle + ' type = "checkbox"'
contentType: 'application/json', + 'data-toggle="toggle" data-onstyle="success" data-on="' + $.i18n('general_btn_on') + '" data-off="' + $.i18n('general_btn_off') + '">'
type: 'POST', + $.i18n('conf_logging_btn_autoscroll') + '</label>'
timeout: 7000, );
data: '{"title":"'+title+'","info":'+info+',"log":'+log+',"config":'+config+'}'
})
.done( function( data, textStatus, jqXHR ) {
reportUrl += data.id;
if(textStatus == "success")
{
$('#upl_link').html($.i18n('conf_logging_yourlink')+': <a href="'+reportUrl+'" target="_blank">'+reportUrl+'</a>');
$("html, body").animate({ scrollTop: 9999 }, "fast");
updateLastReports(data.id,data.time,title);
}
else
{
$('#btn_logupload').attr("disabled", false);
$('#upl_link').html('<span style="color:red">'+$.i18n('conf_logging_uplfailed')+'<span>');
}
})
.fail( function( jqXHR, textStatus ) {
console.log(jqXHR,textStatus);
$('#btn_logupload').attr("disabled", false);
$('#upl_link').html('<span style="color:red">'+$.i18n('conf_logging_uplfailed')+'<span>');
});
}
if (!window.loggingHandlerInstalled) $(`#btn_scroll`).bootstrapToggle();
{ $(`#btn_scroll`).change(e => {
window.loggingHandlerInstalled = true; if (e.currentTarget.checked) {
$(window.hyperion).on("cmd-logging-update",function(event){ //Scroll to end of log
isScroll = true;
if ($("#logmessages").length > 0) {
$('#logmessages')[0].scrollTop = $('#logmessages')[0].scrollHeight;
}
} else {
isScroll = false;
}
});
if ($("#logmessages").length == 0 && window.loggingStreamActive) $('#log_footer').append('<button class="btn btn-primary pull-right" id="btn_clipboard"><i class="fa fa-fw fa-clipboard"></i>Copy Log to Clipboard</button>');
{
requestLoggingStop();
window.loggingStreamActive = false;
}
messages = (event.response.result.messages); $('#btn_clipboard').off().on('click', function () {
if(messages.length != 0 && !createdCont) const temp = document.createElement('textarea');
{ temp.textContent = infoSummary();
$('#log_content').html('<pre><div id="logmessages" style="overflow:scroll;max-height:400px"></div></pre><button class="btn btn-primary" id="btn_autoscroll"><i class="fa fa-long-arrow-down fa-fw"></i>'+$.i18n('conf_logging_btn_autoscroll')+'</button>'); document.body.append(temp);
createdCont = true; temp.select();
document.execCommand("copy");
temp.remove();
});
}
$('#btn_autoscroll').off().on('click',function() { function updateLogOutput(messages) {
toggleClass('#btn_autoscroll', "btn-success", "btn-danger");
});
}
for(var idx = 0; idx < messages.length; idx++) if (messages.length != 0) {
{
var app_name = messages[idx].appName;
var logger_name = messages[idx].loggerName;
var function_ = messages[idx].function;
var line = messages[idx].line;
var file_name = messages[idx].fileName;
var msg = messages[idx].message;
var level_string = messages[idx].levelString;
var utime = messages[idx].utime;
var debug = ""; for (var idx = 0; idx < messages.length; idx++) {
if(level_string == "DEBUG") { var app_name = messages[idx].appName;
debug = "("+file_name+":"+line+":"+function_+"()) "; var logger_name = messages[idx].loggerName;
} var function_ = messages[idx].function;
var line = messages[idx].line;
var file_name = messages[idx].fileName;
var msg = messages[idx].message;
var level_string = messages[idx].levelString;
var utime = messages[idx].utime;
var date = new Date(parseInt(utime)); var debug = "";
if (level_string == "DEBUG") {
debug = "(" + file_name + ":" + line + ":" + function_ + "()) ";
}
$("#logmessages").append("\n <code>"+date.toISOString()+" ["+app_name+" "+logger_name+"] ("+level_string+") "+debug+msg+"</code>"); var date = new Date(parseInt(utime));
loguplmess += "["+app_name+" "+logger_name+"] ("+level_string+") "+debug+msg+"\n"; var newLogLine = date.toISOString() + " [" + app_name + " " + logger_name + "] (" + level_string + ") " + debug + msg;
}
if($("#btn_autoscroll").hasClass('btn-success')) $("#logmessages").append("<code>" + newLogLine + "</code>\n");
{ }
$('#logmessages').stop().animate({
scrollTop: $('#logmessages')[0].scrollHeight
}, 800);
}
});
}
removeOverlay(); if (isScroll && $("#logmessages").length > 0) {
$('#logmessages').stop().animate({
scrollTop: $('#logmessages')[0].scrollHeight
}, 800);
}
}
}
if (!window.loggingHandlerInstalled) {
window.loggingHandlerInstalled = true;
$(window.hyperion).on("cmd-logging-update", function (event) {
messages = (event.response.result.messages);
if (messages.length != 0) {
if (!createdCont) {
createLogContainer();
createdCont = true;
}
var currentlogLevel = window.serverConfig.logger.level;
updateLogOutput(messages)
}
});
}
$(window.hyperion).on("cmd-settings-update", function (event) {
var obj = event.response.data
if (obj.logger) {
Object.getOwnPropertyNames(obj).forEach(function (val, idx, array) {
window.serverConfig[val] = obj[val];
});
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();
}
}
});
removeOverlay();
}); });

View File

@ -1,13 +1,13 @@
$(document).ready(function() { $(document).ready(function () {
performTranslation(); performTranslation();
var oldEffects = []; var oldEffects = [];
var cpcolor = '#B500FF'; var cpcolor = '#B500FF';
var mappingList = window.serverSchema.properties.color.properties.imageToLedMappingType.enum; var mappingList = window.serverSchema.properties.color.properties.imageToLedMappingType.enum;
var duration = 0; var duration = 0;
var rgb = {r:255,g:0,b:0}; var rgb = { r: 255, g: 0, b: 0 };
var lastImgData = ""; var lastImgData = "";
var lastFileName= ""; var lastFileName = "";
//create html //create html
createTable('ssthead', 'sstbody', 'sstcont'); createTable('ssthead', 'sstbody', 'sstcont');
@ -16,8 +16,7 @@ $(document).ready(function() {
//create introduction //create introduction
if(window.showOptHelp) if (window.showOptHelp) {
{
createHint("intro", $.i18n('remote_color_intro', $.i18n('remote_losthint')), "color_intro"); createHint("intro", $.i18n('remote_color_intro', $.i18n('remote_losthint')), "color_intro");
createHint("intro", $.i18n('remote_input_intro', $.i18n('remote_losthint')), "sstcont"); createHint("intro", $.i18n('remote_input_intro', $.i18n('remote_losthint')), "sstcont");
createHint("intro", $.i18n('remote_adjustment_intro', $.i18n('remote_losthint')), "adjust_content"); createHint("intro", $.i18n('remote_adjustment_intro', $.i18n('remote_losthint')), "adjust_content");
@ -30,83 +29,73 @@ $(document).ready(function() {
var sColor = sortProperties(window.serverSchema.properties.color.properties.channelAdjustment.items.properties); var sColor = sortProperties(window.serverSchema.properties.color.properties.channelAdjustment.items.properties);
var values = window.serverInfo.adjustment[0]; var values = window.serverInfo.adjustment[0];
for(var key in sColor) for (var key in sColor) {
{ if (sColor[key].key != "id" && sColor[key].key != "leds") {
if(sColor[key].key != "id" && sColor[key].key != "leds") var title = '<label for="cr_' + sColor[key].key + '">' + $.i18n(sColor[key].title) + '</label>';
{
var title = '<label for="cr_'+sColor[key].key+'">'+$.i18n(sColor[key].title)+'</label>';
var property; var property;
var value = values[sColor[key].key]; var value = values[sColor[key].key];
if(sColor[key].type == "array") if (sColor[key].type == "array") {
{ property = '<div id="cr_' + sColor[key].key + '" class="input-group colorpicker-component" ><input type="text" class="form-control" /><span class="input-group-addon"><i></i></span></div>';
property = '<div id="cr_'+sColor[key].key+'" class="input-group colorpicker-component" ><input type="text" class="form-control" /><span class="input-group-addon"><i></i></span></div>';
$('.crtbody').append(createTableRow([title, property], false, true)); $('.crtbody').append(createTableRow([title, property], false, true));
createCP('cr_'+sColor[key].key, value, function(rgb,hex,e){ createCP('cr_' + sColor[key].key, value, function (rgb, hex, e) {
requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), '['+rgb.r+','+rgb.g+','+rgb.b+']'); requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), '[' + rgb.r + ',' + rgb.g + ',' + rgb.b + ']');
}); });
} }
else if(sColor[key].type == "boolean") else if (sColor[key].type == "boolean") {
{ property = '<div class="checkbox"><input id="cr_' + sColor[key].key + '" type="checkbox" value="' + value + '"/><label></label></div>';
property = '<div class="checkbox"><input id="cr_'+sColor[key].key+'" type="checkbox" value="'+value+'"/><label></label></div>';
$('.crtbody').append(createTableRow([title, property], false, true)); $('.crtbody').append(createTableRow([title, property], false, true));
$('#cr_'+sColor[key].key).off().on('change', function(e){ $('#cr_' + sColor[key].key).off().on('change', function (e) {
requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.checked); requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.checked);
}); });
} }
else else {
{ if (sColor[key].key == "brightness" || sColor[key].key == "brightnessCompensation" || sColor[key].key == "backlightThreshold")
if(sColor[key].key == "brightness" || sColor[key].key == "brightnessCompensation" || sColor[key].key == "backlightThreshold") property = '<div class="input-group"><input id="cr_' + sColor[key].key + '" type="number" class="form-control" min="0" max="100" step="10" value="' + value + '"/><span class="input-group-addon">' + $.i18n("edt_append_percent") + '</span></div>';
property = '<div class="input-group"><input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0" max="100" step="10" value="'+value+'"/><span class="input-group-addon">'+$.i18n("edt_append_percent")+'</span></div>';
else else
property = '<input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0.1" max="4.0" step="0.1" value="'+value+'"/>'; property = '<input id="cr_' + sColor[key].key + '" type="number" class="form-control" min="0.1" max="4.0" step="0.1" value="' + value + '"/>';
$('.crtbody').append(createTableRow([title, property], false, true)); $('.crtbody').append(createTableRow([title, property], false, true));
$('#cr_'+sColor[key].key).off().on('change', function(e){ $('#cr_' + sColor[key].key).off().on('change', function (e) {
valValue(this.id,this.value,this.min,this.max); valValue(this.id, this.value, this.min, this.max);
requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.value); requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.value);
}); });
} }
} }
} }
function sendEffect() function sendEffect() {
{
var efx = $("#effect_select").val(); var efx = $("#effect_select").val();
if(efx != "__none__") if (efx != "__none__") {
{
requestPriorityClear(); requestPriorityClear();
$(window.hyperion).one("cmd-clear", function(event) { $(window.hyperion).one("cmd-clear", function (event) {
setTimeout(function() {requestPlayEffect(efx,duration)}, 100); setTimeout(function () { requestPlayEffect(efx, duration) }, 100);
}); });
} }
} }
function sendColor() function sendColor() {
{ requestSetColor(rgb.r, rgb.g, rgb.b, duration);
requestSetColor(rgb.r, rgb.g, rgb.b,duration);
} }
function updateInputSelect() function updateInputSelect() {
{
$('.sstbody').html(""); $('.sstbody').html("");
var prios = window.serverInfo.priorities; var prios = window.serverInfo.priorities;
var clearAll = false; var clearAll = false;
for(var i = 0; i < prios.length; i++) for (var i = 0; i < prios.length; i++) {
{ var origin = prios[i].origin ? prios[i].origin : "System";
var origin = prios[i].origin ? prios[i].origin : "System";
origin = origin.split("@"); origin = origin.split("@");
var ip = origin[1]; var ip = origin[1];
origin = origin[0]; origin = origin[0];
var owner = prios[i].owner; var owner = prios[i].owner;
var active = prios[i].active; var active = prios[i].active;
var visible = prios[i].visible; var visible = prios[i].visible;
var priority = prios[i].priority; var priority = prios[i].priority;
var compId = prios[i].componentId; var compId = prios[i].componentId;
var duration = prios[i].duration_ms/1000; var duration = prios[i].duration_ms / 1000;
var value = "0,0,0"; var value = "0,0,0";
var btn_type = "default"; var btn_type = "default";
var btn_text = $.i18n('remote_input_setsource_btn'); var btn_text = $.i18n('remote_input_setsource_btn');
@ -115,40 +104,38 @@ $(document).ready(function() {
if (active) if (active)
btn_type = "primary"; btn_type = "primary";
if(priority > 254) if (priority > 254)
continue; continue;
if(priority < 254 && (compId == "EFFECT" || compId == "COLOR" || compId == "IMAGE") ) if (priority < 254 && (compId == "EFFECT" || compId == "COLOR" || compId == "IMAGE"))
clearAll = true; clearAll = true;
if (visible) if (visible) {
{
btn_state = "disabled"; btn_state = "disabled";
btn_type = "success"; btn_type = "success";
btn_text = $.i18n('remote_input_sourceactiv_btn'); btn_text = $.i18n('remote_input_sourceactiv_btn');
} }
if(ip) if (ip)
origin += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_ip')+' '+ip+'</span>'; origin += '<br/><span style="font-size:80%; color:grey;">' + $.i18n('remote_input_ip') + ' ' + ip + '</span>';
if("value" in prios[i]) if ("value" in prios[i])
value = prios[i].value.RGB; value = prios[i].value.RGB;
switch (compId) switch (compId) {
{
case "EFFECT": case "EFFECT":
owner = $.i18n('remote_effects_label_effects')+' '+owner; owner = $.i18n('remote_effects_label_effects') + ' ' + owner;
break; break;
case "COLOR": 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('+value+'); display:inline-block" title="RGB: ('+value+')"></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; break;
case "IMAGE": case "IMAGE":
owner = $.i18n('remote_effects_label_picture')+' '+owner; owner = $.i18n('remote_effects_label_picture') + ' ' + owner;
break; break;
case "GRABBER": case "GRABBER":
owner = $.i18n('general_comp_GRABBER')+': ('+owner+')'; owner = $.i18n('general_comp_GRABBER') + ': (' + owner + ')';
break; break;
case "V4L": case "V4L":
owner = $.i18n('general_comp_V4L')+': ('+owner+')'; owner = $.i18n('general_comp_V4L') + ': (' + owner + ')';
break; break;
case "BOBLIGHTSERVER": case "BOBLIGHTSERVER":
owner = $.i18n('general_comp_BOBLIGHTSERVER'); owner = $.i18n('general_comp_BOBLIGHTSERVER');
@ -161,126 +148,112 @@ $(document).ready(function() {
break; break;
} }
if(duration && compId != "GRABBER" && compId != "FLATBUFSERVER" && compId != "PROTOSERVER") if (duration && compId != "GRABBER" && compId != "FLATBUFSERVER" && compId != "PROTOSERVER")
owner += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_duration')+' '+duration.toFixed(0)+$.i18n('edt_append_s')+'</span>'; owner += '<br/><span style="font-size:80%; color:grey;">' + $.i18n('remote_input_duration') + ' ' + duration.toFixed(0) + $.i18n('edt_append_s') + '</span>';
var btn = '<button id="srcBtn'+i+'" type="button" '+btn_state+' class="btn btn-'+btn_type+' btn_input_selection" onclick="requestSetSource('+priority+');">'+btn_text+'</button>'; var btn = '<button id="srcBtn' + i + '" type="button" ' + btn_state + ' class="btn btn-' + btn_type + ' btn_input_selection" onclick="requestSetSource(' + priority + ');">' + btn_text + '</button>';
if((compId == "EFFECT" || compId == "COLOR" || compId == "IMAGE") && priority < 254) if ((compId == "EFFECT" || compId == "COLOR" || compId == "IMAGE") && priority < 254)
btn += '<button type="button" class="btn btn-sm btn-danger" style="margin-left:10px;" onclick="requestPriorityClear('+priority+');"><i class="fa fa-close"></button>'; btn += '<button type="button" class="btn btn-sm btn-danger" style="margin-left:10px;" onclick="requestPriorityClear(' + priority + ');"><i class="fa fa-close"></button>';
if(btn_type != 'default') if (btn_type != 'default')
$('.sstbody').append(createTableRow([origin, owner, priority, btn], false, true)); $('.sstbody').append(createTableRow([origin, owner, priority, btn], false, true));
} }
var btn_auto_color = (window.serverInfo.priorities_autoselect? "btn-success" : "btn-danger"); var btn_auto_color = (window.serverInfo.priorities_autoselect ? "btn-success" : "btn-danger");
var btn_auto_state = (window.serverInfo.priorities_autoselect? "disabled" : "enabled"); var btn_auto_state = (window.serverInfo.priorities_autoselect ? "disabled" : "enabled");
var btn_auto_text = (window.serverInfo.priorities_autoselect? $.i18n('general_btn_on') : $.i18n('general_btn_off')); var btn_auto_text = (window.serverInfo.priorities_autoselect ? $.i18n('general_btn_on') : $.i18n('general_btn_off'));
var btn_call_state = (clearAll? "enabled" : "disabled"); var btn_call_state = (clearAll ? "enabled" : "disabled");
$('#auto_btn').html('<button id="srcBtn'+i+'" type="button" '+btn_auto_state+' class="btn '+btn_auto_color+'" style="margin-right:5px;display:inline-block;" onclick="requestSetSource(\'auto\');">'+$.i18n('remote_input_label_autoselect')+' ('+btn_auto_text+')</button>'); $('#auto_btn').html('<button id="srcBtn' + i + '" type="button" ' + btn_auto_state + ' class="btn ' + btn_auto_color + '" style="margin-right:5px;display:inline-block;" onclick="requestSetSource(\'auto\');">' + $.i18n('remote_input_label_autoselect') + ' (' + btn_auto_text + ')</button>');
$('#auto_btn').append('<button type="button" '+btn_call_state+' class="btn btn-danger" style="display:inline-block;" onclick="requestClearAll();">'+$.i18n('remote_input_clearall')+'</button>'); $('#auto_btn').append('<button type="button" ' + btn_call_state + ' class="btn btn-danger" style="display:inline-block;" onclick="requestClearAll();">' + $.i18n('remote_input_clearall') + '</button>');
var max_width=100; var max_width = 100;
$('.btn_input_selection').each(function() { $('.btn_input_selection').each(function () {
if ($(this).innerWidth() > max_width) if ($(this).innerWidth() > max_width)
max_width = $(this).innerWidth(); max_width = $(this).innerWidth();
}); });
$('.btn_input_selection').css("min-width",max_width+"px"); $('.btn_input_selection').css("min-width", max_width + "px");
} }
function updateLedMapping() function updateLedMapping() {
{
var mapping = window.serverInfo.imageToLedMappingType; var mapping = window.serverInfo.imageToLedMappingType;
$('#mappingsbutton').html(""); $('#mappingsbutton').html("");
for(var ix = 0; ix < mappingList.length; ix++) for (var ix = 0; ix < mappingList.length; ix++) {
{ if (mapping == mappingList[ix])
if(mapping == mappingList[ix])
var btn_style = 'btn-success'; var btn_style = 'btn-success';
else else
var btn_style = 'btn-primary'; var btn_style = 'btn-primary';
$('#mappingsbutton').append('<button type="button" id="lmBtn_'+mappingList[ix]+'" class="btn '+btn_style+'" style="margin:3px;min-width:200px" onclick="requestMappingType(\''+mappingList[ix]+'\');">'+$.i18n('remote_maptype_label_'+mappingList[ix])+'</button><br/>'); $('#mappingsbutton').append('<button type="button" id="lmBtn_' + mappingList[ix] + '" class="btn ' + btn_style + '" style="margin:3px;min-width:200px" onclick="requestMappingType(\'' + mappingList[ix] + '\');">' + $.i18n('remote_maptype_label_' + mappingList[ix]) + '</button><br/>');
} }
} }
function initComponents() function initComponents() {
{
var components = window.comps; var components = window.comps;
var hyperionEnabled = true; var hyperionEnabled = true;
components.forEach( function(obj) { components.forEach(function (obj) {
if (obj.name == "ALL") if (obj.name == "ALL") {
{
hyperionEnabled = obj.enabled; hyperionEnabled = obj.enabled;
} }
}); });
for (const comp of components) for (const comp of components) {
{ if (comp.name === "ALL")
if(comp.name === "ALL")
continue; continue;
const enable_style = (comp.enabled? "checked" : ""); const enable_style = (comp.enabled ? "checked" : "");
const comp_btn_id = "comp_btn_"+comp.name; const comp_btn_id = "comp_btn_" + comp.name;
if ($("#"+comp_btn_id).length === 0) if ($("#" + comp_btn_id).length === 0) {
{ var d = '<span style="display:block;margin:3px">'
var d='<span style="display:block;margin:3px">' + '<label class="checkbox-inline">'
+'<input id="'+comp_btn_id+'"'+enable_style+' type="checkbox"' + '<input id = "' + comp_btn_id + '"' + enable_style + ' type = "checkbox"'
+'data-toggle="toggle" data-onstyle="success" data-on="'+$.i18n('general_btn_on')+'" data-off="'+$.i18n('general_btn_off')+'">' + 'data-toggle="toggle" data-onstyle="success" data-on="' + $.i18n('general_btn_on') + '" data-off="' + $.i18n('general_btn_off') + '">'
+'&nbsp;&nbsp;&nbsp;<label>'+$.i18n('general_comp_'+comp.name)+'</label>' + $.i18n('general_comp_' + comp.name) + '</label > '
+'</span>'; + '</span>';
$('#componentsbutton').append(d); $('#componentsbutton').append(d);
$(`#${comp_btn_id}`).bootstrapToggle(); $(`#${comp_btn_id}`).bootstrapToggle();
$(`#${comp_btn_id}`).bootstrapToggle((hyperionEnabled ? "enable" : "disable")); $(`#${comp_btn_id}`).bootstrapToggle((hyperionEnabled ? "enable" : "disable"));
$(`#${comp_btn_id}`).change(e => { $(`#${comp_btn_id}`).change(e => {
requestSetComponentState(e.currentTarget.id.split('_').pop(), e.currentTarget.checked); requestSetComponentState(e.currentTarget.id.split('_').pop(), e.currentTarget.checked);
//console.log(e.currentTarget.checked)
}); });
} }
} }
} }
function updateComponent( component ) function updateComponent(component) {
{ if (component.name == "ALL") {
if (component.name == "ALL")
{
var components = window.comps; var components = window.comps;
var hyperionEnabled = component.enabled; var hyperionEnabled = component.enabled;
for (const comp of components) for (const comp of components) {
{
if(comp.name === "ALL") if (comp.name === "ALL")
continue; continue;
const comp_btn_id = "comp_btn_"+comp.name; const comp_btn_id = "comp_btn_" + comp.name;
if ( !hyperionEnabled ) if (!hyperionEnabled) {
{
$(`#${comp_btn_id}`).bootstrapToggle('off'); $(`#${comp_btn_id}`).bootstrapToggle('off');
$(`#${comp_btn_id}`).bootstrapToggle("disable"); $(`#${comp_btn_id}`).bootstrapToggle("disable");
} }
else else {
{
$(`#${comp_btn_id}`).bootstrapToggle("enable"); $(`#${comp_btn_id}`).bootstrapToggle("enable");
if ( comp.enabled !== $(`#${comp_btn_id}`).prop("checked") ) if (comp.enabled !== $(`#${comp_btn_id}`).prop("checked")) {
{
$(`#${comp_btn_id}`).bootstrapToggle().prop('checked', comp.enabled).change(); $(`#${comp_btn_id}`).bootstrapToggle().prop('checked', comp.enabled).change();
} }
} }
} }
} }
else else {
{ const comp_btn_id = "comp_btn_" + component.name;
const comp_btn_id = "comp_btn_"+component.name;
//console.log ("updateComponent: ", component.name, "Current Checked: ", $(`#${comp_btn_id}`).prop("checked"), "New Checked: ", component.enabled, ); //console.log ("updateComponent: ", component.name, "Current Checked: ", $(`#${comp_btn_id}`).prop("checked"), "New Checked: ", component.enabled, );
// In case Buttons were disabled before, status may be different to component status // In case Buttons were disabled before, status may be different to component status
if ( component.enabled != $(`#${comp_btn_id}`).prop("checked") ) if (component.enabled != $(`#${comp_btn_id}`).prop("checked")) {
{
// console.log ("Update status to Checked = ", component.enabled); // console.log ("Update status to Checked = ", component.enabled);
if ( component.enabled ) if (component.enabled)
$(`#${comp_btn_id}`).bootstrapToggle("on"); $(`#${comp_btn_id}`).bootstrapToggle("on");
else else
$(`#${comp_btn_id}`).bootstrapToggle("off"); $(`#${comp_btn_id}`).bootstrapToggle("off");
@ -288,21 +261,19 @@ $(document).ready(function() {
} }
} }
function updateEffectlist() function updateEffectlist() {
{
var newEffects = window.serverInfo.effects; var newEffects = window.serverInfo.effects;
if (newEffects.length != oldEffects.length) if (newEffects.length != oldEffects.length) {
{
$('#effect_select').html('<option value="__none__"></option>'); $('#effect_select').html('<option value="__none__"></option>');
var usrEffArr = []; var usrEffArr = [];
var sysEffArr = []; var sysEffArr = [];
for(var i = 0; i < newEffects.length; i++) { for (var i = 0; i < newEffects.length; i++) {
var effectName = newEffects[i].name; var effectName = newEffects[i].name;
if(!/^\:/.test(newEffects[i].file)){ if (!/^\:/.test(newEffects[i].file)) {
usrEffArr.push(effectName); usrEffArr.push(effectName);
} }
else{ else {
sysEffArr.push(effectName); sysEffArr.push(effectName);
} }
} }
@ -312,74 +283,70 @@ $(document).ready(function() {
} }
} }
function updateVideoMode() function updateVideoMode() {
{ var videoModes = ["2D", "3DSBS", "3DTAB"];
var videoModes = ["2D","3DSBS","3DTAB"];
var currVideoMode = window.serverInfo.videomode; var currVideoMode = window.serverInfo.videomode;
$('#videomodebtns').html(""); $('#videomodebtns').html("");
for(var ix = 0; ix < videoModes.length; ix++) for (var ix = 0; ix < videoModes.length; ix++) {
{ if (currVideoMode == videoModes[ix])
if(currVideoMode == videoModes[ix])
var btn_style = 'btn-success'; var btn_style = 'btn-success';
else else
var btn_style = 'btn-primary'; var btn_style = 'btn-primary';
$('#videomodebtns').append('<button type="button" id="vModeBtn_'+videoModes[ix]+'" class="btn '+btn_style+'" style="margin:3px;min-width:200px" onclick="requestVideoMode(\''+videoModes[ix]+'\');">'+$.i18n('remote_videoMode_'+videoModes[ix])+'</button><br/>'); $('#videomodebtns').append('<button type="button" id="vModeBtn_' + videoModes[ix] + '" class="btn ' + btn_style + '" style="margin:3px;min-width:200px" onclick="requestVideoMode(\'' + videoModes[ix] + '\');">' + $.i18n('remote_videoMode_' + videoModes[ix]) + '</button><br/>');
} }
} }
// colorpicker and effect // colorpicker and effect
if (getStorage('rmcpcolor') != null) if (getStorage('rmcpcolor') != null) {
{
cpcolor = getStorage('rmcpcolor'); cpcolor = getStorage('rmcpcolor');
rgb = hexToRgb(cpcolor); rgb = hexToRgb(cpcolor);
} }
if (getStorage('rmduration') != null) if (getStorage('rmduration') != null) {
{
$("#remote_duration").val(getStorage('rmduration')); $("#remote_duration").val(getStorage('rmduration'));
duration = getStorage('rmduration'); duration = getStorage('rmduration');
} }
createCP('cp2', cpcolor, function(rgbT,hex){ createCP('cp2', cpcolor, function (rgbT, hex) {
rgb = rgbT; rgb = rgbT;
sendColor(); sendColor();
setStorage('rmcpcolor', hex); setStorage('rmcpcolor', hex);
updateInputSelect(); updateInputSelect();
}); });
$("#reset_color").off().on("click", function(){ $("#reset_color").off().on("click", function () {
requestPriorityClear(); requestPriorityClear();
lastImgData = ""; lastImgData = "";
$("#effect_select").val("__none__"); $("#effect_select").val("__none__");
$("#remote_input_img").val(""); $("#remote_input_img").val("");
}); });
$("#remote_duration").off().on("change", function(){ $("#remote_duration").off().on("change", function () {
duration = valValue(this.id,this.value,this.min,this.max); duration = valValue(this.id, this.value, this.min, this.max);
setStorage('rmduration', duration); setStorage('rmduration', duration);
}); });
$("#effect_select").off().on("change", function(event) { $("#effect_select").off().on("change", function (event) {
sendEffect(); sendEffect();
}); });
$("#remote_input_reseff, #remote_input_rescol").off().on("click", function(){ $("#remote_input_reseff, #remote_input_rescol").off().on("click", function () {
if(this.id == "remote_input_rescol") if (this.id == "remote_input_rescol")
sendColor(); sendColor();
else else
sendEffect(); sendEffect();
}); });
$("#remote_input_repimg").off().on("click", function(){ $("#remote_input_repimg").off().on("click", function () {
if(lastImgData != "") if (lastImgData != "")
requestSetImage(lastImgData, duration, lastFileName); requestSetImage(lastImgData, duration, lastFileName);
}); });
$("#remote_input_img").change(function(){ $("#remote_input_img").change(function () {
readImg(this, function(src,fileName){ readImg(this, function (src, fileName) {
lastFileName = fileName; lastFileName = fileName;
if(src.includes(",")) if (src.includes(","))
lastImgData = src.split(",")[1]; lastImgData = src.split(",")[1];
else else
lastImgData = src; lastImgData = src;
@ -397,27 +364,27 @@ $(document).ready(function() {
// interval updates // interval updates
$(window.hyperion).on('components-updated', function(e, comp){ $(window.hyperion).on('components-updated', function (e, comp) {
//console.log ("components-updated", e, comp); //console.log ("components-updated", e, comp);
updateComponent (comp); updateComponent(comp);
}); });
$(window.hyperion).on("cmd-priorities-update", function(event){ $(window.hyperion).on("cmd-priorities-update", function (event) {
window.serverInfo.priorities = event.response.data.priorities; window.serverInfo.priorities = event.response.data.priorities;
window.serverInfo.priorities_autoselect = event.response.data.priorities_autoselect; window.serverInfo.priorities_autoselect = event.response.data.priorities_autoselect;
updateInputSelect(); updateInputSelect();
}); });
$(window.hyperion).on("cmd-imageToLedMapping-update", function(event){ $(window.hyperion).on("cmd-imageToLedMapping-update", function (event) {
window.serverInfo.imageToLedMappingType = event.response.data.imageToLedMappingType; window.serverInfo.imageToLedMappingType = event.response.data.imageToLedMappingType;
updateLedMapping(); updateLedMapping();
}); });
$(window.hyperion).on("cmd-videomode-update", function(event){ $(window.hyperion).on("cmd-videomode-update", function (event) {
window.serverInfo.videomode = event.response.data.videomode; window.serverInfo.videomode = event.response.data.videomode;
updateVideoMode(); updateVideoMode();
}); });
$(window.hyperion).on("cmd-effects-update", function(event){ $(window.hyperion).on("cmd-effects-update", function (event) {
window.serverInfo.effects = event.response.data.effects; window.serverInfo.effects = event.response.data.effects;
updateEffectlist(); updateEffectlist();
}); });

View File

@ -249,12 +249,16 @@ $(document).ready(function() {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
$(window.hyperion).on("cmd-settings-update",function(event){ $(window.hyperion).on("cmd-settings-update",function(event){
var obj = event.response.data var obj = event.response.data
Object.getOwnPropertyNames(obj).forEach(function(val, idx, array) { if ( obj.leds) {
window.serverInfo[val] = obj[val]; console.log("ledsim: cmd-settings-update", event.response.data);
}); Object.getOwnPropertyNames(obj).forEach(function(val, idx, array) {
leds = window.serverConfig.leds window.serverInfo[val] = obj[val];
updateLedLayout(); });
leds = window.serverConfig.leds
updateLedLayout();
}
}); });
function resetImage(){ function resetImage(){

View File

@ -330,7 +330,7 @@ function showInfoDialog(type, header, message) {
$(document).on('click', '[data-dismiss-modal]', function () { $(document).on('click', '[data-dismiss-modal]', function () {
var target = $(this).attr('data-dismiss-modal'); var target = $(this).attr('data-dismiss-modal');
$.find(target).modal.hide(); $(target).modal('hide');
}); });
} }
@ -1070,6 +1070,43 @@ function getReleases(callback) {
}); });
} }
function getSystemInfo() {
var sys = window.sysInfo.system;
var shy = window.sysInfo.hyperion;
var info = "Hyperion Server: \n";
info += '- Build: ' + shy.build + '\n';
info += '- Build time: ' + shy.time + '\n';
info += '- Git Remote: ' + shy.gitremote + '\n';
info += '- Version: ' + shy.version + '\n';
info += '- UI Lang: ' + storedLang + ' (BrowserLang: ' + navigator.language + ')\n';
info += '- UI Access: ' + storedAccess + '\n';
//info += '- Log lvl: ' + window.serverConfig.logger.level + '\n';
info += '- Avail Capt: ' + window.serverInfo.grabbers.available + '\n';
info += '- Database: ' + (shy.readOnlyMode ? "ready-only" : "read/write") + '\n';
info += '\n';
info += 'Hyperion Server OS: \n';
info += '- Distribution: ' + sys.prettyName + '\n';
info += '- Architecture: ' + sys.architecture + '\n';
if (sys.cpuModelName)
info += '- CPU Model: ' + sys.cpuModelName + '\n';
if (sys.cpuModelType)
info += '- CPU Type: ' + sys.cpuModelType + '\n';
if (sys.cpuRevision)
info += '- CPU Revision: ' + sys.cpuRevision + '\n';
if (sys.cpuHardware)
info += '- CPU Hardware: ' + sys.cpuHardware + '\n';
info += '- Kernel: ' + sys.kernelType + ' (' + sys.kernelVersion + ' (WS: ' + sys.wordSize + '))\n';
info += '- Qt Version: ' + sys.qtVersion + '\n';
info += '- Python Version: ' + sys.pyVersion + '\n';
info += '- Browser: ' + navigator.userAgent;
return info;
}
function handleDarkMode() { function handleDarkMode() {
$("<link/>", { $("<link/>", {
rel: "stylesheet", rel: "stylesheet",