$(document).ready(function () {
performTranslation();
function updateComponents() {
$("div[class*='currentInstance']").remove();
var instances_html = '
';
instances_html += '
';
instances_html += '
';
instances_html += '
';
instances_html += '
';
instances_html += '';
instances_html += '';
instances_html += '' + $.i18n('dashboard_infobox_label_title') + '';
instances_html += ' |
';
instances_html += ' | ';
instances_html += '' + $.i18n('conf_leds_contr_label_contrtype') + ' | ';
instances_html += '' + window.serverConfig.device.type + ' | ';
instances_html += '
|
';
instances_html += '
';
instances_html += '
';
$('.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('');
else
$('#versioninforesult').html('' + $.i18n('dashboard_infobox_message_updatesuccess') + '
');
}
});
//interval update
updateComponents();
$(window.hyperion).on("components-updated", updateComponents);
if (window.showOptHelp)
createHintH("intro", $.i18n('dashboard_label_intro'), "dash_intro");
removeOverlay();
});