mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
@@ -40,7 +40,8 @@ $(document).ready( function() {
|
||||
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>';
|
||||
console.log()
|
||||
components_html += '<tr><td lang="en" data-lang-token="general_comp_'+components[idx].name+'">'+(components[idx].title)+'</td><td><i class="fa fa-circle component-'+(components[idx].enabled?"on":"off")+'"></i></td></tr>';
|
||||
}
|
||||
$("#tab_components").html(components_html);
|
||||
|
||||
@@ -54,11 +55,11 @@ $(document).ready( function() {
|
||||
|
||||
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>');
|
||||
$('#versioninforesult').html('<div lang="en" data-lang-token="dashboard_infobox_message_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>');
|
||||
$('#versioninforesult').html('<div lang="en" data-lang-token="dashboard_infobox_message_updatesuccess" style="margin:0px;" class="alert alert-success">You run the latest version of Hyperion.</div>');
|
||||
}
|
||||
});
|
||||
$("#loading_overlay").removeClass("overlay");
|
||||
@@ -77,7 +78,7 @@ $(document).ready( function() {
|
||||
});
|
||||
|
||||
$(hyperion).on("error",function(event){
|
||||
showErrorDialog("error", event.reason);
|
||||
showInfoDialog("error","Error", event.reason);
|
||||
});
|
||||
|
||||
$(hyperion).on("open",function(event){
|
||||
|
@@ -113,9 +113,9 @@ $(document).ready(function() {
|
||||
e = isJsonString($("#ledconfig").val());
|
||||
|
||||
if (e.length == 0)
|
||||
showErrorDialog("Validation success", "Your config is valid!");
|
||||
showInfoDialog("success", "Validation success", "Your config is valid!");
|
||||
else
|
||||
showErrorDialog("Validation failed!", e);
|
||||
showInfoDialog("error", "Validation failed!", e);
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
@@ -12,9 +12,9 @@
|
||||
if (active) btn_type = "warning";
|
||||
if (visible) btn_type = "success";
|
||||
|
||||
data += '<button id="srcBtn'+i+'" type="button" class="btn btn-lg btn-'+btn_type+' btn_input_selection" style="margin:10px;min-width:200px" title="prio '+priority+'" onclick="requestSetSource('+priority+');">'+owner+'</button><br/>';
|
||||
data += '<button id="srcBtn'+i+'" type="button" class="btn btn-lg btn-'+btn_type+' btn_input_selection" style="margin:10px;min-width:200px" onclick="requestSetSource('+priority+');">'+owner+'<span style="font-size:70% !important;"> ('+priority+')</span></button><br/>';
|
||||
}
|
||||
data += '<button id="srcBtn'+i+'" type="button" class="btn btn-lg btn-info btn_input_selection" style="margin:10px;min-width:200px" onclick="requestSetSource(\'auto\');">auto select</button><br/>';
|
||||
data += '<button id="srcBtn'+i+'" type="button" class="btn btn-lg btn-info btn_input_selection" style="margin:10px;min-width:200px" onclick="requestSetSource(\'auto\');" lang="en" data-lang-token="remote_input_label_autoselect">auto selection</button><br/>';
|
||||
$('#hyperion_inputs').html(data);
|
||||
|
||||
var max_width=200;
|
||||
@@ -49,7 +49,7 @@
|
||||
{
|
||||
d='<p><button type="button" id="'+comp_btn_id+'" class="btn '+enable_style
|
||||
+'" onclick="requestSetComponentState(\''+comp_name+'\','+(!components[idx].enabled)
|
||||
+')"><i id="'+comp_btn_id+'_icon" class="fa '+enable_icon+'"></i></button> '+components[idx].title+'</p>';
|
||||
+')"><i id="'+comp_btn_id+'_icon" class="fa '+enable_icon+'"></i></button> <span lang="en" data-lang-token="general_comp_'+components[idx].name+'"> '+components[idx].title+'</span></p>';
|
||||
$('#componentsbutton').append(d);
|
||||
}
|
||||
else // already create, update state
|
||||
|
@@ -47,11 +47,25 @@ function setClassByBool(obj,enable,class1,class2)
|
||||
}
|
||||
}
|
||||
|
||||
function showErrorDialog(header,message)
|
||||
function showInfoDialog(type,header,message)
|
||||
{
|
||||
$('#error_dialog .modal-title').html(header);
|
||||
$('#error_dialog .modal-body').html(message);
|
||||
$('#error_dialog').modal('show');
|
||||
$('#modal_dialog .modal-bodytitle').html(header);
|
||||
$('#modal_dialog .modal-bodycontent').html(message);
|
||||
|
||||
if (type=="success"){
|
||||
$('#modal_dialog .modal-bodyicon').html('<i class="fa fa-check modal-icon-check">');
|
||||
$('#modal_dialog .modal-footer-button').html('<button type="button" class="btn btn-success" data-dismiss="modal">OK</button>');
|
||||
}
|
||||
else if (type=="warning"){
|
||||
$('#modal_dialog .modal-bodyicon').html('<i class="fa fa-warning modal-icon-warning">');
|
||||
$('#modal_dialog .modal-footer-button').html('<button type="button" class="btn btn-warning" data-dismiss="modal">OK</button>');
|
||||
}
|
||||
else if (type=="error"){
|
||||
$('#modal_dialog .modal-bodyicon').html('<i class="fa fa-warning modal-icon-error">');
|
||||
$('#modal_dialog .modal-footer-button').html('<button type="button" class="btn btn-danger" data-dismiss="modal">OK</button>');
|
||||
}
|
||||
$('#modal_dialog').modal('show');
|
||||
|
||||
}
|
||||
|
||||
function isJsonString(str)
|
||||
|
Reference in New Issue
Block a user