mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Web: Add simple components control (#203)
This commit is contained in:
parent
cea4db8e60
commit
bb94a21c83
@ -290,43 +290,45 @@
|
|||||||
<li>
|
<li>
|
||||||
<a class="active" href="index.html"><i class="fa fa-dashboard fa-fw"></i><span lang="en" data-lang-token="main_menu_dashboard_token">Dashboard</span></a>
|
<a class="active" href="index.html"><i class="fa fa-dashboard fa-fw"></i><span lang="en" data-lang-token="main_menu_dashboard_token">Dashboard</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="inactive" href="#"><i class="fa fa-cog fa-fw"></i><span lang="en" data-lang-token="main_menu_configuration_token">Configuration</span><span class="fa arrow"></span></a>
|
<a class="inactive" href="#"><i class="fa fa-cog fa-fw"></i><span lang="en" data-lang-token="main_menu_configuration_token">Configuration</span><span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-second-level">
|
<ul class="nav nav-second-level">
|
||||||
<li>
|
<li>
|
||||||
<a class="inactive" href="#" id="load_confGeneral"><i class="fa fa-play-circle-o fa-fw"></i><span lang="en" data-lang-token="main_menu_general_conf_token">General</span></a>
|
<a class="inactive" href="#" id="load_confGeneral"><i class="fa fa-play-circle-o fa-fw"></i><span lang="en" data-lang-token="main_menu_general_conf_token">General</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="inactive" href="#" id="load_confKodi"><i class="fa fa-play-circle-o fa-fw"></i><span lang="en" data-lang-token="main_menu_kodiwatch_token">Kodi Watch</span></a>
|
<a class="inactive" href="#" id="load_confKodi"><i class="fa fa-play-circle-o fa-fw"></i><span lang="en" data-lang-token="main_menu_kodiwatch_token">Kodi Watch</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="inactive" href="#" id="load_huebridge"><i class="fa fa-cog fa-fw"></i><span lang="en" data-lang-token="main_menu_huebridge_token">Hue Bridge</span></a>
|
<a class="inactive" href="#" id="load_huebridge"><i class="fa fa-cog fa-fw"></i><span lang="en" data-lang-token="main_menu_huebridge_token">Hue Bridge</span></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="inactive" href="#"><i class="fa fa-lightbulb-o fa-fw"></i><span lang="en" data-lang-token="main_menu_remotecontrol_token">Remote Control</span><span class="fa arrow"></span></a>
|
<a class="inactive" href="#"><i class="fa fa-lightbulb-o fa-fw"></i><span lang="en" data-lang-token="main_menu_remotecontrol_token">Remote Control</span><span class="fa arrow"></span></a>
|
||||||
<ul class="nav nav-second-level">
|
<ul class="nav nav-second-level">
|
||||||
<li>
|
<li>
|
||||||
<a class="inactive" href="#" id="load_lighttest"><i class="fa fa-lightbulb-o fa-fw"></i><span lang="en" data-lang-token="main_menu_colors_token">Colors</span></a>
|
<a class="inactive" href="#" id="load_lighttest"><i class="fa fa-lightbulb-o fa-fw"></i><span lang="en" data-lang-token="main_menu_colors_token">Colors</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="inactive" href="#" id="load_effects"><i class="fa fa-certificate fa-fw"></i><span lang="en" data-lang-token="main_menu_effects_token">Effects</span></a>
|
<a class="inactive" href="#" id="load_effects"><i class="fa fa-certificate fa-fw"></i><span lang="en" data-lang-token="main_menu_effects_token">Effects</span></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
<li>
|
||||||
</li>
|
<a class="inactive" href="#" id="load_components"><i class="fa fa-list fa-fw"></i><span lang="en" data-lang-token="main_menu_component_token">Components</span></a>
|
||||||
<li>
|
</li>
|
||||||
<a class="inactive" href="#" id="load_support"><i class="fa fa-info fa-fw"></i><span lang="en" data-lang-token="main_menu_support_token">Support</span></a>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="inactive" href="#"><i class="fa fa-cog fa-fw"></i><span lang="en" data-lang-token="main_menu_system_token">System</span><span class="fa arrow"></span></a>
|
<a class="inactive" href="#" id="load_support"><i class="fa fa-info fa-fw"></i><span lang="en" data-lang-token="main_menu_support_token">Support</span></a>
|
||||||
<ul class="nav nav-second-level">
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="inactive" href="#" id="load_update"><i class="fa fa-download fa-fw"></i><span lang="en" data-lang-token="main_menu_update_token">Update</span></a>
|
<a class="inactive" href="#"><i class="fa fa-cog fa-fw"></i><span lang="en" data-lang-token="main_menu_system_token">System</span><span class="fa arrow"></span></a>
|
||||||
</li>
|
<ul class="nav nav-second-level">
|
||||||
</ul>
|
<li>
|
||||||
</li>
|
<a class="inactive" href="#" id="load_update"><i class="fa fa-download fa-fw"></i><span lang="en" data-lang-token="main_menu_update_token">Update</span></a>
|
||||||
</li>
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -449,6 +451,10 @@
|
|||||||
$("#load_effects").on("click", function() {
|
$("#load_effects").on("click", function() {
|
||||||
$("#page-wrapper").load("effects.html");
|
$("#page-wrapper").load("effects.html");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#load_components").on("click", function() {
|
||||||
|
$("#page-wrapper").load("remote_components.html");
|
||||||
|
});
|
||||||
|
|
||||||
$("#load_huebridge").on("click", function() {
|
$("#load_huebridge").on("click", function() {
|
||||||
$("#page-wrapper").load("huebridge.html");
|
$("#page-wrapper").load("huebridge.html");
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
"main_menu_remotecontrol_token" : "Fernbedienung",
|
"main_menu_remotecontrol_token" : "Fernbedienung",
|
||||||
"main_menu_colors_token" : "Farben",
|
"main_menu_colors_token" : "Farben",
|
||||||
"main_menu_effects_token" : "Effekte",
|
"main_menu_effects_token" : "Effekte",
|
||||||
|
"main_menu_component_token" : "Komponenten",
|
||||||
"main_menu_support_token" : "Hilfe",
|
"main_menu_support_token" : "Hilfe",
|
||||||
"main_menu_update_token" : "Update",
|
"main_menu_update_token" : "Update",
|
||||||
"main_menu_system_token" : "System",
|
"main_menu_system_token" : "System",
|
||||||
@ -34,6 +35,7 @@
|
|||||||
"remote_effects_intro" : "Die Effekt-Fernbedienung ermöglicht es dir Effekte zu starten für Demonstrations- oder Testzwecke. Vergessse nicht den Effekt wieder zu stoppen, wenn du fertig bist.",
|
"remote_effects_intro" : "Die Effekt-Fernbedienung ermöglicht es dir Effekte zu starten für Demonstrations- oder Testzwecke. Vergessse nicht den Effekt wieder zu stoppen, wenn du fertig bist.",
|
||||||
"remote_effects_label_effects":"Effekte",
|
"remote_effects_label_effects":"Effekte",
|
||||||
"remote_effects_label_stopeffect":"Stoppe Effekte",
|
"remote_effects_label_stopeffect":"Stoppe Effekte",
|
||||||
|
"remote_components_intro" : "Die Komponenten-Fenbedienung ermöglicht es dir Komponenten von Hyperion zu starten und stoppen. Beachte: Dies ist nur temporär und geht nach einem Neustart verloren. Möchtest du dauerhaft Komponenten aktivieren/deaktivieren benutze die Konfigurationsseiten.",
|
||||||
"hue_button_create_user_token":"Benutzer anlegen",
|
"hue_button_create_user_token":"Benutzer anlegen",
|
||||||
"hue_press_link_modal":"Link Taste auf der Hue Bridge drücken und mit Button bestätigen.",
|
"hue_press_link_modal":"Link Taste auf der Hue Bridge drücken und mit Button bestätigen.",
|
||||||
"hue_press_link_modal_failure":"Bitte drücke die Link Taste auf deiner Hue Bridge.",
|
"hue_press_link_modal_failure":"Bitte drücke die Link Taste auf deiner Hue Bridge.",
|
||||||
|
42
assets/webconfig/remote_components.html
Normal file
42
assets/webconfig/remote_components.html
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<h1 class="page-header" lang="en" data-lang-token="main_menu_component_token">Effects</h1>
|
||||||
|
<div class="introd">
|
||||||
|
<h4 lang="en" data-lang-token="remote_components_intro">The components remote enables you to disable and enable certain components of Hyperion during runtime. Keep in mind this persist just until the next reboot! To enable/disable components permament, use the configuration section.</h4>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="col-lg-12" id="componentsbutton">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
webSocket = new WebSocket('ws://'+document.location.hostname+':19444');
|
||||||
|
|
||||||
|
new Enum('SMOOTHING', 'BLACKBORDER', 'KODICHECKER', 'FORWARDER', 'UDPLISTENER', 'BOBLIGHT_SERVER','GRABBER');
|
||||||
|
|
||||||
|
function Enum() {
|
||||||
|
for (var i in arguments) {
|
||||||
|
this[arguments[i]] = i;
|
||||||
|
$('#componentsbutton').append('<button type="button" class="btn btn-success" onclick="compenable(\''+arguments[i]+'\')"><i class="fa fa-play"></i></button> '+arguments[i]+'<br />');
|
||||||
|
$('#componentsbutton').append('<button type="button" class="btn btn-danger" onclick="compdisable(\''+arguments[i]+'\')"><i class="fa fa-play"></i></button> '+arguments[i]+'<br />');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function compenable(comp){
|
||||||
|
|
||||||
|
webSocket.send('{"command":"componentstate","componentstate":{"component":"'+comp+'","state":true}}');
|
||||||
|
console.log('enable: '+comp);
|
||||||
|
|
||||||
|
}
|
||||||
|
function compdisable(comp){
|
||||||
|
|
||||||
|
webSocket.send('{"command":"componentstate","componentstate":{"component":"'+comp+'","state":false}}');
|
||||||
|
console.log('disable: '+comp);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user