embedded webui + config modification detection (#240)

* implement embedded webui

* add detection for changed config, later on used for restart hyperion
This commit is contained in:
redPanther
2016-09-14 13:51:28 +02:00
committed by GitHub
parent ccc50899fb
commit 1cc2f72fa2
16 changed files with 103 additions and 30 deletions

View File

@@ -14,7 +14,7 @@ table.borderless td,table.borderless th{border: none !important;}
/*Header*/
.navbar-brand{padding: 5px;padding-left:20px;height:60px;}
.sidebar{margin-top:91px;}
.sidebar{margin-top:61px;padding-top:20px;}
.dropdown{font-size:18px;}
@media (max-width: 767px) {.sidebar{margin-top:0px;}}

View File

@@ -80,7 +80,6 @@
<body>
<div id="loading_overlay"></div>
<div id="wrapper">
<!-- Navigation -->
@@ -225,7 +224,16 @@
</nav>
<!-- Page Content -->
<div id="page-wrapper" />
<div id="page-wrapper" style="padding-top:10px">
<div id="hyperion_restart_notify" class="alert alert-warning" style="display:none;padding:10px;margin:0">
<div class="panel-danger" style="text-align:right">
<div style="float:left">Hyperion Configuration is modified. To make it active, restart Hyperion.</div>
<button id="btn_hyperion_restart" class="btn btn-danger">Restart Hyperion</button>
</div>
</div>
<div id="page-content" />
</div>
</div>
<!-- /#wrapper -->

View File

@@ -20,6 +20,12 @@ $(document).ready( function() {
parsedServerInfoJSON = event.response;
currentVersion = parsedServerInfoJSON.info.hyperion[0].version;
cleanCurrentVersion = currentVersion.replace(/\./g, '');
if (parsedServerInfoJSON.info.hyperion[0].config_modified)
$("#hyperion_restart_notify").fadeIn("fast");
else
$("#hyperion_restart_notify").fadeOut("fast");
// get active led device
var leddevice = parsedServerInfoJSON.info.ledDevices.active;
$('#dash_leddevice').html(leddevice);

View File

@@ -149,7 +149,7 @@ $(document).ready(function() {
isCurrentDevice = (server.info.ledDevices.active == $(this).val());
for(var key in parsedConfJSON.device){
if (key in generalOptions.properties)
if (key != "type" && key in generalOptions.properties)
values_general[key] = parsedConfJSON.device[key];
};
grabber_conf_editor.getEditor("root.generalOptions").setValue( values_general );

View File

@@ -1,13 +1,13 @@
function bindNavToContent(containerId, fileName, loadNow)
{
$("#page-wrapper").off();
$("#page-content").off();
$(containerId).on("click", function() {
$("#page-wrapper").load("/content/"+fileName+".html");
$("#page-content").load("/content/"+fileName+".html");
});
if (loadNow)
{
$("#page-wrapper").load("/content/"+fileName+".html");
$("#page-content").load("/content/"+fileName+".html");
}
}