mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
refactoring of webui and event based websocket layer (#219)
* make hyperion websocket api event based * implement new websocket handling for generalconf * migrate all webui stuff to new event based websocket api some cleanup ... now all html templates are in content refactoring of web stuff * add hyperionport to global start impl. removing advanced key * separate dashboard serverinfo is updated every 3 seconds automatily add input selection cleanup and remove not needed stuff * prepare infrastructure for server sided file execution * webui minor fixes * fix compile
This commit is contained in:
34
assets/webconfig/content/input_selection.html
Normal file
34
assets/webconfig/content/input_selection.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<div style="text-align:center;margin:auto;padding:auto">
|
||||
<div id="hyperion_inputs" />
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(hyperion).on("cmd-serverinfo", function(event) {
|
||||
var data = "";
|
||||
var i;
|
||||
for(i = 0; i < parsedServerInfoJSON.info.priorities.length; i++) {
|
||||
var owner = parsedServerInfoJSON.info.priorities[i].owner;
|
||||
var active = parsedServerInfoJSON.info.priorities[i].active;
|
||||
var visible = parsedServerInfoJSON.info.priorities[i].visible;
|
||||
var priority = parsedServerInfoJSON.info.priorities[i].priority;
|
||||
var btn_type = "default";
|
||||
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-info btn_input_selection" style="margin:10px;min-width:200px" onclick="requestSetSource(\'auto\');">auto select</button><br/>';
|
||||
$('#hyperion_inputs').html(data);
|
||||
|
||||
var max_width=200;
|
||||
$('.btn_input_selection').each(function() {
|
||||
elem_width = $(this).css('width')
|
||||
elem_width = elem_width.substring(0, elem_width.length - 2);
|
||||
if (elem_width > max_width)
|
||||
max_width = elem_width;
|
||||
});
|
||||
$('.btn_input_selection').css("min-width",max_width+"px");
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user