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 += "<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 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 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>
<textarea rows="25" id="ledconfig" class="form-control"></textarea>
<div id="aceedit" style="width:100%;height:500px"></div>
</div>
<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>

View File

@ -1,22 +1,22 @@
<div class="container" style="margin:20px auto;max-width:600px;">
<center>
<img src="img/hyperion/hyperionlostconnection.png" alt="Redefine ambient light!">
<div>
<h2 data-i18n="info_conlost_label_title">Lost connection to Hyperion service!</h2>
<hr>
<h4 data-i18n="info_conlost_label_reason">Possible reasons:</h4>
<p data-i18n="info_conlost_label_reason1">- Hyperion restarts</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>
<hr>
<i class="fa fa-refresh fa-spin" style="font-size:50px"></i>
<h4 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>
<a href="/" data-i18n="info_conlost_label_reload">If not, click me or reload the page</a>
</div>
</center>
</div>
<div class="container" style="margin:20px auto;max-width:600px;">
<center>
<img src="img/hyperion/hyperionlostconnection.png" alt="Redefine ambient light!">
<div>
<h2 data-i18n="info_conlost_label_title">Lost connection to Hyperion service!</h2>
<hr>
<h4 data-i18n="info_conlost_label_reason">Possible reasons:</h4>
<p data-i18n="info_conlost_label_reason1">- Hyperion restarts</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>
<hr>
<i class="fa fa-refresh fa-spin reconstop" style="font-size:50px"></i>
<h4 class="reconstop" data-i18n="info_conlost_label_autorefresh">This page will be automatically refreshed.</h4>
<h4 class="reconstop" data-i18n="info_conlost_label_autorecon">We reconnect again after Hyperion is available.</h4>
<span id="counter" class="reconstop"></span>
<a class="reconstop" style="display:none" href="/" data-i18n="info_conlost_label_reload"></a>
</div>
</center>
</div>
<!-- ************************************ -->
@ -25,19 +25,36 @@
performTranslation();
var connectionLost = false;
var connectionTimer;
var count = 1;
function tryReconnect()
{
if(count > 100)
{
window.clearInterval(connectionTimer);
$('.reconstop').toggle();
}
$('#counter').html(count+'/100');
$.ajax({ url: "/" }).done(function(data) {
window.clearInterval(connectionTimer);
window.location.href ="/";
})
.fail( function( jqXHR, textStatus ) {
count++;
});
}
function connectionLostAction()
{
connectionLost = true;
connectionTimer = window.setInterval(tryReconnect, 4000);
if(!connectionLost)
{
window.clearInterval(cronId);
connectionLost = true;
connectionTimer = window.setInterval(tryReconnect, 4000);
}
}
</script>

View File

@ -14,20 +14,28 @@
<table class="table borderless">
<tbody>
<tr>
<td data-i18n="dashboard_infobox_label_currenthyp">Hyperion version:</td>
<td id="currentversion">unknown</td>
</tr>
<tr>
<td data-i18n="dashboard_infobox_label_latesthyp">Latest version:</td>
<td id="latestversion">unknown</td>
<td data-i18n="dashboard_infobox_label_platform">Platform:</td>
<td id="dash_platform"></td>
</tr>
<tr>
<td data-i18n="conf_leds_contr_label_contrtype">LED type:</td>
<td id="dash_leddevice">unknown</td>
<td id="dash_leddevice"></td>
</tr>
<tr>
<td data-i18n="dashboard_infobox_label_device">Device:</td>
<td id="dash_systeminfo"></td>
<td data-i18n="dashboard_infobox_label_instance">Instance</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>
</tbody>
</table>
@ -60,10 +68,11 @@
<div class="panel panel-default">
<div class="panel-heading">
<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 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>

View File

@ -40,16 +40,27 @@
<table class="table borderless">
<tbody>
<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">
<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>
</td>
</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>
</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>
</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>

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap Colorpicker v2.4.0
* Bootstrap Colorpicker v2.5.1
* https://itsjavi.com/bootstrap-colorpicker/
*
* 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 {
padding-bottom:50px;
}
body{
overflow-y: scroll;
}
.btn{margin: 2px 0;}
/*mobile nav*/
@ -85,6 +88,7 @@ table label{margin:0}
/*Dashboard*/
.component-on{color:green;}
.component-off{color:grey;}
#dash_news hr{margin:10px 0}
/*Colorpicker 2x*/
.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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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 name="description" content="">
<title data-i18n="general_webui_title">Hyperion - Error</title>
<title data-i18n="general_webui_title">Hyperion - Web Configuration</title>
<!-- jQuery -->
<script src="/js/lib/jquery.min.js"></script>
<script src="js/lib/jquery.min.js"></script>
<!-- Hyperion -->
<script src="/js/hyperion.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" />
<script src="js/hyperion.js"></script>
<script src="js/ui_utils.js"></script>
<!-- Colorpicker -->
<script src="/js/lib/bootstrap-colorpicker.min.js"></script>
<link href="/css/bootstrap-colorpicker.min.css" rel="stylesheet">
<script src="js/lib/bootstrap-colorpicker.min.js"></script>
<link href="css/bootstrap-colorpicker.min.css" rel="stylesheet">
<!-- JSONEditor -->
<script src="/js/lib/jsoneditor.js"></script>
<script src="js/lib/jsoneditor.js"></script>
<!--Language Support -->
<script src="/js/lib/jquery.i18n.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.parser.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.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.parser.js"></script>
<script src="js/lib/jquery.i18n.emitter.js"></script>
<script src="js/lib/jquery.i18n.language.js"></script>
<!-- Bootstrap Core CSS -->
<link href="/css/bootstrap.css" rel="stylesheet">
<!-- Flags -->
<link href="/css/flag-icon.min.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- MetisMenu CSS -->
<link href="/css/metisMenu.css" rel="stylesheet">
<link href="css/metisMenu.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="/css/sb-admin-2.css" rel="stylesheet">
<link href="/css/hyperion.css" rel="stylesheet">
<link href="css/sb-admin-2.css" rel="stylesheet">
<link href="css/hyperion.css" rel="stylesheet">
<!-- 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 -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
@ -87,16 +80,6 @@
<!-- /.navbar-header -->
<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">
<a>
<i class="fa fa-television fa-fw"></i>
@ -135,9 +118,32 @@
</a>
</li>
</ul>
<!-- /.dropdown-alerts -->
</li>
<!-- /.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>
<!-- /.navbar-top-left -->
@ -254,25 +260,29 @@
</div>
<!-- Bootstrap Core JavaScript -->
<script src="/js/lib/bootstrap.min.js"></script>
<script src="js/lib/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript -->
<script src="/js/lib/metisMenu.min.js"></script>
<script src="js/lib/metisMenu.min.js"></script>
<!-- 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/settings.js"></script>
<script src="/js/wizard.js"></script>
<script src="js/content_index.js"></script>
<script src="js/settings.js"></script>
<script src="js/wizard.js"></script>
<!--gijgo dialog-->
<script src="/js/lib/draggable.min.js"></script>
<script src="/js/lib/dialog.min.js"></script>
<script src="/js/ledsim.js"></script>
<script src="js/lib/draggable.min.js"></script>
<script src="js/lib/dialog.min.js"></script>
<script src="js/ledsim.js"></script>
<!--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>
</html>

View File

@ -1,6 +1,53 @@
$(document).ready( function() {
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()
{
var components = serverInfo.info.components;
@ -12,13 +59,11 @@ $(document).ready( function() {
$("#tab_components").html(components_html);
}
// get active led device
var leddevice = serverInfo.info.ledDevices.active;
$('#dash_leddevice').html(leddevice);
// get host
var hostname = serverInfo.info.hostname;
$('#dash_systeminfo').html(hostname+':'+jsonPort);
// add more info
$('#dash_leddevice').html(serverInfo.info.ledDevices.active);
$('#dash_currv').html(currentVersion);
$('#dash_instance').html(serverConfig.general.name);
$('#dash_ports').html(jsonPort+' | '+serverConfig.protoServer.port);
$.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/version.json", function( data ) {
parsedUpdateJSON = JSON.parse(data);
@ -26,8 +71,7 @@ $(document).ready( function() {
var cleanLatestVersion = latestVersion.replace(/\./g, '');
var cleanCurrentVersion = currentVersion.replace(/\./g, '');
$('#currentversion').html(currentVersion);
$('#latestversion').html(latestVersion);
$('#dash_latev').html(latestVersion);
if ( cleanCurrentVersion < cleanLatestVersion )
$('#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>');
});
//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
updateComponents();
$(hyperion).on("cmd-serverinfo",updateComponents);

View File

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

View File

@ -3,6 +3,14 @@ $(document).ready( function() {
var conf_editor_v4l2 = 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)
{
//fg
@ -55,6 +63,18 @@ $(document).ready( function() {
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();
});

View File

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

View File

@ -2,16 +2,6 @@
var ledsCustomCfgInitialized = false;
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) {
var factor = Math.pow(10, 4);
var tempNumber = number * factor;
@ -35,7 +25,7 @@ function createLedPreview(leds, origin){
}
$('#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");
@ -106,7 +96,7 @@ function createClassicLeds(){
}
function rotateArray(array, times){
if (times > "0"){
if (times > 0){
while( times-- ){
array.push(array.shift())
}
@ -366,35 +356,70 @@ $(document).ready(function() {
// bind change event to all inputs
$('.ledCLconstr').bind("change", function() {
valValue(this.id,this.value,this.min,this.max);
createClassicLeds();
});
$('.ledMAconstr').bind("change", function() {
valValue(this.id,this.value,this.min,this.max);
createMatrixLeds();
});
// cl leds push to textfield and save values
$('#btn_cl_generate').off().on("click", function() {
if (finalLedArray != ""){
$("#ledconfig").text(JSON.stringify(finalLedArray, null, "\t"));
$('#collapse1').collapse('hide');
$('#collapse4').collapse('show');
}
});
// ma leds push to textfield and save values
$('#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
$("#ledconfig").text(JSON.stringify(serverConfig.leds, null, "\t"));
// v4 of json schema with diff required assignment - remove when hyperion schema moved to v4
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"}
//create jsonace editor
var aceEdt = new JSONACEEditor(document.getElementById("aceedit"),{
mode: 'code',
schema: ledschema,
onChange: function(){
var success = true;
try{
aceEdt.get();
}
catch(err)
{
success = false;
}
if(success)
{
$('#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;
// 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
var conf_editor = null;
$("#leddevices").off().on("change", function() {
@ -471,9 +496,7 @@ $(document).ready(function() {
// validate textfield and update preview
$("#leds_custom_updsim").off().on("click", function() {
if (validateText()){
createLedPreview(JSON.parse($("#ledconfig").val()), 'text');
}
createLedPreview(aceEdt.get(), 'text');
});
// save led config and saveValues - passing textfield
@ -482,13 +505,10 @@ $(document).ready(function() {
saveValues();
});
// validate and save led config from textfield
// save led config from textfield
$("#leds_custom_save").off().on("click", function() {
if (validateText())
{
requestWriteConfig(JSON.parse('{"leds" :'+$("#ledconfig").val()+'}'));
saveValues();
}
requestWriteConfig(JSON.parse('{"leds" :'+aceEdt.getText()+'}'));
saveValues();
});
// toggle led numbers

View File

@ -25,7 +25,7 @@ $(document).ready(function() {
$('#btn_submit').off().on('click',function() {
requestWriteConfig(conf_editor.getValue());
});
function uploadLog()
{
var reportUrl = 'https://glot.io/snippets/';
@ -33,6 +33,7 @@ $(document).ready(function() {
var config = JSON.stringify(serverConfig, null, "\t").replace(/"/g, '\\"');
var prios = serverInfo.info.priorities;
var comps = serverInfo.info.components;
var info;
//create log
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";
}
//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
var info = "######## PRIORITIES ######## \n";
info += "######## PRIORITIES ######## \n";
for(var i = 0; i<prios.length; i++)
{
info += prios[i].priority;
@ -96,7 +105,8 @@ $(document).ready(function() {
}
})
.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,7 +4,8 @@ $(document).ready(function() {
var oldEffects = [];
var cpcolor = '#B500FF';
var mappingList = serverSchema.properties.color.properties.imageToLedMappingType.enum;
var duration = 0;
//create html
createTable('ssthead', 'sstbody', 'sstcont');
$('.ssthead').html(createTableRow([$.i18n('remote_input_origin'), $.i18n('remote_input_owner'), $.i18n('remote_input_priority'), $.i18n('remote_input_status')], true, true));
@ -55,10 +56,11 @@ $(document).ready(function() {
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+'"/>';
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));
$('#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);
});
}
@ -86,9 +88,10 @@ $(document).ready(function() {
var data = "";
var prios = serverInfo.info.priorities
var i;
for(i = 0; i < prios.length; i++)
{
var origin = "not impl";
var origin = prios[i].origin;
var ip = "xxx.xxx.xxx.xxx";
var owner = prios[i].owner;
var active = prios[i].active;
@ -218,9 +221,15 @@ $(document).ready(function() {
// colorpicker and effect
if (getStorage('rmcpcolor') != null)
cpcolor = getStorage('rmcpcolor');
if (getStorage('rmduration') != null)
{
$("#remote_duration").val(getStorage('rmduration'));
duration = getStorage('rmduration');
}
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__");
setStorage('rmcpcolor', hex);
});
@ -229,6 +238,11 @@ $(document).ready(function() {
requestPriorityClear();
$("#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) {
efx = $(this).val();
@ -236,11 +250,18 @@ $(document).ready(function() {
{
requestPriorityClear();
$(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
updateRemote();

View File

@ -1,6 +1,7 @@
// global vars
var webPrio = 1;
var webOrigin = "Web Configuration";
var showOptHelp;
var currentVersion;
var latestVersion;
@ -217,14 +218,34 @@ function requestPriorityClear(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)

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,
//collapses the sidebar on window resize.
// Sets the min-height of #page-wrapper to window size
@ -13,28 +14,32 @@ $(function() {
$(window).bind("load resize", function() {
var topOffset = 50;
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)"});
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 );
$(".navbar-toggle").addClass("closed");
});
}
else
$( "#main-nav" ).removeAttr("style").css({"position":"absolute"});
}
else
{
$( "#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;
height = height - topOffset;
if (height < 1) height = 1;
if (height > topOffset) {
$("#page-wrapper").css("min-height", (height-11) + "px");
}
var height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
height = height - topOffset;
if (height < 1) height = 1;
if (height > topOffset) {
$("#page-wrapper").css("min-height", (height-11) + "px");
}
});
@ -55,7 +60,7 @@ $(function() {
}
});
$('.navbar-toggle').off().on('click', function(){
$('.navbar-toggle').on('click', function(){
if($('#main-nav').css("right") != "-2px")
{
$('#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").load("/content/"+tag+".html", function(response,status,xhr){
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();
});
}
@ -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)
{
try

View File

@ -191,8 +191,10 @@ public slots:
/// @param[in] priority The priority of the written colors
/// @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] 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

View File

@ -33,7 +33,10 @@ public:
int64_t timeoutTime_ms;
/// The colors for each led of the channel
std::vector<ColorRgb> ledColors;
/// The component
hyperion::Components componentId;
/// Who set it
QString origin;
};
/// 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] ledColors The led colors of the priority 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

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);
}
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
if (clearEffects)
@ -582,11 +582,11 @@ void Hyperion::setColors(int priority, const std::vector<ColorRgb>& ledColors, c
if (timeout_ms > 0)
{
const uint64_t timeoutTime = QDateTime::currentMSecsSinceEpoch() + timeout_ms;
_muxer.setInput(priority, ledColors, timeoutTime, component);
_muxer.setInput(priority, ledColors, timeoutTime, component, origin);
}
else
{
_muxer.setInput(priority, ledColors, -1, component);
_muxer.setInput(priority, ledColors, -1, component, origin);
}
if (! _sourceAutoSelectEnabled || priority == _muxer.getCurrentPriority())

View File

@ -48,13 +48,14 @@ const PriorityMuxer::InputInfo& PriorityMuxer::getInputInfo(const int priority)
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];
input.priority = priority;
input.timeoutTime_ms = timeoutTime_ms;
input.ledColors = ledColors;
input.componentId = component;
input.origin = origin;
_currentPriority = std::min(_currentPriority, priority);
}

View File

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

View File

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

View File

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

View File

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