mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
adfe2a4b23
* implement effects included in hyperiond binary * cleanup * remove install of effects dir. People who wants to develop effects has to copy them from github effect params for initial effects can be changed in config permanently and other effect params can be changed via json (currently only temporarily) * fix schema of fadecandy webui fix display of specific led options * add leddevice write support * cleanup * webui: tune hue code * when use json effect definition from putsiede hyperiond but want to use py script from inside hyperiond use ad a : e.g. fade.py needs a fade.py near the json file, but :fade.py is taken from resource inside hyperiond * add ability to di * add abiloty to diable effcts via hyperion config * use effect name instead of script in active effects and prio register * finally solve open file handle during effect is playing. Now script is read before, then file closed and then t is run by python * fix some webui things - led config tabs - inital loading screen optimize qrc file generation fix compile warning in hyperion.cpp * cleanup * more cleanup
82 lines
3.0 KiB
JavaScript
82 lines
3.0 KiB
JavaScript
$(document).ready( function() {
|
|
$("#loading_overlay").addClass("overlay");
|
|
loadContentTo("#container_connection_lost","connection_lost");
|
|
initWebSocket();
|
|
bindNavToContent("#load_dashboard","dashboard",true);
|
|
bindNavToContent("#load_remote","remote",false);
|
|
bindNavToContent("#load_huebridge","huebridge",false);
|
|
bindNavToContent("#load_support","support",false);
|
|
bindNavToContent("#load_confKodi","kodiconf",false);
|
|
bindNavToContent("#load_update","update",false);
|
|
bindNavToContent("#load_confGeneral","generalconf",false);
|
|
bindNavToContent("#load_confLeds","leds",false);
|
|
bindNavToContent("#load_confGrabber","grabber",false);
|
|
|
|
|
|
//Change all Checkboxes to Switches
|
|
$("[type='checkbox']").bootstrapSwitch();
|
|
|
|
$(hyperion).on("cmd-serverinfo",function(event){
|
|
parsedServerInfoJSON = event.response;
|
|
currentVersion = parsedServerInfoJSON.info.hyperion[0].version;
|
|
cleanCurrentVersion = currentVersion.replace(/\./g, '');
|
|
// get active led device
|
|
var leddevice = parsedServerInfoJSON.info.ledDevices.active;
|
|
$('#dash_leddevice').html(leddevice);
|
|
// get host
|
|
var hostname = parsedServerInfoJSON.info.hostname;
|
|
$('#dash_systeminfo').html(hostname+':'+hyperionport);
|
|
|
|
var components = parsedServerInfoJSON.info.components;
|
|
components_html = "";
|
|
for ( idx=0; idx<components.length;idx++)
|
|
{
|
|
components_html += '<tr><td>'+(components[idx].title)+'</td><td><i class="fa fa-circle component-'+(components[idx].enabled?"on":"off")+'"></i></td></tr>';
|
|
}
|
|
$("#tab_components").html(components_html);
|
|
|
|
$.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/version.json", function( data ) {
|
|
parsedUpdateJSON = JSON.parse(data);
|
|
latestVersion = parsedUpdateJSON[0].versionnr;
|
|
cleanLatestVersion = latestVersion.replace(/\./g, '');
|
|
|
|
$('#currentversion').html(' V'+currentVersion);
|
|
$('#latestversion').html(' V'+latestVersion);
|
|
|
|
if ( cleanCurrentVersion < cleanLatestVersion )
|
|
{
|
|
$('#versioninforesult').html('<div lang="en" data-lang-token="dashboard_message_infobox_updatewarning" style="margin:0px;" class="alert alert-warning">A newer version of Hyperion is available!</div>');
|
|
}
|
|
else
|
|
{
|
|
$('#versioninforesult').html('<div lang="en" data-lang-token="dashboard_message_infobox_updatesuccess" style="margin:0px;" class="alert alert-success">You run the latest version of Hyperion.</div>');
|
|
}
|
|
});
|
|
$("#loading_overlay").removeClass("overlay");
|
|
}); // end cmd-serverinfo
|
|
|
|
$(hyperion).one("cmd-config-getschema", function(event) {
|
|
parsedConfSchemaJSON = event.response.result;
|
|
});
|
|
|
|
|
|
$(hyperion).on("error",function(event){
|
|
showErrorDialog("error", event.reason);
|
|
});
|
|
|
|
$(hyperion).on("open",function(event){
|
|
requestServerConfigSchema();
|
|
requestServerInfo();
|
|
});
|
|
|
|
});
|
|
|
|
$(function(){
|
|
var sidebar = $('#side-menu'); // cache sidebar to a variable for performance
|
|
sidebar.delegate('a.inactive','click',function(){
|
|
sidebar.find('.active').toggleClass('active inactive');
|
|
$(this).toggleClass('active inactive');
|
|
});
|
|
});
|
|
|