json-rpc - origin, ui update (#407)

* try ace

* .

* update

* ...

* update

* update

* test

* -

* update

* fix

* .

* Revert "."

This reverts commit 631c30f8c0.

* Revert "fix"

This reverts commit be3dbc9cbd.

* Revert "update"

This reverts commit 50fc89e800.

* Revert "-"

This reverts commit 8a6c1fdab3.

* Revert "test"

This reverts commit 50b3641490.

* update schema

* update ui

* flags

* adjustments
This commit is contained in:
brindosch 2017-02-28 17:53:41 +01:00 committed by redPanther
parent a76abdaafe
commit 31f352e7ce
45 changed files with 1883 additions and 9591 deletions

View File

@ -21,7 +21,7 @@
libh += '<a href="'+libs[key]+'" target="_blank">'+key+'</a>, '; libh += '<a href="'+libs[key]+'" target="_blank">'+key+'</a>, ';
libh += "<br/>"+$.i18n("about_credits"); libh += "<br/>"+$.i18n("about_credits");
lang = lang.toString().replace(",",", "); lang = lang.toString().replace(/,/g,", ");
var fc = [$.i18n("about_version"),$.i18n("about_build"),$.i18n("about_builddate"),$.i18n("about_translations"),$.i18n("about_resources", $.i18n("general_webui_title"))]; var fc = [$.i18n("about_version"),$.i18n("about_build"),$.i18n("about_builddate"),$.i18n("about_translations"),$.i18n("about_resources", $.i18n("general_webui_title"))];
var sc = [currentVersion,si.build,si.time,'('+availLang.length+')<p>'+lang+'</p><p><a href="#" target="_blank">'+$.i18n("about_contribute")+'</a></p>',libh]; var sc = [currentVersion,si.build,si.time,'('+availLang.length+')<p>'+lang+'</p><p><a href="#" target="_blank">'+$.i18n("about_contribute")+'</a></p>',libh];

View File

@ -268,7 +268,7 @@
<div id="collapse4" class="panel-collapse collapse"> <div id="collapse4" class="panel-collapse collapse">
<div class="panel-body"> <div class="panel-body">
<p data-i18n="conf_leds_layout_textf1">This textfield shows by default your current loaded layout and will be overwritten if you generate a new one above. Optional you could perform further edits.</p> <p data-i18n="conf_leds_layout_textf1">This textfield shows by default your current loaded layout and will be overwritten if you generate a new one above. Optional you could perform further edits.</p>
<textarea rows="25" id="ledconfig" class="form-control"></textarea> <div id="aceedit" style="width:100%;height:500px"></div>
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
<button type="button" class="btn btn-warning" id="leds_custom_updsim"><i class="fa fa-search fa-fw"></i><span data-i18n="conf_leds_layout_button_updsim">Update preview</span></button> <button type="button" class="btn btn-warning" id="leds_custom_updsim"><i class="fa fa-search fa-fw"></i><span data-i18n="conf_leds_layout_button_updsim">Update preview</span></button>

View File

@ -1,5 +1,4 @@
<div class="container" style="margin:20px auto;max-width:600px;">
<div class="container" style="margin:20px auto;max-width:600px;">
<center> <center>
<img src="img/hyperion/hyperionlostconnection.png" alt="Redefine ambient light!"> <img src="img/hyperion/hyperionlostconnection.png" alt="Redefine ambient light!">
<div> <div>
@ -10,13 +9,14 @@
<p data-i18n="info_conlost_label_reason2">- You perform an update</p> <p data-i18n="info_conlost_label_reason2">- You perform an update</p>
<p data-i18n="info_conlost_label_reason3">- Hyperion isn't running</p> <p data-i18n="info_conlost_label_reason3">- Hyperion isn't running</p>
<hr> <hr>
<i class="fa fa-refresh fa-spin" style="font-size:50px"></i> <i class="fa fa-refresh fa-spin reconstop" style="font-size:50px"></i>
<h4 data-i18n="info_conlost_label_autorefresh">This page will be automatically refreshed.</h4> <h4 class="reconstop" data-i18n="info_conlost_label_autorefresh">This page will be automatically refreshed.</h4>
<h4 data-i18n="info_conlost_label_autorecon">We reconnect again after Hyperion is available.</h4> <h4 class="reconstop" data-i18n="info_conlost_label_autorecon">We reconnect again after Hyperion is available.</h4>
<a href="/" data-i18n="info_conlost_label_reload">If not, click me or reload the page</a> <span id="counter" class="reconstop"></span>
<a class="reconstop" style="display:none" href="/" data-i18n="info_conlost_label_reload"></a>
</div> </div>
</center> </center>
</div> </div>
<!-- ************************************ --> <!-- ************************************ -->
@ -25,19 +25,36 @@
performTranslation(); performTranslation();
var connectionLost = false; var connectionLost = false;
var connectionTimer; var connectionTimer;
var count = 1;
function tryReconnect() function tryReconnect()
{ {
if(count > 100)
{
window.clearInterval(connectionTimer);
$('.reconstop').toggle();
}
$('#counter').html(count+'/100');
$.ajax({ url: "/" }).done(function(data) { $.ajax({ url: "/" }).done(function(data) {
window.clearInterval(connectionTimer); window.clearInterval(connectionTimer);
window.location.href ="/"; window.location.href ="/";
})
.fail( function( jqXHR, textStatus ) {
count++;
}); });
} }
function connectionLostAction() function connectionLostAction()
{ {
if(!connectionLost)
{
window.clearInterval(cronId);
connectionLost = true; connectionLost = true;
connectionTimer = window.setInterval(tryReconnect, 4000); connectionTimer = window.setInterval(tryReconnect, 4000);
}
} }
</script> </script>

View File

@ -14,20 +14,28 @@
<table class="table borderless"> <table class="table borderless">
<tbody> <tbody>
<tr> <tr>
<td data-i18n="dashboard_infobox_label_currenthyp">Hyperion version:</td> <td data-i18n="dashboard_infobox_label_platform">Platform:</td>
<td id="currentversion">unknown</td> <td id="dash_platform"></td>
</tr>
<tr>
<td data-i18n="dashboard_infobox_label_latesthyp">Latest version:</td>
<td id="latestversion">unknown</td>
</tr> </tr>
<tr> <tr>
<td data-i18n="conf_leds_contr_label_contrtype">LED type:</td> <td data-i18n="conf_leds_contr_label_contrtype">LED type:</td>
<td id="dash_leddevice">unknown</td> <td id="dash_leddevice"></td>
</tr> </tr>
<tr> <tr>
<td data-i18n="dashboard_infobox_label_device">Device:</td> <td data-i18n="dashboard_infobox_label_instance">Instance</td>
<td id="dash_systeminfo"></td> <td id="dash_instance"></td>
</tr>
<tr>
<td data-i18n="dashboard_infobox_label_ports">Ports</td>
<td id="dash_ports"></td>
</tr>
<tr>
<td data-i18n="dashboard_infobox_label_currenthyp">Hyperion version:</td>
<td id="dash_currv">unknown</td>
</tr>
<tr>
<td data-i18n="dashboard_infobox_label_latesthyp">Latest version:</td>
<td id="dash_latev">unknown</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -60,10 +68,11 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<i class="fa fa-newspaper-o fa-fw"></i> <i class="fa fa-newspaper-o fa-fw"></i>
<span data-i18n="dashboard_newsbox_label_title">Latest blog posts</span> <span data-i18n="dashboard_newsbox_label_title">Visit Hyperion Blog</span>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div id="dash_news" style="margin-bottom:7px"></div>
<a href="https://hyperion-project.org/blog/?pk_campaign=WebUI&pk_kwd=visitblog" target="_blank" data-i18n="dashboard_newsbox_visitblog"></a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -40,16 +40,27 @@
<table class="table borderless"> <table class="table borderless">
<tbody> <tbody>
<tr> <tr>
<td style="vertical-align:middle"><label data-i18n="remote_color_label_color"></label></td> <td style="vertical-align:middle"><label for="cpeff" data-i18n="remote_color_label_color"></label></td>
<td><div id="cp2" class="colorpicker-component input-group"> <td><div id="cp2" class="colorpicker-component input-group">
<input type="text" class="form-control"/><span class="input-group-addon"><i></i></span> <input type="text" id="cpeff" class="form-control"/><span class="input-group-addon"><i></i></span>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align:middle"><label data-i18n="remote_effects_label_effects">Effect:</label></td> <td style="vertical-align:middle"><label for="effect_select" data-i18n="remote_effects_label_effects">Effect:</label></td>
<td><select id="effect_select" class="form-control"></select></td> <td><select id="effect_select" class="form-control"></select></td>
</tr> </tr>
<tr style="display:none">
<td style="vertical-align:middle"><label for="remote_input_img" >Picture:</label></td>
<td><input id="remote_input_img" type="file" accept="image/*" /></td>
</tr>
<tr>
<td style="vertical-align:middle"><label for="remote_duration" data-i18n="remote_input_duration"></label></td>
<td class="input-group">
<input id="remote_duration" type="number" class="form-control" value="0" min="0"/>
<span class="input-group-addon" data-i18n="edt_append_s"></span>
</td>
</tr>
</tbody> </tbody>
</table> </table>
<button data-i18n="remote_color_button_reset" type="button" class="btn btn-warning" id="reset_color" style="margin-top:10px;">Reset Color/Effect</button> <button data-i18n="remote_color_button_reset" type="button" class="btn btn-warning" id="reset_color" style="margin-top:10px;">Reset Color/Effect</button>

View File

@ -17,19 +17,30 @@
performTranslation(); performTranslation();
var connectionLost = false; var connectionLost = false;
var connectionTimer; var connectionTimer;
var count = 1;
function tryReconnect() function tryReconnect()
{ {
if(count > 25)
window.clearInterval(connectionTimer);
$.ajax({ url: "/" }).done(function(data) { $.ajax({ url: "/" }).done(function(data) {
window.clearInterval(connectionTimer); window.clearInterval(connectionTimer);
window.location.href ="/"; window.location.href ="/";
})
.fail( function( jqXHR, textStatus ) {
count++;
}); });
} }
function restartAction() function restartAction()
{ {
if(!connectionLost)
{
window.clearInterval(cronId);
connectionLost = true; connectionLost = true;
connectionTimer = window.setInterval(tryReconnect, 1000); connectionTimer = window.setInterval(tryReconnect, 1000);
}
} }
</script> </script>

View File

@ -118,7 +118,5 @@
<script type="text/javascript"> <script type="text/javascript">
performTranslation(); performTranslation();
if(showOptHelp)
createHintH("intro", $.i18n('support_label_intro'), "supp_intro"); createHintH("intro", $.i18n('support_label_intro'), "supp_intro");
</script> </script>

View File

@ -1,5 +1,5 @@
/*! /*!
* Bootstrap Colorpicker v2.4.0 * Bootstrap Colorpicker v2.5.1
* https://itsjavi.com/bootstrap-colorpicker/ * https://itsjavi.com/bootstrap-colorpicker/
* *
* Originally written by (c) 2012 Stefan Petre * Originally written by (c) 2012 Stefan Petre

File diff suppressed because it is too large Load Diff

14
assets/webconfig/css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9,6 +9,9 @@ body{font-family:Roboto,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15
#page-content { #page-content {
padding-bottom:50px; padding-bottom:50px;
} }
body{
overflow-y: scroll;
}
.btn{margin: 2px 0;} .btn{margin: 2px 0;}
/*mobile nav*/ /*mobile nav*/
@ -85,6 +88,7 @@ table label{margin:0}
/*Dashboard*/ /*Dashboard*/
.component-on{color:green;} .component-on{color:green;}
.component-off{color:grey;} .component-off{color:grey;}
#dash_news hr{margin:10px 0}
/*Colorpicker 2x*/ /*Colorpicker 2x*/
.colorpicker-2x {z-index:99999} .colorpicker-2x {z-index:99999}

View File

@ -1,68 +0,0 @@
/**
* jQuery Lined Textarea Plugin
* http://alan.blog-city.com/jquerylinedtextarea.htm
*
* Copyright (c) 2010 Alan Williamson
*
* Released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* Usage:
* Displays a line number count column to the left of the textarea
*
* Class up your textarea with a given class, or target it directly
* with JQuery Selectors
*
* $(".lined").linedtextarea({
* selectedLine: 10,
* selectedClass: 'lineselect'
* });
*
*/
.linedwrap {
border: 1px solid #c0c0c0;
padding: 3px;
}
.linedtextarea {
padding: 0px;
margin: 0px;
}
.linedtextarea textarea, .linedwrap .codelines .lineno {
font-size: 10pt;
font-family: monospace;
line-height: normal !important;
}
.linedtextarea textarea {
padding-right:0.3em;
padding-top:0.3em;
border: 0;
}
.linedwrap .lines {
margin-top: 0px;
width: 50px;
float: left;
overflow: hidden;
border-right: 1px solid #c0c0c0;
margin-right: 10px;
}
.linedwrap .codelines {
padding-top: 5px;
}
.linedwrap .codelines .lineno {
color:#AAAAAA;
padding-right: 0.5em;
padding-top: 0.0em;
text-align: right;
white-space: nowrap;
}
.linedwrap .codelines .lineselect {
color: red;
}

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1,7 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="512" width="512" version="1">
<g fill-rule="evenodd" stroke-width="1pt">
<path fill="#fc0" d="M0 341.338h512.005v170.67H0z"/>
<path d="M0 0h512.005v170.67H0z"/>
<path fill="red" d="M0 170.67h512.005v170.668H0z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 289 B

View File

@ -1,15 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="512" width="512">
<defs>
<clipPath id="a">
<path fill-opacity=".67" d="M250 0h500v500H250z"/>
</clipPath>
</defs>
<g clip-path="url(#a)" transform="translate(-256) scale(1.024)">
<g stroke-width="1pt">
<path fill="#006" d="M0 0h1000.02v500.01H0z"/>
<path d="M0 0v55.903l888.218 444.11h111.802V444.11L111.802.003H0zm1000.02 0v55.9L111.802 500.01H0v-55.9L888.218 0h111.802z" fill="#fff"/>
<path d="M416.675 0v500.01h166.67V0h-166.67zM0 166.67v166.67h1000.02V166.67H0z" fill="#fff"/>
<path d="M0 200.004v100.002h1000.02V200.004H0zM450.01 0v500.01h100V0h-100zM0 500.01l333.34-166.67h74.535L74.535 500.01H0zM0 0l333.34 166.67h-74.535L0 37.27V0zm592.145 166.67L925.485 0h74.535L666.68 166.67h-74.535zm407.875 333.34L666.68 333.34h74.535l258.805 129.403v37.267z" fill="#c00"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 889 B

View File

@ -1,7 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" version="1">
<g fill-rule="evenodd" stroke-width="1pt">
<path fill="#fc0" d="M0 320h640v160.002H0z"/>
<path d="M0 0h640v160H0z"/>
<path fill="red" d="M0 160h640v160H0z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 264 B

View File

@ -1,15 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640">
<defs>
<clipPath id="a">
<path fill-opacity=".67" d="M-85.333 0h682.67v512h-682.67z"/>
</clipPath>
</defs>
<g clip-path="url(#a)" transform="translate(80) scale(.94)">
<g stroke-width="1pt">
<path fill="#006" d="M-256 0H768.02v512.01H-256z"/>
<path d="M-256 0v57.244l909.535 454.768H768.02V454.77L-141.515 0H-256zM768.02 0v57.243L-141.515 512.01H-256v-57.243L653.535 0H768.02z" fill="#fff"/>
<path d="M170.675 0v512.01h170.67V0h-170.67zM-256 170.67v170.67H768.02V170.67H-256z" fill="#fff"/>
<path d="M-256 204.804v102.402H768.02V204.804H-256zM204.81 0v512.01h102.4V0h-102.4zM-256 512.01L85.34 341.34h76.324l-341.34 170.67H-256zM-256 0L85.34 170.67H9.016L-256 38.164V0zm606.356 170.67L691.696 0h76.324L426.68 170.67h-76.324zM768.02 512.01L426.68 341.34h76.324L768.02 473.848v38.162z" fill="#c00"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 934 B

View File

@ -1,13 +1,4 @@
{ {
"@metadata": {
"authors": [
"brindosch"
],
"project" : "Hyperion WebUI",
"locale": "de",
"last-updated": "2016-11-30",
"message-documentation": "qqq"
},
"general_webui_title" : "Hyperion - Web Konfiguration", "general_webui_title" : "Hyperion - Web Konfiguration",
"general_country_de" : "Deutschland", "general_country_de" : "Deutschland",
"general_country_us" : "Amerika", "general_country_us" : "Amerika",
@ -49,13 +40,18 @@
"dashboard_infobox_label_title" : "Information", "dashboard_infobox_label_title" : "Information",
"dashboard_infobox_label_currenthyp" : "Deine Hyperion Version:", "dashboard_infobox_label_currenthyp" : "Deine Hyperion Version:",
"dashboard_infobox_label_latesthyp" : "Aktuellste Hyperion Version:", "dashboard_infobox_label_latesthyp" : "Aktuellste Hyperion Version:",
"dashboard_infobox_label_device" : "Systeminformation:", "dashboard_infobox_label_platform" : "Plattform:",
"dashboard_infobox_label_instance" : "Instanz:",
"dashboard_infobox_label_ports" : "Ports (json|proto):",
"dashboard_infobox_message_updatewarning" : "Eine aktuellere Version von Hyperion ist verfügbar! (V$1)", "dashboard_infobox_message_updatewarning" : "Eine aktuellere Version von Hyperion ist verfügbar! (V$1)",
"dashboard_infobox_message_updatesuccess" : "Du nutzt die aktuellste Version von Hyperion.", "dashboard_infobox_message_updatesuccess" : "Du nutzt die aktuellste Version von Hyperion.",
"dashboard_componentbox_label_title" : "Komponenten Status", "dashboard_componentbox_label_title" : "Komponenten Status",
"dashboard_componentbox_label_comp" : "Komponente", "dashboard_componentbox_label_comp" : "Komponente",
"dashboard_componentbox_label_status" : "Status", "dashboard_componentbox_label_status" : "Status",
"dashboard_newsbox_label_title" : "Die letzten Blogposts", "dashboard_newsbox_label_title" : "Hyperion-Blog",
"dashboard_newsbox_visitblog" : "Besuche den Hyperion-Blog",
"dashboard_newsbox_noconn" : "Fehler bei dem Versuch die letzten Blog-Posts zu laden, funtkioniert dein Internet?",
"dashboard_newsbox_readmore" : "Weiterlesen",
"dashboard_alert_message_confedit" : "Deine Hyperion Konfiguration wurde verändert. Um die Änderungen anzuwenden, starte Hyperion neu.", "dashboard_alert_message_confedit" : "Deine Hyperion Konfiguration wurde verändert. Um die Änderungen anzuwenden, starte Hyperion neu.",
"main_menu_dashboard_token" : "Dashboard", "main_menu_dashboard_token" : "Dashboard",
"main_menu_configuration_token" : "Konfiguration", "main_menu_configuration_token" : "Konfiguration",
@ -149,7 +145,7 @@
"conf_leds_layout_ma_opttopright" : "Oben rechts", "conf_leds_layout_ma_opttopright" : "Oben rechts",
"conf_leds_layout_ma_optbottomleft" : "Unten links", "conf_leds_layout_ma_optbottomleft" : "Unten links",
"conf_leds_layout_ma_optbottomright" : "Unten rechts", "conf_leds_layout_ma_optbottomright" : "Unten rechts",
"conf_leds_layout_textf1" : "Das Textfeld zeigt dir dein aktuell geladenes Layout, sofern du kein neues Layout mit den Optionen unten erstellt hast. Optional kann man die Werte hier weiter bearbeiten.", "conf_leds_layout_textf1" : "Das Textfeld zeigt dir dein aktuell geladenes Layout, sofern du kein neues Layout mit den Optionen oben erstellt hast. Optional kann man die Werte hier weiter bearbeiten.",
"conf_grabber_fg_intro" : "Plattform Aufnahme ist das lokale System auf dem Hyperion installiert wurde, welches als Bildquelle dient.", "conf_grabber_fg_intro" : "Plattform Aufnahme ist das lokale System auf dem Hyperion installiert wurde, welches als Bildquelle dient.",
"conf_grabber_v4l_intro" : "USB Aufnahme ist ein Gerät, welches via USB angeschlossen ist und als Bildquelle dient.", "conf_grabber_v4l_intro" : "USB Aufnahme ist ein Gerät, welches via USB angeschlossen ist und als Bildquelle dient.",
"conf_colors_color_intro" : "Erstelle Kalibrierungsprofile und passe Farben an, Helligkeit, Linearisierung und mehr.", "conf_colors_color_intro" : "Erstelle Kalibrierungsprofile und passe Farben an, Helligkeit, Linearisierung und mehr.",
@ -245,13 +241,14 @@
"info_conlost_label_reason1" : "- Schlechte WLAN Verbindung", "info_conlost_label_reason1" : "- Schlechte WLAN Verbindung",
"info_conlost_label_reason2" : "- Ein Update wird durchgeführt", "info_conlost_label_reason2" : "- Ein Update wird durchgeführt",
"info_conlost_label_reason3" : "- Hyperion wird nicht mehr ausgeführt", "info_conlost_label_reason3" : "- Hyperion wird nicht mehr ausgeführt",
"info_conlost_label_autorecon" : "Du wirst verbunden, sobald Hyperion wieder verfügbar ist", "info_conlost_label_autorecon" : "Du wirst verbunden, sobald Hyperion wieder verfügbar ist.",
"info_conlost_label_autorefresh" : "Diese Seite wird automatisch aktualisiert", "info_conlost_label_autorefresh" : "Diese Seite wird automatisch aktualisiert.",
"info_conlost_label_reload" : "Wenn nicht, klicke hier", "info_conlost_label_reload" : "Automatisches verbinden gestoppt - limit überschritten. Lade die Seite neu oder klick mich.",
"info_restart_title" : "Startet gerade neu...", "info_restart_title" : "Startet gerade neu...",
"info_restart_rightback" : "Hyperion ist gleich wieder für dich da!", "info_restart_rightback" : "Hyperion ist gleich wieder für dich da!",
"info_restart_contus" : "Solltest du nach 20 Sekunden immer noch hier sein, ist etwas schief gelaufen. Öffne bitte in unserem Support Forum ein neues Thema...", "info_restart_contus" : "Solltest du nach 20 Sekunden immer noch hier sein, ist etwas schief gelaufen. Öffne bitte in unserem Support Forum ein neues Thema...",
"info_restart_contusa" : "...mit deinen letztes Schritten. Danke!", "info_restart_contusa" : "...mit deinen letztes Schritten. Danke!",
"info_404" : "Die angeforderte Seite ist nicht verfügbar!",
"infoDialog_general_success_title" : "Erfolg", "infoDialog_general_success_title" : "Erfolg",
"infoDialog_general_error_title" : "Fehler", "infoDialog_general_error_title" : "Fehler",
"infoDialog_general_warning_title" : "Warnung", "infoDialog_general_warning_title" : "Warnung",
@ -486,6 +483,10 @@
"edt_conf_fg_horizontalPixelDecimation_expl" : "Horizontale Pixelreduzierung (Faktor)", "edt_conf_fg_horizontalPixelDecimation_expl" : "Horizontale Pixelreduzierung (Faktor)",
"edt_conf_fg_useXGetImage_title" : "Nutze XGetImage", "edt_conf_fg_useXGetImage_title" : "Nutze XGetImage",
"edt_conf_fg_useXGetImage_expl" : "XGetImage für aktuelle X11 desktops", "edt_conf_fg_useXGetImage_expl" : "XGetImage für aktuelle X11 desktops",
"edt_conf_fg_width_title" : "Breite",
"edt_conf_fg_width_expl" : "Verkleinere Bild auf dieser Breite, da das Rohmaterial viel Leistung benötigen würde.",
"edt_conf_fg_height_title" : "Höhe",
"edt_conf_fg_height_expl" : "Verkleinere Bild auf dieser Höhe, da das Rohmaterial viel Leistung benötigen würde.",
"edt_conf_fg_verticalPixelDecimation_title" : "Vertikale Pixelreduzierung", "edt_conf_fg_verticalPixelDecimation_title" : "Vertikale Pixelreduzierung",
"edt_conf_fg_verticalPixelDecimation_expl" : "Vertikale Pixelreduzierung (Faktor)", "edt_conf_fg_verticalPixelDecimation_expl" : "Vertikale Pixelreduzierung (Faktor)",
"edt_conf_fg_device_title" : "Device", "edt_conf_fg_device_title" : "Device",
@ -551,6 +552,7 @@
"edt_conf_webc_docroot_expl" : "Lokaler Pfad zum WebUI Wurzelverzeichnis (Nur für WebUI Entwickler)", "edt_conf_webc_docroot_expl" : "Lokaler Pfad zum WebUI Wurzelverzeichnis (Nur für WebUI Entwickler)",
"edt_conf_effp_heading_title" : "Effekt Pfade", "edt_conf_effp_heading_title" : "Effekt Pfade",
"edt_conf_effp_paths_title" : "Effekt Pfad(e)", "edt_conf_effp_paths_title" : "Effekt Pfad(e)",
"edt_conf_effp_paths_expl" : "Es können mehrere Ordner definiert werden die Effekte enthalten. Der Effekt Konfigurator speichert immer im Ersten Ordner.",
"edt_conf_effp_paths_itemtitle" : "Pfad", "edt_conf_effp_paths_itemtitle" : "Pfad",
"edt_conf_effp_disable_title" : "Deaktivierte Effekte", "edt_conf_effp_disable_title" : "Deaktivierte Effekte",
"edt_conf_effp_disable_itemtitle" : "Effekt", "edt_conf_effp_disable_itemtitle" : "Effekt",

View File

@ -1,13 +1,4 @@
{ {
"@metadata": {
"authors": [
"brindosch"
],
"project" : "Hyperion WebUI",
"locale": "en",
"last-updated": "2016-11-30",
"message-documentation": "qqq.json"
},
"general_webui_title" : "Hyperion - Web Configuration", "general_webui_title" : "Hyperion - Web Configuration",
"general_country_de" : "Germany", "general_country_de" : "Germany",
"general_country_us" : "United States", "general_country_us" : "United States",
@ -49,13 +40,18 @@
"dashboard_infobox_label_title" : "Information", "dashboard_infobox_label_title" : "Information",
"dashboard_infobox_label_currenthyp" : "Your Hyperion version:", "dashboard_infobox_label_currenthyp" : "Your Hyperion version:",
"dashboard_infobox_label_latesthyp" : "Latest Hyperion version:", "dashboard_infobox_label_latesthyp" : "Latest Hyperion version:",
"dashboard_infobox_label_device" : "System:", "dashboard_infobox_label_platform" : "Platform:",
"dashboard_infobox_message_updatewarning" : "A newer version of Hyperion is available! (V$1)", "dashboard_infobox_label_instance" : "Instance:",
"dashboard_infobox_label_ports" : "Ports (json|proto):",
"dashboard_infobox_message_updatewarning" : "A newer version of Hyperion is available! ($1)",
"dashboard_infobox_message_updatesuccess" : "You run the latest version of Hyperion.", "dashboard_infobox_message_updatesuccess" : "You run the latest version of Hyperion.",
"dashboard_componentbox_label_title" : "Components status", "dashboard_componentbox_label_title" : "Components status",
"dashboard_componentbox_label_comp" : "Component", "dashboard_componentbox_label_comp" : "Component",
"dashboard_componentbox_label_status" : "Status", "dashboard_componentbox_label_status" : "Status",
"dashboard_newsbox_label_title" : "Latest Blog posts", "dashboard_newsbox_label_title" : "Hyperion-Blog",
"dashboard_newsbox_visitblog" : "Visit Hyperion-Blog",
"dashboard_newsbox_noconn" : "Can't connect to Hyperion Server to retrieve latest posts, does your internet connection work?",
"dashboard_newsbox_readmore" : "Read more",
"dashboard_alert_message_confedit" : "Your Hyperion configuration has been modified. To apply it, restart Hyperion.", "dashboard_alert_message_confedit" : "Your Hyperion configuration has been modified. To apply it, restart Hyperion.",
"main_menu_dashboard_token" : "Dashboard", "main_menu_dashboard_token" : "Dashboard",
"main_menu_configuration_token" : "Configuration", "main_menu_configuration_token" : "Configuration",
@ -118,7 +114,7 @@
"conf_leds_layout_preview_originCL" : "Created from: Classic Layout (LED Frame)", "conf_leds_layout_preview_originCL" : "Created from: Classic Layout (LED Frame)",
"conf_leds_layout_preview_originTEXT" : "Created from: Textfield", "conf_leds_layout_preview_originTEXT" : "Created from: Textfield",
"conf_leds_layout_preview_originMA" : "Created from: Matrix Layout(LED wall)", "conf_leds_layout_preview_originMA" : "Created from: Matrix Layout(LED wall)",
"conf_leds_layout_preview_totalleds" : "Amount of LEDs: $1", "conf_leds_layout_preview_totalleds" : "Totel LEDs: $1",
"conf_leds_layout_preview_ledpower" : "Max. power consumption: $1 A", "conf_leds_layout_preview_ledpower" : "Max. power consumption: $1 A",
"conf_leds_layout_preview_l1" : "This is your first led (input position)", "conf_leds_layout_preview_l1" : "This is your first led (input position)",
"conf_leds_layout_preview_l2" : "This visualizes the data direction (second/third led)", "conf_leds_layout_preview_l2" : "This visualizes the data direction (second/third led)",
@ -149,7 +145,7 @@
"conf_leds_layout_ma_opttopright" : "Top right", "conf_leds_layout_ma_opttopright" : "Top right",
"conf_leds_layout_ma_optbottomleft" : "Bottom left", "conf_leds_layout_ma_optbottomleft" : "Bottom left",
"conf_leds_layout_ma_optbottomright" : "Bottom right", "conf_leds_layout_ma_optbottomright" : "Bottom right",
"conf_leds_layout_textf1" : "This textfield shows by default your current loaded layout and will be overwritten if you generate a new one with the options below. Optional you could perform further edits.", "conf_leds_layout_textf1" : "This textfield shows by default your current loaded layout and will be overwritten if you generate a new one with the options above. Optional you could perform further edits.",
"conf_grabber_fg_intro" : "Platforum capture is your local system capture as input source, Hyperion is installed on.", "conf_grabber_fg_intro" : "Platforum capture is your local system capture as input source, Hyperion is installed on.",
"conf_grabber_v4l_intro" : "USB capture is a (capture)device connected via USB which is used to input source pictures for processing.", "conf_grabber_v4l_intro" : "USB capture is a (capture)device connected via USB which is used to input source pictures for processing.",
"conf_colors_color_intro" : "Create one or more calibration profiles, adjust each color, brightness, linearization and more.", "conf_colors_color_intro" : "Create one or more calibration profiles, adjust each color, brightness, linearization and more.",
@ -181,8 +177,8 @@
"remote_input_label" : "Source Selection", "remote_input_label" : "Source Selection",
"remote_input_intro" : "Hyperion uses a priority system to select a source. Everything you set has a priority (Effect/Color/Platform capture/USB capture and network sources). By default, Hyperion select sources depending on priority (lowest number reflects the current active source). Now you have the opportunity to select sources on your own. $1", "remote_input_intro" : "Hyperion uses a priority system to select a source. Everything you set has a priority (Effect/Color/Platform capture/USB capture and network sources). By default, Hyperion select sources depending on priority (lowest number reflects the current active source). Now you have the opportunity to select sources on your own. $1",
"remote_input_label_autoselect" : "Auto Selection", "remote_input_label_autoselect" : "Auto Selection",
"remote_input_setsource_btn" : "Select Input", "remote_input_setsource_btn" : "Select Source",
"remote_input_sourceactiv_btn" : "Input active", "remote_input_sourceactiv_btn" : "Source active",
"remote_input_origin" : "Origin", "remote_input_origin" : "Origin",
"remote_input_owner" : "Type", "remote_input_owner" : "Type",
"remote_input_priority" : "Priority", "remote_input_priority" : "Priority",
@ -247,11 +243,12 @@
"info_conlost_label_reason3" : "- Hyperion isn't running", "info_conlost_label_reason3" : "- Hyperion isn't running",
"info_conlost_label_autorecon" : "We reconnect again after Hyperion is available.", "info_conlost_label_autorecon" : "We reconnect again after Hyperion is available.",
"info_conlost_label_autorefresh" : "This page will be automatically refreshed.", "info_conlost_label_autorefresh" : "This page will be automatically refreshed.",
"info_conlost_label_reload" : "If not, click me or reload the page", "info_conlost_label_reload" : "Auto reconnect stopped - limit exceeded, please refresh page or click me.",
"info_restart_title" : "Restarts currently...", "info_restart_title" : "Restarts currently...",
"info_restart_rightback" : "Hyperion will be right back immediately!", "info_restart_rightback" : "Hyperion will be right back immediately!",
"info_restart_contus" : "If you still hang around here after 20 seconds and you have no clue why please open a new topic at our support forum...", "info_restart_contus" : "If you still hang around here after 20 seconds and you have no clue why please open a new topic at our support forum...",
"info_restart_contusa" : "...with your last steps. Thank you!", "info_restart_contusa" : "...with your last steps. Thank you!",
"info_404" : "The page you requested is not available!",
"infoDialog_general_success_title" : "Success", "infoDialog_general_success_title" : "Success",
"infoDialog_general_error_title" : "Error", "infoDialog_general_error_title" : "Error",
"infoDialog_general_warning_title" : "Warning", "infoDialog_general_warning_title" : "Warning",
@ -485,6 +482,10 @@
"edt_conf_fg_frequency_Hz_expl" : "How fast new pictures are captured", "edt_conf_fg_frequency_Hz_expl" : "How fast new pictures are captured",
"edt_conf_fg_horizontalPixelDecimation_title" : "Horizontal pixel decimation", "edt_conf_fg_horizontalPixelDecimation_title" : "Horizontal pixel decimation",
"edt_conf_fg_horizontalPixelDecimation_expl" : "Horizontal pixel decimation (factor)", "edt_conf_fg_horizontalPixelDecimation_expl" : "Horizontal pixel decimation (factor)",
"edt_conf_fg_width_title" : "Width",
"edt_conf_fg_width_expl" : "Shrink picture to this width, as raw picture needs a lot of cpu time.",
"edt_conf_fg_height_title" : "Height",
"edt_conf_fg_height_expl" : "Shrink picture to this height, as raw material needs a lot of cpu time.",
"edt_conf_fg_useXGetImage_title" : "Use XGetImage", "edt_conf_fg_useXGetImage_title" : "Use XGetImage",
"edt_conf_fg_useXGetImage_expl" : "XGetImage for newer X11 desktops", "edt_conf_fg_useXGetImage_expl" : "XGetImage for newer X11 desktops",
"edt_conf_fg_verticalPixelDecimation_title" : "Vertical pixel decimation", "edt_conf_fg_verticalPixelDecimation_title" : "Vertical pixel decimation",
@ -552,6 +553,7 @@
"edt_conf_webc_docroot_expl" : "Local webinterface root path (just for webui developer)", "edt_conf_webc_docroot_expl" : "Local webinterface root path (just for webui developer)",
"edt_conf_effp_heading_title" : "Effekt Paths", "edt_conf_effp_heading_title" : "Effekt Paths",
"edt_conf_effp_paths_title" : "Effect Path(s)", "edt_conf_effp_paths_title" : "Effect Path(s)",
"edt_conf_effp_paths_expl" : "You could define more folders that contain effects. The effect configurator will always save inside the first folder.",
"edt_conf_effp_paths_itemtitle" : "Path", "edt_conf_effp_paths_itemtitle" : "Path",
"edt_conf_effp_disable_title" : "Disabed Effects", "edt_conf_effp_disable_title" : "Disabed Effects",
"edt_conf_effp_disable_itemtitle" : "Effect", "edt_conf_effp_disable_itemtitle" : "Effect",

View File

@ -7,49 +7,42 @@
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' /> <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="description" content=""> <meta name="description" content="">
<title data-i18n="general_webui_title">Hyperion - Error</title> <title data-i18n="general_webui_title">Hyperion - Web Configuration</title>
<!-- jQuery --> <!-- jQuery -->
<script src="/js/lib/jquery.min.js"></script> <script src="js/lib/jquery.min.js"></script>
<!-- Hyperion --> <!-- Hyperion -->
<script src="/js/hyperion.js"></script> <script src="js/hyperion.js"></script>
<script src="/js/ui_utils.js"></script> <script src="js/ui_utils.js"></script>
<!-- textarea -->
<script src="/js/lib/jquery-linedtextarea.js"></script>
<link href="/css/jquery-linedtextarea.css" type="text/css" rel="stylesheet" />
<!-- Colorpicker --> <!-- Colorpicker -->
<script src="/js/lib/bootstrap-colorpicker.min.js"></script> <script src="js/lib/bootstrap-colorpicker.min.js"></script>
<link href="/css/bootstrap-colorpicker.min.css" rel="stylesheet"> <link href="css/bootstrap-colorpicker.min.css" rel="stylesheet">
<!-- JSONEditor --> <!-- JSONEditor -->
<script src="/js/lib/jsoneditor.js"></script> <script src="js/lib/jsoneditor.js"></script>
<!--Language Support --> <!--Language Support -->
<script src="/js/lib/jquery.i18n.js"></script> <script src="js/lib/jquery.i18n.js"></script>
<script src="/js/lib/jquery.i18n.messagestore.js"></script> <script src="js/lib/jquery.i18n.messagestore.js"></script>
<script src="/js/lib/jquery.i18n.fallbacks.js"></script> <script src="js/lib/jquery.i18n.fallbacks.js"></script>
<script src="/js/lib/jquery.i18n.parser.js"></script> <script src="js/lib/jquery.i18n.parser.js"></script>
<script src="/js/lib/jquery.i18n.emitter.js"></script> <script src="js/lib/jquery.i18n.emitter.js"></script>
<script src="/js/lib/jquery.i18n.language.js"></script> <script src="js/lib/jquery.i18n.language.js"></script>
<!-- Bootstrap Core CSS --> <!-- Bootstrap Core CSS -->
<link href="/css/bootstrap.css" rel="stylesheet"> <link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Flags -->
<link href="/css/flag-icon.min.css" rel="stylesheet">
<!-- MetisMenu CSS --> <!-- MetisMenu CSS -->
<link href="/css/metisMenu.css" rel="stylesheet"> <link href="css/metisMenu.css" rel="stylesheet">
<!-- Custom CSS --> <!-- Custom CSS -->
<link href="/css/sb-admin-2.css" rel="stylesheet"> <link href="css/sb-admin-2.css" rel="stylesheet">
<link href="/css/hyperion.css" rel="stylesheet"> <link href="css/hyperion.css" rel="stylesheet">
<!-- Custom Fonts --> <!-- Custom Fonts -->
<link href="/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
@ -87,16 +80,6 @@
<!-- /.navbar-header --> <!-- /.navbar-header -->
<ul class="nav navbar-top-links navbar-right"> <ul class="nav navbar-top-links navbar-right">
<li class="dropdown" id="btn_setlang">
<a>
<i class="fa fa-globe fa-fw"></i>
</a>
</li>
<li class="dropdown" id="btn_setaccess">
<a>
<i class="fa fa-key fa-fw"></i>
</a>
</li>
<li class="dropdown" id="btn_open_ledsim"> <li class="dropdown" id="btn_open_ledsim">
<a> <a>
<i class="fa fa-television fa-fw"></i> <i class="fa fa-television fa-fw"></i>
@ -135,9 +118,32 @@
</a> </a>
</li> </li>
</ul> </ul>
<!-- /.dropdown-alerts -->
</li> </li>
<!-- /.dropdown --> <!-- /.dropdown -->
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-wrench fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-alerts">
<li id="btn_setlang">
<a>
<div>
<i class="fa fa-globe fa-fw"></i>
<span data-i18n="InfoDialog_lang_title"></span>
</div>
</a>
</li>
<li class="divider"></li>
<li id="btn_setaccess">
<a>
<div>
<i class="fa fa-key fa-fw"></i>
<span data-i18n="InfoDialog_access_title"></span>
</div>
</a>
</li>
</ul>
</li>
</ul> </ul>
<!-- /.navbar-top-left --> <!-- /.navbar-top-left -->
@ -254,25 +260,29 @@
</div> </div>
<!-- Bootstrap Core JavaScript --> <!-- Bootstrap Core JavaScript -->
<script src="/js/lib/bootstrap.min.js"></script> <script src="js/lib/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript --> <!-- Metis Menu Plugin JavaScript -->
<script src="/js/lib/metisMenu.min.js"></script> <script src="js/lib/metisMenu.min.js"></script>
<!-- Custom Theme JavaScript --> <!-- Custom Theme JavaScript -->
<script src="/js/lib/sb-admin-2.js"></script> <script src="js/lib/sb-admin-2.js"></script>
<script src="/js/content_index.js"></script> <script src="js/content_index.js"></script>
<script src="/js/settings.js"></script> <script src="js/settings.js"></script>
<script src="/js/wizard.js"></script> <script src="js/wizard.js"></script>
<!--gijgo dialog--> <!--gijgo dialog-->
<script src="/js/lib/draggable.min.js"></script> <script src="js/lib/draggable.min.js"></script>
<script src="/js/lib/dialog.min.js"></script> <script src="js/lib/dialog.min.js"></script>
<script src="/js/ledsim.js"></script> <script src="js/ledsim.js"></script>
<!--Client-side download--> <!--Client-side download-->
<script src='/js/lib/download.min.js'></script> <script src='js/lib/download.min.js'></script>
<!--JsonAceEditor-->
<script src='js/lib/jsonaceeditor.min.js'></script>
<link href="css/jsonaceeditor.min.css" rel="stylesheet" type="text/css">
</body> </body>
</html> </html>

View File

@ -1,6 +1,53 @@
$(document).ready( function() { $(document).ready( function() {
performTranslation(); performTranslation();
function newsCont(t,e,l)
{
var h = '<div style="padding-left:9px;border-left:6px solid #0088cc;">';
h += '<h4 style="font-weight:bold;font-size:17px">'+t+'</h4>';
h += e;
h += '<a href="'+l+'" class="" target="_blank"><i class="fa fa-fw fa-newspaper-o"></i>'+$.i18n('dashboard_newsbox_readmore')+'</a>';
h += '</div><hr/>';
$('#dash_news').append(h);
}
function createNews(d)
{
for(var i = 0; i<d.length; i++)
{
if(i > 5)
break;
title = d[i].title.rendered;
excerpt = d[i].excerpt.rendered;
link = d[i].link+'?pk_campaign=WebUI&pk_kwd=post_'+d[i].slug;
newsCont(title,excerpt,link);
}
}
function getNews()
{
var h = '<span style="color:red;font-weight:bold">'+$.i18n('dashboard_newsbox_noconn')+'</span>';
$.ajax({
url: 'https://hyperion-project.org/wp-json/wp/v2/posts?_embed',
dataType: 'json',
type: 'GET',
timeout: 2000
})
.done( function( data, textStatus, jqXHR ) {
if(jqXHR.status == 200)
createNews(data);
else
$('#dash_news').html(h);
})
.fail( function( jqXHR, textStatus ) {
$('#dash_news').html(h);
});
}
//getNews();
function updateComponents() function updateComponents()
{ {
var components = serverInfo.info.components; var components = serverInfo.info.components;
@ -12,13 +59,11 @@ $(document).ready( function() {
$("#tab_components").html(components_html); $("#tab_components").html(components_html);
} }
// get active led device // add more info
var leddevice = serverInfo.info.ledDevices.active; $('#dash_leddevice').html(serverInfo.info.ledDevices.active);
$('#dash_leddevice').html(leddevice); $('#dash_currv').html(currentVersion);
$('#dash_instance').html(serverConfig.general.name);
// get host $('#dash_ports').html(jsonPort+' | '+serverConfig.protoServer.port);
var hostname = serverInfo.info.hostname;
$('#dash_systeminfo').html(hostname+':'+jsonPort);
$.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/version.json", function( data ) { $.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/version.json", function( data ) {
parsedUpdateJSON = JSON.parse(data); parsedUpdateJSON = JSON.parse(data);
@ -26,8 +71,7 @@ $(document).ready( function() {
var cleanLatestVersion = latestVersion.replace(/\./g, ''); var cleanLatestVersion = latestVersion.replace(/\./g, '');
var cleanCurrentVersion = currentVersion.replace(/\./g, ''); var cleanCurrentVersion = currentVersion.replace(/\./g, '');
$('#currentversion').html(currentVersion); $('#dash_latev').html(latestVersion);
$('#latestversion').html(latestVersion);
if ( cleanCurrentVersion < cleanLatestVersion ) if ( cleanCurrentVersion < cleanLatestVersion )
$('#versioninforesult').html('<div style="margin:0px;" class="alert alert-warning">'+$.i18n('dashboard_infobox_message_updatewarning', latestVersion)+'</div>'); $('#versioninforesult').html('<div style="margin:0px;" class="alert alert-warning">'+$.i18n('dashboard_infobox_message_updatewarning', latestVersion)+'</div>');
@ -35,6 +79,24 @@ $(document).ready( function() {
$('#versioninforesult').html('<div style="margin:0px;" class="alert alert-success">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>'); $('#versioninforesult').html('<div style="margin:0px;" class="alert alert-success">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
}); });
//determine platform
var grabbers = serverInfo.info.grabbers.available;
var html = "";
if(grabbers.indexOf('dispmanx') > -1)
html += 'Raspberry Pi';
else if(grabbers.indexOf('x11') > -1)
html += 'X86';
else if(grabbers.indexOf('osx') > -1)
html += 'OSX';
else if(grabbers.indexOf('amlogic') > -1)
html += 'Amlogic';
else
html += 'Framebuffer';
$('#dash_platform').html(html);
//interval update //interval update
updateComponents(); updateComponents();
$(hyperion).on("cmd-serverinfo",updateComponents); $(hyperion).on("cmd-serverinfo",updateComponents);

View File

@ -99,13 +99,17 @@ $(document).ready( function() {
}); });
$('#btn_submit_foregroundEffect').off().on('click',function() { $('#btn_submit_foregroundEffect').off().on('click',function() {
//requestWriteConfig(foregroundEffect_editor.getValue()); var value = foregroundEffect_editor.getValue();
console.log(foregroundEffect_editor.getValue()); if(typeof value.foregroundEffect.effect == 'undefined')
value.foregroundEffect.effect = serverConfig.foregroundEffect.effect;
requestWriteConfig(value);
}); });
$('#btn_submit_backgroundEffect').off().on('click',function() { $('#btn_submit_backgroundEffect').off().on('click',function() {
//requestWriteConfig(backgroundEffect_editor.getValue()); var value = backgroundEffect_editor.getValue();
console.log(backgroundEffect_editor.getValue()); if(typeof value.backgroundEffect.effect == 'undefined')
value.backgroundEffect.effect = serverConfig.backgroundEffect.effect;
requestWriteConfig(value);
}); });
//create introduction //create introduction

View File

@ -3,6 +3,14 @@ $(document).ready( function() {
var conf_editor_v4l2 = null; var conf_editor_v4l2 = null;
var conf_editor_fg = null; var conf_editor_fg = null;
function hideEl(el)
{
for(var i = 0; i<el.length; i++)
{
$('[data-schemapath*="root.framegrabber.'+el[i]+'"]').toggle(false);
}
}
if(showOptHelp) if(showOptHelp)
{ {
//fg //fg
@ -55,6 +63,18 @@ $(document).ready( function() {
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2"); createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2");
} }
//hide specific options
conf_editor_fg.on('ready',function() {
var grabbers = serverInfo.info.grabbers.available;
if(grabbers.indexOf('dispmanx') > -1)
hideEl(["device","verticalPixelDecimation","horizontalPixelDecimation","useXGetImage"]);
else if(grabbers.indexOf('x11') > -1)
hideEl(["device","width","height"]);
else if(grabbers.indexOf('osx') > -1 || grabbers.indexOf('amlogic') > -1)
hideEl(["device","verticalPixelDecimation","horizontalPixelDecimation","useXGetImage","cropLeft","cropBottom","cropTop","cropRight"]);
});
removeOverlay(); removeOverlay();
}); });

View File

@ -67,8 +67,9 @@ $(document).ready( function() {
initRestart(); initRestart();
}); });
$(".mnava").on('click', function(e){ $(".mnava").bind('click.menu', function(e){
loadContent(e); loadContent(e);
window.scrollTo(0, 0);
}); });
}); });

View File

@ -2,16 +2,6 @@
var ledsCustomCfgInitialized = false; var ledsCustomCfgInitialized = false;
var finalLedArray = []; var finalLedArray = [];
function validateText(){
e = isJsonString($("#ledconfig").val());
if (e.length != 0){
showInfoDialog("error", $.i18n('InfoDialog_leds_validfail_title'), e);
return false
}
return true
}
function round(number) { function round(number) {
var factor = Math.pow(10, 4); var factor = Math.pow(10, 4);
var tempNumber = number * factor; var tempNumber = number * factor;
@ -35,7 +25,7 @@ function createLedPreview(leds, origin){
} }
$('#previewledcount').html($.i18n('conf_leds_layout_preview_totalleds', leds.length)); $('#previewledcount').html($.i18n('conf_leds_layout_preview_totalleds', leds.length));
$('#previewledpower').html($.i18n('conf_leds_layout_preview_ledpower', (leds.length * 0.06).toFixed(1))); $('#previewledpower').html($.i18n('conf_leds_layout_preview_ledpower', ((leds.length * 0.06)*1.1).toFixed(1)));
$('.st_helper').css("border", "8px solid grey"); $('.st_helper').css("border", "8px solid grey");
@ -106,7 +96,7 @@ function createClassicLeds(){
} }
function rotateArray(array, times){ function rotateArray(array, times){
if (times > "0"){ if (times > 0){
while( times-- ){ while( times-- ){
array.push(array.shift()) array.push(array.shift())
} }
@ -366,35 +356,70 @@ $(document).ready(function() {
// bind change event to all inputs // bind change event to all inputs
$('.ledCLconstr').bind("change", function() { $('.ledCLconstr').bind("change", function() {
valValue(this.id,this.value,this.min,this.max);
createClassicLeds(); createClassicLeds();
}); });
$('.ledMAconstr').bind("change", function() { $('.ledMAconstr').bind("change", function() {
valValue(this.id,this.value,this.min,this.max);
createMatrixLeds(); createMatrixLeds();
}); });
// cl leds push to textfield and save values // v4 of json schema with diff required assignment - remove when hyperion schema moved to v4
$('#btn_cl_generate').off().on("click", function() { var ledschema = {"items":{"additionalProperties":false,"required":["hscan","vscan","index"],"properties":{"clone":{"type":"integer"},"colorOrder":{"enum":["rgb","bgr","rbg","brg","gbr","grb"],"type":"string"},"hscan":{"additionalProperties":false,"properties":{"maximum":{"maximum":1,"minimum":0,"type":"number"},"minimum":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"},"index":{"type":"integer"},"vscan":{"additionalProperties":false,"properties":{"maximum":{"maximum":1,"minimum":0,"type":"number"},"minimum":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"}},"type":"object"},"type":"array"}
if (finalLedArray != ""){ //create jsonace editor
$("#ledconfig").text(JSON.stringify(finalLedArray, null, "\t")); var aceEdt = new JSONACEEditor(document.getElementById("aceedit"),{
$('#collapse1').collapse('hide'); mode: 'code',
$('#collapse4').collapse('show'); schema: ledschema,
onChange: function(){
var success = true;
try{
aceEdt.get();
} }
}); catch(err)
{
// ma leds push to textfield and save values success = false;
$('#btn_ma_generate').off().on("click", function() {
if (finalLedArray != ""){
$("#ledconfig").text(JSON.stringify(finalLedArray, null, "\t"));
$('#collapse2').collapse('hide');
$('#collapse4').collapse('show');
} }
});
// fill textfield with current led conf and copy to finalLedArray if(success)
$("#ledconfig").text(JSON.stringify(serverConfig.leds, null, "\t")); {
$('#leds_custom_updsim').attr("disabled", false);
$('#leds_custom_save').attr("disabled", false);
}
else
{
$('#leds_custom_updsim').attr("disabled", true);
$('#leds_custom_save').attr("disabled", true);
}
}
}, serverConfig.leds);
//TODO: HACK! No callback for schema validation - Add it!
setInterval(function(){
if($('#aceedit table').hasClass('jsoneditor-text-errors'))
{
$('#leds_custom_updsim').attr("disabled", true);
$('#leds_custom_save').attr("disabled", true);
}
},1000)
$('.jsoneditor-menu').toggle();
// leds to finalLedArray
finalLedArray = serverConfig.leds; finalLedArray = serverConfig.leds;
// cl/ma leds push to textfield
$('#btn_cl_generate, #btn_ma_generate').off().on("click", function(e) {
if(e.currentTarget.id == "btn_cl_generate")
$('#collapse1').collapse('hide');
else
$('#collapse2').collapse('hide');
aceEdt.set(finalLedArray);
$('#collapse4').collapse('show');
});
// create and update editor // create and update editor
var conf_editor = null; var conf_editor = null;
$("#leddevices").off().on("change", function() { $("#leddevices").off().on("change", function() {
@ -471,9 +496,7 @@ $(document).ready(function() {
// validate textfield and update preview // validate textfield and update preview
$("#leds_custom_updsim").off().on("click", function() { $("#leds_custom_updsim").off().on("click", function() {
if (validateText()){ createLedPreview(aceEdt.get(), 'text');
createLedPreview(JSON.parse($("#ledconfig").val()), 'text');
}
}); });
// save led config and saveValues - passing textfield // save led config and saveValues - passing textfield
@ -482,13 +505,10 @@ $(document).ready(function() {
saveValues(); saveValues();
}); });
// validate and save led config from textfield // save led config from textfield
$("#leds_custom_save").off().on("click", function() { $("#leds_custom_save").off().on("click", function() {
if (validateText()) requestWriteConfig(JSON.parse('{"leds" :'+aceEdt.getText()+'}'));
{
requestWriteConfig(JSON.parse('{"leds" :'+$("#ledconfig").val()+'}'));
saveValues(); saveValues();
}
}); });
// toggle led numbers // toggle led numbers

View File

@ -33,6 +33,7 @@ $(document).ready(function() {
var config = JSON.stringify(serverConfig, null, "\t").replace(/"/g, '\\"'); var config = JSON.stringify(serverConfig, null, "\t").replace(/"/g, '\\"');
var prios = serverInfo.info.priorities; var prios = serverInfo.info.priorities;
var comps = serverInfo.info.components; var comps = serverInfo.info.components;
var info;
//create log //create log
for(var i = 0; i<messages.length; i++) for(var i = 0; i<messages.length; i++)
@ -52,9 +53,17 @@ $(document).ready(function() {
log += "["+app_name+" "+logger_name+"] <"+level_string+"> "+debug+msg+"\n"; log += "["+app_name+" "+logger_name+"] <"+level_string+"> "+debug+msg+"\n";
} }
//create general info
info = "######## GENERAL ######## \n";
info += 'Build: '+serverInfo.info.hyperion[0].build+'\n';
info += 'Build time: '+serverInfo.info.hyperion[0].time+'\n';
info += 'Version: '+serverInfo.info.hyperion[0].version+'\n';
info += 'UI Lang: '+storedLang+'\n';
info += 'UI Access: '+storedAccess+'\n';
info += 'Avail Capt: '+serverInfo.info.grabbers.available+'\n\n';
//create prios //create prios
var info = "######## PRIORITIES ######## \n"; info += "######## PRIORITIES ######## \n";
for(var i = 0; i<prios.length; i++) for(var i = 0; i<prios.length; i++)
{ {
info += prios[i].priority; info += prios[i].priority;
@ -96,7 +105,8 @@ $(document).ready(function() {
} }
}) })
.fail( function( jqXHR, textStatus ) { .fail( function( jqXHR, textStatus ) {
//console.log(jqXHR, textStatus) $('#btn_logupload').attr("disabled", false);
$('#upl_link').html('<span style="color:red">'+$.i18n('conf_logging_uplfailed')+'<span>');
}); });
} }

View File

@ -4,6 +4,7 @@ $(document).ready(function() {
var oldEffects = []; var oldEffects = [];
var cpcolor = '#B500FF'; var cpcolor = '#B500FF';
var mappingList = serverSchema.properties.color.properties.imageToLedMappingType.enum; var mappingList = serverSchema.properties.color.properties.imageToLedMappingType.enum;
var duration = 0;
//create html //create html
createTable('ssthead', 'sstbody', 'sstcont'); createTable('ssthead', 'sstbody', 'sstcont');
@ -55,10 +56,11 @@ $(document).ready(function() {
if(sColor[key].key == "brightness" || sColor[key].key == "backlightThreshold") if(sColor[key].key == "brightness" || sColor[key].key == "backlightThreshold")
property = '<input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0.0" max="1.0" step="0.05" value="'+value+'"/>'; property = '<input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0.0" max="1.0" step="0.05" value="'+value+'"/>';
else else
property = '<input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0.0" max="4.0" step="0.1" value="'+value+'"/>'; property = '<input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0.01" max="4.0" step="0.1" value="'+value+'"/>';
$('.crtbody').append(createTableRow([title, property], false, true)); $('.crtbody').append(createTableRow([title, property], false, true));
$('#cr_'+sColor[key].key).off().on('change', function(e){ $('#cr_'+sColor[key].key).off().on('change', function(e){
valValue(this.id,this.value,this.min,this.max);
requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.value); requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.value);
}); });
} }
@ -86,9 +88,10 @@ $(document).ready(function() {
var data = ""; var data = "";
var prios = serverInfo.info.priorities var prios = serverInfo.info.priorities
var i; var i;
for(i = 0; i < prios.length; i++) for(i = 0; i < prios.length; i++)
{ {
var origin = "not impl"; var origin = prios[i].origin;
var ip = "xxx.xxx.xxx.xxx"; var ip = "xxx.xxx.xxx.xxx";
var owner = prios[i].owner; var owner = prios[i].owner;
var active = prios[i].active; var active = prios[i].active;
@ -219,8 +222,14 @@ $(document).ready(function() {
if (getStorage('rmcpcolor') != null) if (getStorage('rmcpcolor') != null)
cpcolor = getStorage('rmcpcolor'); cpcolor = getStorage('rmcpcolor');
if (getStorage('rmduration') != null)
{
$("#remote_duration").val(getStorage('rmduration'));
duration = getStorage('rmduration');
}
createCP('cp2', cpcolor, function(rgb,hex){ createCP('cp2', cpcolor, function(rgb,hex){
requestSetColor(rgb.r, rgb.g, rgb.b); requestSetColor(rgb.r, rgb.g, rgb.b,duration);
$("#effect_select").val("__none__"); $("#effect_select").val("__none__");
setStorage('rmcpcolor', hex); setStorage('rmcpcolor', hex);
}); });
@ -230,17 +239,29 @@ $(document).ready(function() {
$("#effect_select").val("__none__"); $("#effect_select").val("__none__");
}); });
$("#remote_duration").off().on("change", function(){
duration = valValue(this.id,this.value,this.min,this.max);
setStorage('rmduration', duration);
});
$("#effect_select").off().on("change", function(event) { $("#effect_select").off().on("change", function(event) {
efx = $(this).val(); efx = $(this).val();
if(efx != "__none__") if(efx != "__none__")
{ {
requestPriorityClear(); requestPriorityClear();
$(hyperion).one("cmd-clear", function(event) { $(hyperion).one("cmd-clear", function(event) {
setTimeout(function() {requestPlayEffect(efx)}, 100); setTimeout(function() {requestPlayEffect(efx,duration)}, 100);
}); });
} }
}); });
$("#remote_input_img").change(function(){
readImg(this, function(src,width,height){
console.log(src,width,height)
requestSetImage(src,width,height,duration)
});
});
//force first update //force first update
updateRemote(); updateRemote();

View File

@ -1,6 +1,7 @@
// global vars // global vars
var webPrio = 1; var webPrio = 1;
var webOrigin = "Web Configuration";
var showOptHelp; var showOptHelp;
var currentVersion; var currentVersion;
var latestVersion; var latestVersion;
@ -217,14 +218,34 @@ function requestPriorityClear(prio)
sendToHyperion("clear", "", '"priority":'+prio+''); sendToHyperion("clear", "", '"priority":'+prio+'');
} }
function requestPlayEffect(effectName) function requestPlayEffect(effectName, duration)
{ {
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+''); if(typeof duration === "undefined" || duration < 0)
duration = 0;
else
duration *= 1000;
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+',"duration":'+duration+',"origin":"'+webOrigin+'"');
} }
function requestSetColor(r,g,b) function requestSetColor(r,g,b,duration)
{ {
sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+webPrio+''); if(typeof duration === "undefined" || duration < 0)
duration = 0;
else
duration *= 1000;
sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+webPrio+',"duration":'+duration+',"origin":"'+webOrigin+'"');
}
function requestSetImage(data,width,height,duration)
{
if(typeof duration === "undefined" || duration < 0)
duration = 0;
else
duration *= 1000;
sendToHyperion("image", "", '"imagedata":"'+data+'", "imagewidth":'+width+',"imageheight":'+height+', "priority":'+webPrio+',"duration":'+duration+'');
} }
function requestSetComponentState(comp, state) function requestSetComponentState(comp, state)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,126 +0,0 @@
/**
* jQuery Lined Textarea Plugin
* http://alan.blog-city.com/jquerylinedtextarea.htm
*
* Copyright (c) 2010 Alan Williamson
*
* Version:
* $Id: jquery-linedtextarea.js 464 2010-01-08 10:36:33Z alan $
*
* Released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* Usage:
* Displays a line number count column to the left of the textarea
*
* Class up your textarea with a given class, or target it directly
* with JQuery Selectors
*
* $(".lined").linedtextarea({
* selectedLine: 10,
* selectedClass: 'lineselect'
* });
*
* History:
* - 2010.01.08: Fixed a Google Chrome layout problem
* - 2010.01.07: Refactored code for speed/readability; Fixed horizontal sizing
* - 2010.01.06: Initial Release
*
*/
(function($) {
$.fn.linedtextarea = function(options) {
// Get the Options
var opts = $.extend({}, $.fn.linedtextarea.defaults, options);
/*
* Helper function to make sure the line numbers are always
* kept up to the current system
*/
var fillOutLines = function(codeLines, h, lineNo){
while ( (codeLines.height() - h ) <= 0 ){
if ( lineNo == opts.selectedLine )
codeLines.append("<div class='lineno lineselect'>" + lineNo + "</div>");
else
codeLines.append("<div class='lineno'>" + lineNo + "</div>");
lineNo++;
}
return lineNo;
};
/*
* Iterate through each of the elements are to be applied to
*/
return this.each(function() {
var lineNo = 1;
var textarea = $(this);
/* Turn off the wrapping of as we don't want to screw up the line numbers */
textarea.attr("wrap", "off");
textarea.css({resize:'none'});
var originalTextAreaWidth = textarea.outerWidth();
/* Wrap the text area in the elements we need */
textarea.wrap("<div class='linedtextarea'></div>");
var linedTextAreaDiv = textarea.parent().wrap("<div class='linedwrap' style='width:" + originalTextAreaWidth + "px'></div>");
var linedWrapDiv = linedTextAreaDiv.parent();
linedWrapDiv.prepend("<div class='lines' style='width:50px'></div>");
var linesDiv = linedWrapDiv.find(".lines");
linesDiv.height( textarea.height() + 6 );
/* Draw the number bar; filling it out where necessary */
linesDiv.append( "<div class='codelines'></div>" );
var codeLinesDiv = linesDiv.find(".codelines");
lineNo = fillOutLines( codeLinesDiv, linesDiv.height(), 1 );
/* Move the textarea to the selected line */
if ( opts.selectedLine != -1 && !isNaN(opts.selectedLine) ){
var fontSize = parseInt( textarea.height() / (lineNo-2) );
var position = parseInt( fontSize * opts.selectedLine ) - (textarea.height()/2);
textarea[0].scrollTop = position;
}
/* Set the width */
var sidebarWidth = linesDiv.outerWidth();
var paddingHorizontal = parseInt( linedWrapDiv.css("border-left-width") ) + parseInt( linedWrapDiv.css("border-right-width") ) + parseInt( linedWrapDiv.css("padding-left") ) + parseInt( linedWrapDiv.css("padding-right") );
var linedWrapDivNewWidth = originalTextAreaWidth - paddingHorizontal;
var textareaNewWidth = originalTextAreaWidth - sidebarWidth - paddingHorizontal - 20;
textarea.width( textareaNewWidth );
linedWrapDiv.width( linedWrapDivNewWidth );
/* React to the scroll event */
textarea.scroll( function(tn){
var domTextArea = $(this)[0];
var scrollTop = domTextArea.scrollTop;
var clientHeight = domTextArea.clientHeight;
codeLinesDiv.css( {'margin-top': (-1*scrollTop) + "px"} );
lineNo = fillOutLines( codeLinesDiv, scrollTop + clientHeight, lineNo );
});
/* Should the textarea get resized outside of our control */
textarea.resize( function(tn){
var domTextArea = $(this)[0];
linesDiv.height( domTextArea.clientHeight + 6 );
});
});
};
// default options
$.fn.linedtextarea.defaults = {
selectedLine: -1,
selectedClass: 'lineselect'
};
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,8 @@ $(function() {
}); });
var oldWidth; var mInit = false;
//Loads the correct sidebar on window load, //Loads the correct sidebar on window load,
//collapses the sidebar on window resize. //collapses the sidebar on window resize.
// Sets the min-height of #page-wrapper to window size // Sets the min-height of #page-wrapper to window size
@ -13,21 +14,26 @@ $(function() {
$(window).bind("load resize", function() { $(window).bind("load resize", function() {
var topOffset = 50; var topOffset = 50;
var width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width; var width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
if(oldWidth != width)
{
if (width < 768) if (width < 768)
{ {
if(!mInit)
{
mInit = true;
$('#main-nav').css({"position":"fixed","right":"-235px","top":"45px","width":"230px","border":"1px solid rgba(0, 0, 0, .2)","box-shadow":"0 3px 9px rgba(0, 0, 0, .5)"}); $('#main-nav').css({"position":"fixed","right":"-235px","top":"45px","width":"230px","border":"1px solid rgba(0, 0, 0, .2)","box-shadow":"0 3px 9px rgba(0, 0, 0, .5)"});
topOffset = 100; // 2-row-menu topOffset = 100; // 2-row-menu
$('.mnava').on('click', function(){
$("html, body").animate({ scrollTop: 0 }, "fast"); $('.mnava').bind('click.smnav', function(){
$( "#main-nav" ).animate({right: "-235px",}, 300 ); $( "#main-nav" ).animate({right: "-235px",}, 300 );
$(".navbar-toggle").addClass("closed"); $(".navbar-toggle").addClass("closed");
}); });
} }
}
else else
$( "#main-nav" ).removeAttr("style").css({"position":"absolute"}); {
$( "#main-nav" ).removeAttr('style').css({"position":"fixed"});
$( ".mnava" ).unbind('click.smnav');
mInit = false;
}
var height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1; var height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
height = height - topOffset; height = height - topOffset;
@ -35,7 +41,6 @@ $(function() {
if (height > topOffset) { if (height > topOffset) {
$("#page-wrapper").css("min-height", (height-11) + "px"); $("#page-wrapper").css("min-height", (height-11) + "px");
} }
}
}); });
var url = window.location; var url = window.location;
@ -55,7 +60,7 @@ $(function() {
} }
}); });
$('.navbar-toggle').off().on('click', function(){ $('.navbar-toggle').on('click', function(){
if($('#main-nav').css("right") != "-2px") if($('#main-nav').css("right") != "-2px")
{ {
$('#main-nav').animate({right: "-2px",}, 300 ); $('#main-nav').animate({right: "-2px",}, 300 );

File diff suppressed because it is too large Load Diff

View File

@ -81,7 +81,7 @@ function loadContent(event)
$("#page-content").off(); $("#page-content").off();
$("#page-content").load("/content/"+tag+".html", function(response,status,xhr){ $("#page-content").load("/content/"+tag+".html", function(response,status,xhr){
if(status == "error") if(status == "error")
$("#page-content").html('<h3>The page you requested is no longer available, click on another menu item!</h3>'); $("#page-content").html('<h3>'+$.i18n('info_404')+'</h3>');
removeOverlay(); removeOverlay();
}); });
} }
@ -218,6 +218,39 @@ function createHint(type, text, container)
} }
} }
function valValue(id,value,min,max)
{
//TODO: Do not use parser, all values are now typeof number
value = parseInt(value)
if(typeof value === 'number')
{
if(typeof max === 'undefined' || max == "")
max = 999999;
if(value > max || value < min)
{
$('#'+id).val(min);
return min;
}
return value;
}
return value;
}
function readImg(input,cb)
{
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
var i = new Image();
i.src = e.target.result;
cb(i.src,i.width,i.height);
}
reader.readAsDataURL(input.files[0]);
}
}
function isJsonString(str) function isJsonString(str)
{ {
try try

View File

@ -191,8 +191,10 @@ public slots:
/// @param[in] priority The priority of the written colors /// @param[in] priority The priority of the written colors
/// @param[in] ledColors The colors to write to the leds /// @param[in] ledColors The colors to write to the leds
/// @param[in] timeout_ms The time the leds are set to the given colors [ms] /// @param[in] timeout_ms The time the leds are set to the given colors [ms]
/// @param[in] component The current component
/// @param[in] origin Who set it
/// ///
void setColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, bool clearEffects = true, hyperion::Components component=hyperion::COMP_INVALID); void setColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, bool clearEffects = true, hyperion::Components component=hyperion::COMP_INVALID, const QString origin="System");
/// ///
/// Writes the given colors to all leds for the given time and priority /// Writes the given colors to all leds for the given time and priority

View File

@ -33,7 +33,10 @@ public:
int64_t timeoutTime_ms; int64_t timeoutTime_ms;
/// The colors for each led of the channel /// The colors for each led of the channel
std::vector<ColorRgb> ledColors; std::vector<ColorRgb> ledColors;
/// The component
hyperion::Components componentId; hyperion::Components componentId;
/// Who set it
QString origin;
}; };
/// The lowest possible priority, which is used when no priority channels are active /// The lowest possible priority, which is used when no priority channels are active
@ -90,8 +93,10 @@ public:
/// @param[in] priority The priority of the channel /// @param[in] priority The priority of the channel
/// @param[in] ledColors The led colors of the priority channel /// @param[in] ledColors The led colors of the priority channel
/// @param[in] timeoutTime_ms The absolute timeout time of the channel /// @param[in] timeoutTime_ms The absolute timeout time of the channel
/// @param[in] component The component of the channel
/// @param[in] origin Who set the channel
/// ///
void setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int64_t timeoutTime_ms=-1, hyperion::Components component=hyperion::COMP_INVALID); void setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int64_t timeoutTime_ms=-1, hyperion::Components component=hyperion::COMP_INVALID, const QString origin="System");
/// ///
/// Clears the specified priority channel /// Clears the specified priority channel

View File

@ -571,7 +571,7 @@ void Hyperion::setColor(int priority, const ColorRgb &color, const int timeout_m
setColors(priority, ledColors, timeout_ms, clearEffects, hyperion::COMP_COLOR); setColors(priority, ledColors, timeout_ms, clearEffects, hyperion::COMP_COLOR);
} }
void Hyperion::setColors(int priority, const std::vector<ColorRgb>& ledColors, const int timeout_ms, bool clearEffects, hyperion::Components component) void Hyperion::setColors(int priority, const std::vector<ColorRgb>& ledColors, const int timeout_ms, bool clearEffects, hyperion::Components component, const QString origin)
{ {
// clear effects if this call does not come from an effect // clear effects if this call does not come from an effect
if (clearEffects) if (clearEffects)
@ -582,11 +582,11 @@ void Hyperion::setColors(int priority, const std::vector<ColorRgb>& ledColors, c
if (timeout_ms > 0) if (timeout_ms > 0)
{ {
const uint64_t timeoutTime = QDateTime::currentMSecsSinceEpoch() + timeout_ms; const uint64_t timeoutTime = QDateTime::currentMSecsSinceEpoch() + timeout_ms;
_muxer.setInput(priority, ledColors, timeoutTime, component); _muxer.setInput(priority, ledColors, timeoutTime, component, origin);
} }
else else
{ {
_muxer.setInput(priority, ledColors, -1, component); _muxer.setInput(priority, ledColors, -1, component, origin);
} }
if (! _sourceAutoSelectEnabled || priority == _muxer.getCurrentPriority()) if (! _sourceAutoSelectEnabled || priority == _muxer.getCurrentPriority())

View File

@ -48,13 +48,14 @@ const PriorityMuxer::InputInfo& PriorityMuxer::getInputInfo(const int priority)
return elemIt.value(); return elemIt.value();
} }
void PriorityMuxer::setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int64_t timeoutTime_ms, hyperion::Components component) void PriorityMuxer::setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int64_t timeoutTime_ms, hyperion::Components component, const QString origin)
{ {
InputInfo& input = _activeInputs[priority]; InputInfo& input = _activeInputs[priority];
input.priority = priority; input.priority = priority;
input.timeoutTime_ms = timeoutTime_ms; input.timeoutTime_ms = timeoutTime_ms;
input.ledColors = ledColors; input.ledColors = ledColors;
input.componentId = component; input.componentId = component;
input.origin = origin;
_currentPriority = std::min(_currentPriority, priority); _currentPriority = std::min(_currentPriority, priority);
} }

View File

@ -649,7 +649,7 @@
"width" : "width" :
{ {
"type" : "integer", "type" : "integer",
"title" : "edt_conf_v4l2_width_title", "title" : "edt_conf_fg_width_title",
"minimum" : 10, "minimum" : 10,
"default" : 80, "default" : 80,
"append" : "edt_append_pixel", "append" : "edt_append_pixel",
@ -658,7 +658,7 @@
"height" : "height" :
{ {
"type" : "integer", "type" : "integer",
"title" : "edt_conf_v4l2_height_title", "title" : "edt_conf_fg_height_title",
"minimum" : 10, "minimum" : 10,
"default" : 45, "default" : 45,
"append" : "edt_append_pixel", "append" : "edt_append_pixel",

View File

@ -365,6 +365,7 @@ void JsonClientConnection::handleColorCommand(const QJsonObject& message, const
// extract parameters // extract parameters
int priority = message["priority"].toInt(); int priority = message["priority"].toInt();
int duration = message["duration"].toInt(-1); int duration = message["duration"].toInt(-1);
QString origin = message["origin"].toString();
std::vector<ColorRgb> colorData(_hyperion->getLedCount()); std::vector<ColorRgb> colorData(_hyperion->getLedCount());
const QJsonArray & jsonColor = message["color"].toArray(); const QJsonArray & jsonColor = message["color"].toArray();
@ -391,7 +392,7 @@ void JsonClientConnection::handleColorCommand(const QJsonObject& message, const
} }
// set output // set output
_hyperion->setColors(priority, colorData, duration, true, hyperion::COMP_COLOR); _hyperion->setColors(priority, colorData, duration, true, hyperion::COMP_COLOR, origin);
// send reply // send reply
sendSuccessReply(command, tan); sendSuccessReply(command, tan);
@ -598,6 +599,7 @@ void JsonClientConnection::handleServerInfoCommand(const QJsonObject&, const QSt
item["owner"] = QString(hyperion::componentToIdString(priorityInfo.componentId)); item["owner"] = QString(hyperion::componentToIdString(priorityInfo.componentId));
item["componentId"] = priorityInfo.componentId; item["componentId"] = priorityInfo.componentId;
item["origin"] = priorityInfo.origin;
item["component"] = QString(hyperion::componentToString(priorityInfo.componentId)); item["component"] = QString(hyperion::componentToString(priorityInfo.componentId));
item["active"] = true; item["active"] = true;
item["visible"] = (priority == currentPriority); item["visible"] = (priority == currentPriority);

View File

@ -20,6 +20,10 @@
"type": "integer", "type": "integer",
"required": false "required": false
}, },
"origin": {
"type": "string",
"required": true
},
"color": { "color": {
"type": "array", "type": "array",
"required": true, "required": true,

View File

@ -20,6 +20,10 @@
"type": "integer", "type": "integer",
"required": false "required": false
}, },
"origin": {
"type": "string",
"required": true
},
"effect": { "effect": {
"type": "object", "type": "object",
"required": true, "required": true,