Dynamic Device Selection/Configuration (#1164)

This commit is contained in:
LordGrey
2021-04-24 19:37:29 +02:00
committed by GitHub
parent a4d98fd916
commit 7eeb740177
48 changed files with 4296 additions and 2567 deletions

View File

@@ -1,374 +1,382 @@
<!DOCTYPE html>
<html>
<head>
<title>Hyperion - LED Device Configuration</title>
</head>
<div class="container-fluid">
<h3 class="page-header"><i class="fa fa-lightbulb-o fa-fw"></i><span data-i18n="main_menu_leds_conf_token">LED Hardware</span></h3>
<ul id="leds_cfg_nav" class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#menu_controller" data-i18n="conf_leds_nav_label_ledcontroller">LED Controller</a></li>
<li><a data-toggle="tab" href="#menu_gencfg" data-i18n="conf_leds_nav_label_ledlayout">LED Layout</a></li>
</ul>
<h3 class="page-header"><i class="fa fa-lightbulb-o fa-fw"></i><span data-i18n="main_menu_leds_conf_token">LED Hardware</span></h3>
<ul id="leds_cfg_nav" class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#menu_controller" data-i18n="conf_leds_nav_label_ledcontroller">LED Controller</a></li>
<li><a data-toggle="tab" href="#menu_gencfg" data-i18n="conf_leds_nav_label_ledlayout">LED Layout</a></li>
</ul>
<div class="tab-content">
<div class="tab-content">
<div id="menu_controller" class="tab-pane fade in active" style="padding-top:10px">
<div class="row">
<div class="col-lg-12" id="leddevice_intro"></div>
<div class="col-lg-6">
<div class="panel panel-default">
<div class="panel-heading form-group">
<label for="leddevices" class="panel-title" data-i18n="conf_leds_contr_label_contrtype">Controller type:</label>
<select id="leddevices" class="form-control" style="color:black;width:auto;margin-left:10px;display:inline-block"></select>
</div>
<div id="menu_controller" class="tab-pane fade in active" style="padding-top:10px">
<div class="row">
<div class="col-lg-12" id="leddevice_intro"></div>
<div class="col-lg-6">
<div class="panel panel-default">
<div class="panel-heading form-group">
<label for="leddevices" class="panel-title" data-i18n="conf_leds_contr_label_contrtype">Controller type:</label>
<select id="leddevices" class="form-control" style="color:black;width:auto;margin-left:10px;display:inline-block" />
</div>
<div class="panel-body">
<div id="btn_wiz_holder"></div>
<div id='editor_container_leddevice'></div>
<div class="bs-callout bs-callout-info" style="margin-top:0px"><h4 data-i18n="dashboard_infobox_label_title">Information</h4><span data-i18n="conf_leds_device_info_log"> In case your LEDs do not work, check here for errors: </span> <a onclick="SwitchToMenuItem('MenuItemLogging')" href="#" data-i18n="main_menu_logging_token"></a></div>
</div>
<div class="panel-footer" style="text-align:right">
<button id='btn_test_controller' class="btn btn-primary hidden" disabled data-toggle="tooltip" data-placement="top" title="Identify configured device by lighting it up">
<i class="fa fa-fw fa-save"></i><span data-i18n="wiz_identify">Identify/Test</span>
</button>
<button id='btn_submit_controller' class="btn btn-primary" data-toggle="tooltip" data-placement="top" title="Save the device's connectivity configuration">
<i class="fa fa-fw fa-save"></i><span data-i18n="general_button_savesettings">Save Settings</span>
</button>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body">
<div id="btn_wiz_holder"></div>
<div id="ledDeviceOptions"> <div id='editor_container'></div> </div>
</div>
<div class="panel-footer" style="text-align:right">
<button id='btn_submit_controller' class="btn btn-primary"><i class="fa fa-fw fa-save" /><span data-i18n="general_button_savesettings">Save Settings</span></button>
</div>
</div>
</div>
</div>
</div>
<div id="menu_gencfg" class="tab-pane fade" style="padding-top:10px">
<div id="menu_gencfg" class="tab-pane fade" style="padding-top:10px">
<div class="row">
<div class="col-lg-12" id="layout_intro"></div>
<div class="col-lg-6 col-md-12">
<div class="panel-group" id="accordion">
<div class="panel panel-primary">
<div class="panel-heading headcollapse" data-toggle="collapse" data-parent="#accordion" data-target="#collapse1">
<h4 class="panel-title">
<a><i class="fa fa-television fa-fw"></i><span data-i18n="conf_leds_layout_frame">Classic Layout (LED Frame)</span></a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse in">
<div class="panel-body">
<table class="table borderless">
<tbody>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_top" data-i18n="conf_leds_layout_cl_top">Top</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr " id="ip_cl_top" type="number" value="1" min="0" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_bottom" data-i18n="conf_leds_layout_cl_bottom">Bottom</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_bottom" type="number" value="0" min="0" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_left" data-i18n="conf_leds_layout_cl_left">Left</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_left" type="number" value="0" min="0" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_right" data-i18n="conf_leds_layout_cl_right">Right</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_right" type="number" value="0" min="0" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_glength" data-i18n="conf_leds_layout_cl_gaglength">Gap length</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_glength" type="number" value="0" min="0" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_gpos" data-i18n="conf_leds_layout_cl_gappos">Gap position</label>
</td>
<td class="itd">
<input class="form-control ledCLconstr" id="ip_cl_gpos" type="number" value="0" min="0" step="1">
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_position" data-i18n="conf_leds_layout_cl_inppos">Input position</label>
</td>
<td class="itd">
<input class="form-control ledCLconstr" id="ip_cl_position" type="number" value="0" min="0" step="1">
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_reverse" data-i18n="conf_leds_layout_cl_reversdir">Reverse direction</label>
</td>
<td class="itd">
<div class="checkbox">
<input class="ledCLconstr" id="ip_cl_reverse" type="checkbox" value="false"></input>
<label></label>
</div>
</td>
</tr>
</tbody>
</table>
<div class="panel panel-default">
<div class="panel-heading headcollapse" data-toggle="collapse" data-target="#collapse3">
<h4 class="panel-title">
<a><span data-i18n="conf_leds_layout_advanced">Advanced settings</span></a>
</h4>
</div>
<div id="collapse3" class="panel-collapse collapse">
<div class="panel-body ">
<table class="tableform borderless">
<tbody>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_hdepth" data-i18n="conf_leds_layout_cl_hleddepth">Horizontal LED depth</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_hdepth" type="number" value="8" min="1" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_vdepth" data-i18n="conf_leds_layout_cl_vleddepth">Vertical LED depth</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_vdepth" type="number" value="5" min="1" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_overlap" data-i18n="conf_leds_layout_cl_overlap">Edge Gap</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_overlap" type="number" value="0" min="0" max="200" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_edgegap" data-i18n="conf_leds_layout_cl_edgegap">Edge Gap</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_edgegap" type="number" value="0" min="0" max="50" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_ptl" data-i18n="conf_leds_layout_ptl">Point Top Left</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_ptlh" type="number" value="0" min="0" max="40" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_h">%h</div>
</td>
</tr>
<tr>
<td class="ltd"></td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_ptlv" type="number" value="0" min="0" max="40" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_v">%v</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_ptr" data-i18n="conf_leds_layout_ptr">Point Top Right</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_ptrh" type="number" value="100" min="60" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_h">%</div>
</td>
</tr>
<tr>
<td class="ltd"></td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_ptrv" type="number" value="0" min="0" max="40" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_v">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_pbr" data-i18n="conf_leds_layout_pbr">Point Bottom Right</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_pbrh" type="number" value="100" min="60" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_h">%</div>
</td>
</tr>
<tr>
<td class="ltd"></td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_pbrv" type="number" value="100" min="60" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_v">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_pbl" data-i18n="conf_leds_layout_pbl">Point Bottom Left</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_pblh" type="number" value="0" min="0" max="40" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_h">%</div>
</td>
</tr>
<tr>
<td class="ltd"></td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_pblv" type="number" value="100" min="60" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_v">%</div>
</td>
</tr>
<!-- <tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_cornergap" data-i18n="conf_leds_layout_cl_cornergap">Corner Gap</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr " id="ip_cl_cornergap" type="number" value="0" min="0" max="50" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent">%</div>
</td>
</tr>
-->
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="panel-footer" style="text-align:right;">
<button id="btn_cl_save" class="btn btn-primary"><i class="fa fa-fw fa-save"></i><span data-i18n="conf_leds_layout_button_savelay">Save layout</span></button>
</div>
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading headcollapse" data-toggle="collapse" data-parent="#accordion" data-target="#collapse2">
<h4 class="panel-title">
<a><i class="fa fa-th fa-fw"></i><span data-i18n="conf_leds_layout_matrix">Matrix Configuration (LED wall)</span></a>
</h4>
</div>
<div id="collapse2" class="panel-collapse collapse">
<div class="panel-body">
<table>
<tbody>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_ma_ledshoriz" data-i18n="conf_leds_layout_ma_horiz">Horizontal</label>
</td>
<td class="itd input-group">
<input class="form-control ledMAconstr" id="ip_ma_ledshoriz" type="number" value="1" min="1" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_ma_ledsvert" data-i18n="conf_leds_layout_ma_vert">Vertical</label>
</td>
<td class="itd input-group">
<input class="form-control ledMAconstr" id="ip_ma_ledsvert" type="number" value="1" min="1" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_ma_cabling" data-i18n="conf_leds_layout_ma_cabling">Cabling</label>
</td>
<td class="itd">
<select class="form-control ledMAconstr" id="ip_ma_cabling">
<option value="snake" data-i18n="conf_leds_layout_ma_optsnake">Snake</option>
<option value="parallel" data-i18n="conf_leds_layout_ma_optparallel">Parallel</option>
</select>
</td>
</tr>
<!--- <tr>
<td class="ltd">
<label class="ltdlabel" for="ip_ma_order" data-i18n="conf_leds_layout_ma_order">Order</label>
</td>
<td class="itd">
<select class="form-control ledMAconstr" id="ip_ma_order">
<option value="horizontal" data-i18n="conf_leds_layout_ma_opthoriz">Horizontal</option>
<option value="vertical" data-i18n="conf_leds_layout_ma_optvert">Vertical</option>
</select>
</td>
</tr>
--->
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_ma_start" data-i18n="conf_leds_layout_ma_position">Input</label>
</td>
<td class="itd">
<select class="form-control ledMAconstr" id="ip_ma_start">
<option value="top-left" data-i18n="conf_leds_layout_ma_opttopleft">Top left</option>
<option value="top-right" data-i18n="conf_leds_layout_ma_opttopright">Top right</option>
<option value="bottom-left" data-i18n="conf_leds_layout_ma_optbottomleft">Bottom left</option>
<option value="bottom-right" data-i18n="conf_leds_layout_ma_optbottomright">Bottom right</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel-footer" style="text-align:right;">
<button id="btn_ma_save" class="btn btn-primary"><i class="fa fa-fw fa-save"></i><span data-i18n="conf_leds_layout_button_savelay">Save layout</span></button>
</div>
</div>
</div>
<div id="texfield_panel" class="panel panel-primary">
<div class="panel-heading headcollapse" data-toggle="collapse" data-parent="#accordion" data-target="#collapse4">
<h4 class="panel-title">
<a><i class="fa fa-wrench fa-fw"></i><span data-i18n="conf_leds_layout_generatedconf">Generated/Actual LED Configuration</span></a>
</h4>
</div>
<div id="collapse4" class="panel-collapse collapse">
<div class="panel-body">
<p id="leds_wl" 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>
<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>
<button type="button" class="btn btn-primary pull-right" id="leds_custom_save"><i class="fa fa-fw fa-save"></i><span data-i18n="conf_leds_layout_button_savelay">Save layout</span></button>
</div>
</div>
</div>
</div>
</div> <!-- accordion -->
<div class="col-lg-6 col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-search fa-fw"></i><span data-i18n="conf_leds_layout_peview">LED Layout preview</span></h4>
</div>
<div class="panel-body">
<p id="previewcreator" style="font-weight:bold"></p>
<p id="previewledcount" style="font-weight:bold"></p>
<p id="previewledpower" style="font-weight:bold"></p>
<div id="led_vis_help"></div>
<div class="col-lg-12 st_helper" style="padding-left:0px; padding-right:0px">
<div id="leds_preview"></div>
</div>
</div>
<div class="panel-footer">
<button type="button" class="btn btn-danger" id="leds_prev_toggle_num"><i class="fa fa-info fa-fw"></i><span data-i18n="main_ledsim_btn_togglelednumber">toggle led numbers</span></button>
<button type="button" class="btn btn-primary" id="leds_prev_checklist"><i class="fa fa-info-circle fa-fw"></i><span data-i18n="conf_leds_layout_btn_checklist">toggle led numbers</span></button>
</div>
</div>
</div>
</div>
</div> <!-- row layout -->
</div>
</div>
</div> <!-- tab content -->
<div class="row">
<div class="col-lg-12" id="layout_intro"></div>
<div class="col-lg-6 col-md-12">
<div class="panel-group" id="accordion">
<div class="panel panel-primary">
<div class="panel-heading headcollapse" id="classic_panel" data-toggle="collapse" data-parent="#accordion" data-target="#collapse1">
<h4 class="panel-title">
<a><i class="fa fa-television fa-fw"></i><span data-i18n="conf_leds_layout_frame">Classic Layout (LED Frame)</span></a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div class="panel-body">
<table class="table borderless">
<tbody>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_top" data-i18n="conf_leds_layout_cl_top">Top</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr " id="ip_cl_top" type="number" value="1" min="0" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_bottom" data-i18n="conf_leds_layout_cl_bottom">Bottom</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_bottom" type="number" value="0" min="0" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_left" data-i18n="conf_leds_layout_cl_left">Left</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_left" type="number" value="0" min="0" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_right" data-i18n="conf_leds_layout_cl_right">Right</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_right" type="number" value="0" min="0" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_glength" data-i18n="conf_leds_layout_cl_gaglength">Gap length</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_glength" type="number" value="0" min="0" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_gpos" data-i18n="conf_leds_layout_cl_gappos">Gap position</label>
</td>
<td class="itd">
<input class="form-control ledCLconstr" id="ip_cl_gpos" type="number" value="0" min="0" step="1">
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_position" data-i18n="conf_leds_layout_cl_inppos">Input position</label>
</td>
<td class="itd">
<input class="form-control ledCLconstr" id="ip_cl_position" type="number" value="0" min="0" step="1">
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_reverse" data-i18n="conf_leds_layout_cl_reversdir">Reverse direction</label>
</td>
<td class="itd">
<div class="checkbox">
<input class="ledCLconstr" id="ip_cl_reverse" type="checkbox" value="false"></input>
<label></label>
</div>
</td>
</tr>
</tbody>
</table>
<div class="panel panel-default">
<div class="panel-heading headcollapse" data-toggle="collapse" data-target="#collapse3">
<h4 class="panel-title">
<a><span data-i18n="conf_leds_layout_advanced">Advanced settings</span></a>
</h4>
</div>
<div id="collapse3" class="panel-collapse collapse">
<div class="panel-body ">
<table class="tableform borderless">
<tbody>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_hdepth" data-i18n="conf_leds_layout_cl_hleddepth">Horizontal LED depth</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_hdepth" type="number" value="8" min="1" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_vdepth" data-i18n="conf_leds_layout_cl_vleddepth">Vertical LED depth</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_vdepth" type="number" value="5" min="1" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_overlap" data-i18n="conf_leds_layout_cl_overlap">Edge Gap</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_overlap" type="number" value="0" min="0" max="200" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_edgegap" data-i18n="conf_leds_layout_cl_edgegap">Edge Gap</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_edgegap" type="number" value="0" min="0" max="50" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_ptl" data-i18n="conf_leds_layout_ptl">Point Top Left</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_ptlh" type="number" value="0" min="0" max="40" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_h">%h</div>
</td>
</tr>
<tr>
<td class="ltd"></td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_ptlv" type="number" value="0" min="0" max="40" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_v">%v</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_ptr" data-i18n="conf_leds_layout_ptr">Point Top Right</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_ptrh" type="number" value="100" min="60" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_h">%</div>
</td>
</tr>
<tr>
<td class="ltd"></td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_ptrv" type="number" value="0" min="0" max="40" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_v">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_pbr" data-i18n="conf_leds_layout_pbr">Point Bottom Right</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_pbrh" type="number" value="100" min="60" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_h">%</div>
</td>
</tr>
<tr>
<td class="ltd"></td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_pbrv" type="number" value="100" min="60" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_v">%</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_pbl" data-i18n="conf_leds_layout_pbl">Point Bottom Left</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_pblh" type="number" value="0" min="0" max="40" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_h">%</div>
</td>
</tr>
<tr>
<td class="ltd"></td>
<td class="itd input-group">
<input class="form-control ledCLconstr" id="ip_cl_pblv" type="number" value="100" min="60" max="100" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent_v">%</div>
</td>
</tr>
<!-- <tr>
<td class="ltd">
<label class="ltdlabel" for="ip_cl_cornergap" data-i18n="conf_leds_layout_cl_cornergap">Corner Gap</label>
</td>
<td class="itd input-group">
<input class="form-control ledCLconstr " id="ip_cl_cornergap" type="number" value="0" min="0" max="50" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_percent">%</div>
</td>
</tr>
-->
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="panel-footer" style="text-align:right;">
<button id="btn_cl_save" class="btn btn-primary"><i class="fa fa-fw fa-save"></i><span data-i18n="conf_leds_layout_button_savelay">Save layout</span></button>
</div>
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading headcollapse" id="matrix_panel" data-toggle="collapse" data-parent="#accordion" data-target="#collapse2">
<h4 class="panel-title">
<a><i class="fa fa-th fa-fw"></i><span data-i18n="conf_leds_layout_matrix">Matrix Configuration (LED wall)</span></a>
</h4>
</div>
<div id="collapse2" class="panel-collapse collapse">
<div class="panel-body">
<table>
<tbody>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_ma_ledshoriz" data-i18n="conf_leds_layout_ma_horiz">Horizontal</label>
</td>
<td class="itd input-group">
<input class="form-control ledMAconstr" id="ip_ma_ledshoriz" type="number" value="1" min="1" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_ma_ledsvert" data-i18n="conf_leds_layout_ma_vert">Vertical</label>
</td>
<td class="itd input-group">
<input class="form-control ledMAconstr" id="ip_ma_ledsvert" type="number" value="1" min="1" step="1"></input>
<div class="input-group-addon" data-i18n="edt_append_leds">LEDs</div>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_ma_cabling" data-i18n="conf_leds_layout_ma_cabling">Cabling</label>
</td>
<td class="itd">
<select class="form-control ledMAconstr" id="ip_ma_cabling">
<option value="snake" data-i18n="conf_leds_layout_ma_optsnake">Snake</option>
<option value="parallel" data-i18n="conf_leds_layout_ma_optparallel">Parallel</option>
</select>
</td>
</tr>
<tr>
<td class="ltd">
<label class="ltdlabel" for="ip_ma_start" data-i18n="conf_leds_layout_ma_position">Input</label>
</td>
<td class="itd">
<select class="form-control ledMAconstr" id="ip_ma_start">
<option value="top-left" data-i18n="conf_leds_layout_ma_opttopleft">Top left</option>
<option value="top-right" data-i18n="conf_leds_layout_ma_opttopright">Top right</option>
<option value="bottom-left" data-i18n="conf_leds_layout_ma_optbottomleft">Bottom left</option>
<option value="bottom-right" data-i18n="conf_leds_layout_ma_optbottomright">Bottom right</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel-footer" style="text-align:right;">
<button id="btn_ma_save" class="btn btn-primary"><i class="fa fa-fw fa-save"></i><span data-i18n="conf_leds_layout_button_savelay">Save layout</span></button>
</div>
</div>
</div>
<div id="blacklist_panel" class="panel panel-primary">
<div class="panel-heading headcollapse" id="blacklist_config_panel" data-toggle="collapse" data-parent="#accordion" data-target="#collapse4">
<h4 class="panel-title">
<a><i class="fa fa-ban fa-fw"></i><span data-i18n="conf_leds_layout_blacklistleds_title">Blacklist LEDs</span></a>
</h4>
</div>
<div id="collapse4" class="panel-collapse collapse">
<div class="panel-body">
<div id="editor_container_blacklist_conf"></div>
</div>
<div class="panel-footer" style="text-align:right;">
<button id="btn_bl_save" class="btn btn-primary"><i class="fa fa-fw fa-save"></i><span data-i18n="conf_leds_layout_button_savelay">Save layout</span></button>
</div>
</div>
</div>
<div id="texfield_panel" class="panel panel-primary">
<div class="panel-heading headcollapse" id="current_config_panel" data-toggle="collapse" data-parent="#accordion" data-target="#collapse5">
<h4 class="panel-title">
<a><i class="fa fa-wrench fa-fw"></i><span data-i18n="conf_leds_layout_generatedconf">Generated/Actual LED Configuration</span></a>
</h4>
</div>
<div id="collapse5" class="panel-collapse collapse in">
<div class="panel-body">
<p id="leds_wl" 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>
<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>
<button type="button" class="btn btn-primary pull-right" id="leds_custom_save"><i class="fa fa-fw fa-save"></i><span data-i18n="conf_leds_layout_button_savelay">Save layout</span></button>
</div>
</div>
</div>
</div>
</div> <!-- accordion -->
<div class="col-lg-6 col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-search fa-fw"></i><span data-i18n="conf_leds_layout_peview">LED Layout preview</span></h4>
</div>
<div class="panel-body">
<p id="previewcreator" style="font-weight:bold"></p>
<p id="previewledcount" style="font-weight:bold"></p>
<p id="previewledpower" style="font-weight:bold"></p>
<div id="led_vis_help"></div>
<div class="col-lg-12 st_helper" style="padding-left:0px; padding-right:0px">
<div id="leds_preview"></div>
</div>
</div>
<div class="panel-footer">
<button type="button" class="btn btn-danger" id="leds_prev_toggle_num"><i class="fa fa-info fa-fw"></i><span data-i18n="main_ledsim_btn_togglelednumber">toggle led numbers</span></button>
<button type="button" class="btn btn-primary" id="leds_prev_checklist"><i class="fa fa-info-circle fa-fw"></i><span data-i18n="conf_leds_layout_btn_checklist">toggle led numbers</span></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="/js/content_leds.js"></script>

View File

@@ -1,15 +1,4 @@
{
"InfoDialog_access_text": "Depending on settings level you could adjust more options or get access to more features. Recommended is the \"Default\" level.",
"InfoDialog_access_title": "Settings level",
"InfoDialog_changePassword_success": "Password successfully saved!",
"InfoDialog_changePassword_title": "Change Password",
"InfoDialog_iswitch_text": "If you run Hyperion more than once in your local network, you could switch between the web configurations. Select the Hyperion instance below and switch!",
"InfoDialog_iswitch_title": "Hyperion switcher",
"InfoDialog_lang_text": "If you don't like the result of the automatic language detection you could overwrite it here.",
"InfoDialog_lang_title": "Language setting",
"InfoDialog_nowrite_foottext": "The WebUI will be unlocked automatically after you solved the problem!",
"InfoDialog_nowrite_text": "Hyperion can't write to your current loaded configuration file. Please repair the file permissions to proceed.",
"InfoDialog_nowrite_title": "write permission error!",
"about_3rd_party_licenses": "3rd party licenses",
"about_3rd_party_licenses_error": "We had trouble collecting 3rd party licenses information from web. <br />Please follow this link to the GitHub Resource.",
"about_build": "Build",
@@ -45,9 +34,19 @@
"conf_grabber_v4l_intro": "USB capture is a (capture)device connected via USB which is used to input source pictures for processing.",
"conf_helptable_expl": "Explanation",
"conf_helptable_option": "Option",
"conf_leds_config_error": "Error in LED/LED layout configuration",
"conf_leds_config_warning": "Check your LED/LED layout configuration",
"conf_leds_contr_label_contrtype": "Controller type:",
"conf_leds_device_info_log": "In case your LEDs do not work, check here for errors:",
"conf_leds_device_intro": "Hyperion supports a lot of controllers to transmit data to your target device. Select a LED controller out of the sorted list and configure it. We have chosen the best default settings for each device.",
"conf_leds_error_hwled_gt_layout": "The hardware LED count ($1) is greater than LEDs configured via layout ($2),<br>$3 {{plural:$1|LED|LEDs}} will stay black if you continue.",
"conf_leds_error_hwled_lt_layout": "The hardware LED count ($1) is less than LEDs configured via layout ($2). <br> The number of LEDs configured in the layout must not exceed the available LEDs",
"conf_leds_layout_advanced": "Advanced Settings",
"conf_leds_layout_blacklist_num_title": "Number of LEDs",
"conf_leds_layout_blacklist_rule_title": "Blacklist rule",
"conf_leds_layout_blacklist_rules_title": "Blacklist rules",
"conf_leds_layout_blacklist_start_title": "Start LED",
"conf_leds_layout_blacklistleds_title": "Blacklist LEDs",
"conf_leds_layout_btn_checklist": "Show checklist",
"conf_leds_layout_button_savelay": "Save Layout",
"conf_leds_layout_button_updsim": "Update Preview",
@@ -113,11 +112,12 @@
"conf_leds_layout_textf1": "This text field 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_leds_nav_label_ledcontroller": "LED Controller",
"conf_leds_nav_label_ledlayout": "LED Layout",
"conf_leds_note_layout_overwrite": "Note: Overwrite creates a default layout for {{plural:$1| $1 LED| all $1 LEDs}} given by the hardware LED count",
"conf_leds_optgroup_network": "Network",
"conf_leds_optgroup_other": "Other",
"conf_leds_optgroup_RPiGPIO": "RPi GPIO",
"conf_leds_optgroup_RPiPWM": "RPi PWM",
"conf_leds_optgroup_RPiSPI": "RPi SPI",
"conf_leds_optgroup_debug": "Debug",
"conf_leds_optgroup_network": "Network",
"conf_leds_optgroup_usb": "USB/Serial",
"conf_logging_btn_autoscroll": "Auto scrolling",
"conf_logging_btn_pbupload": "Upload a report for support requests",
@@ -215,10 +215,10 @@
"edt_conf_color_black_title": "Black",
"edt_conf_color_blue_expl": "The calibrated blue value.",
"edt_conf_color_blue_title": "Blue",
"edt_conf_color_brightnessComp_expl": "Compensates brightness differences between red green blue, cyan magenta yellow and white. 100 means full compensation, 0 no compensation",
"edt_conf_color_brightnessComp_title": "Brightness compensation",
"edt_conf_color_brightness_expl": "set overall brightness of LEDs",
"edt_conf_color_brightness_title": "Brightness",
"edt_conf_color_brightnessComp_expl": "Compensates brightness differences between red green blue, cyan magenta yellow and white. 100 means full compensation, 0 no compensation",
"edt_conf_color_brightnessComp_title": "Brightness compensation",
"edt_conf_color_channelAdjustment_header_expl": "Create color profiles that could be assigned to a specific component. Adjust color, gamma, brightness, compensation and more.",
"edt_conf_color_channelAdjustment_header_itemtitle": "Profile",
"edt_conf_color_channelAdjustment_header_title": "Color channel adjustments",
@@ -254,10 +254,6 @@
"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_title": "Effect Path(s)",
"edt_conf_enum_NO_CHANGE": "Automatic",
"edt_conf_enum_NTSC": "NTSC",
"edt_conf_enum_PAL": "PAL",
"edt_conf_enum_SECAM": "SECAM",
"edt_conf_enum_automatic": "Automatic",
"edt_conf_enum_bbclassic": "Classic",
"edt_conf_enum_bbdefault": "Default",
@@ -288,9 +284,14 @@
"edt_conf_enum_logverbose": "Verbose",
"edt_conf_enum_logwarn": "Warning",
"edt_conf_enum_multicolor_mean": "Multicolor",
"edt_conf_enum_NO_CHANGE": "Automatic",
"edt_conf_enum_NTSC": "NTSC",
"edt_conf_enum_PAL": "PAL",
"edt_conf_enum_please_select": "Please Select",
"edt_conf_enum_rbg": "RBG",
"edt_conf_enum_rgb": "RGB",
"edt_conf_enum_right_left": "Right to left",
"edt_conf_enum_SECAM": "SECAM",
"edt_conf_enum_top_down": "Top down",
"edt_conf_enum_transeffect_smooth": "Smooth",
"edt_conf_enum_transeffect_sudden": "Sudden",
@@ -322,11 +323,12 @@
"edt_conf_fge_type_title": "Type",
"edt_conf_fw_flat_expl": "One flatbuffer target per line. Contains IP:PORT (Example: 127.0.0.1:19401)",
"edt_conf_fw_flat_itemtitle": "flatbuffer target",
"edt_conf_fw_flat_title": "List of flatbuffer clients",
"edt_conf_fw_flat_title": "List of flatbuffer targets",
"edt_conf_fw_heading_title": "Forwarder",
"edt_conf_fw_json_expl": "One json target per line. Contains IP:PORT (Example: 127.0.0.1:19446)",
"edt_conf_fw_json_itemtitle": "Json target",
"edt_conf_fw_json_title": "List of json clients",
"edt_conf_fw_json_title": "List of json targets",
"edt_conf_gen_configVersion_title": "Configuration version",
"edt_conf_gen_heading_title": "General Settings",
"edt_conf_gen_name_expl": "A user defined name which is used to detect Hyperion. (Helpful with more than one Hyperion instance)",
"edt_conf_gen_name_title": "Configuration name",
@@ -354,9 +356,9 @@
"edt_conf_net_heading_title": "Network",
"edt_conf_net_internetAccessAPI_expl": "Allow access to the Hyperion API/Webinterface from the internet, disable for higher security.",
"edt_conf_net_internetAccessAPI_title": "Internet API Access",
"edt_conf_net_ip_itemtitle": "IP",
"edt_conf_net_ipWhitelist_expl": "You can whitelist IP addresses instead allowing all connections from internet to connect to the Hyperion API/Webinterface.",
"edt_conf_net_ipWhitelist_title": "Whitelisted IP's",
"edt_conf_net_ip_itemtitle": "IP",
"edt_conf_net_localAdminAuth_expl": "When enabled, administration access from your local network needs a password.",
"edt_conf_net_localAdminAuth_title": "Local Admin API Authentication",
"edt_conf_net_localApiAuth_expl": "When enabled, connections from your home network needs to authenticate themself against Hyperion with a token.",
@@ -436,25 +438,25 @@
"edt_conf_webc_sslport_expl": "Port oft the HTTPS-Webserver",
"edt_conf_webc_sslport_title": "HTTPS Port",
"edt_dev_auth_key_title": "Authentication Token",
"edt_dev_auth_key_title_info": "Authentication Token required to acccess the device",
"edt_dev_enum_sub_min_cool_adjust": "Subtract cool white",
"edt_dev_enum_sub_min_warm_adjust": "Subtract warm white",
"edt_dev_enum_subtract_minimum": "Subtract minimum",
"edt_dev_enum_white_off": "White off",
"edt_dev_general_colorOrder_title": "RGB byte order",
"edt_dev_general_colorOrder_title_info": "The device's color order",
"edt_dev_general_hardwareLedCount_title": "Hardware LED count",
"edt_dev_general_hardwareLedCount_title_info": "The number of physical LEDs availabe for the given device",
"edt_dev_general_heading_title": "General Settings",
"edt_dev_general_name_title": "Configuration name",
"edt_dev_general_rewriteTime_title": "Refresh time",
"edt_dev_spec_FCledToOn_title": "Fadecandy LED set to on",
"edt_dev_spec_FCmanualControl_title": "Manual control of fadecandy LED",
"edt_dev_spec_FCsetConfig_title": "Set fadecandy configuration",
"edt_dev_spec_LBap102Mode_title": "LightBerry APA102 Mode",
"edt_dev_spec_PBFiFo_title": "Pi-Blaster FiFo",
"edt_dev_spec_baudrate_title": "Baudrate",
"edt_dev_spec_blackLightsTimeout_title": "Signal detection timeout on black",
"edt_dev_spec_brightness_title": "Brightness",
"edt_dev_spec_brightnessFactor_title": "Brightness factor",
"edt_dev_spec_brightnessMax_title": "Brightness maximum",
"edt_dev_spec_brightnessMin_title": "Brightness minimum",
"edt_dev_spec_brightnessOverwrite_title": "Overwrite brightness",
"edt_dev_spec_brightnessThreshold_title": "Signal detection brightness minimum",
"edt_dev_spec_chanperfixture_title": "Channels per Fixture",
"edt_dev_spec_cid_title": "CID",
@@ -463,8 +465,16 @@
"edt_dev_spec_debugLevel_title": "Debug Level",
"edt_dev_spec_debugStreamer_title": "Streamer Debug",
"edt_dev_spec_delayAfterConnect_title": "Delay after connect",
"edt_dev_spec_devices_discovered_none": "No Devices Discovered",
"edt_dev_spec_devices_discovered_title": "Devices Discovered",
"edt_dev_spec_devices_discovered_title_info": "Select your LED-Device discovered",
"edt_dev_spec_devices_discovered_title_info_custom": "Select your LED-Device discovered or configure a custome one",
"edt_dev_spec_devices_discovery_inprogress": "Discovery in progress",
"edt_dev_spec_dithering_title": "Dithering",
"edt_dev_spec_dmaNumber_title": "DMA channel",
"edt_dev_spec_FCledToOn_title": "Fadecandy LED set to on",
"edt_dev_spec_FCmanualControl_title": "Manual control of fadecandy LED",
"edt_dev_spec_FCsetConfig_title": "Set fadecandy configuration",
"edt_dev_spec_gamma_title": "Gamma",
"edt_dev_spec_globalBrightnessControlMaxLevel_title": "Max Current Level",
"edt_dev_spec_globalBrightnessControlThreshold_title": "Adaptive Current Threshold",
@@ -477,6 +487,8 @@
"edt_dev_spec_intervall_title": "Interval",
"edt_dev_spec_invert_title": "Invert signal",
"edt_dev_spec_latchtime_title": "Latch time",
"edt_dev_spec_latchtime_title_info": "Latch time is the time-frame a device requires until the next update can be processed. During that time-frame any updates done via ignored.",
"edt_dev_spec_LBap102Mode_title": "LightBerry APA102 Mode",
"edt_dev_spec_ledIndex_title": "LED index",
"edt_dev_spec_ledType_title": "LED Type",
"edt_dev_spec_lightid_itemtitle": "ID",
@@ -484,8 +496,8 @@
"edt_dev_spec_lights_itemtitle": "Light",
"edt_dev_spec_lights_name": "Name",
"edt_dev_spec_lights_title": "Light(s)",
"edt_dev_spec_maxPacket_title": "Max packet",
"edt_dev_spec_maximumLedCount_title": "Maximum LED count",
"edt_dev_spec_maxPacket_title": "Max packet",
"edt_dev_spec_multicastGroup_title": "Multicast group",
"edt_dev_spec_networkDeviceName_title": "Network devicename",
"edt_dev_spec_networkDevicePort_title": "Port",
@@ -496,23 +508,27 @@
"edt_dev_spec_outputPath_title": "Output path",
"edt_dev_spec_panel_start_position": "Start panel [0-max panels]",
"edt_dev_spec_panelorganisation_title": "Panel numbering sequence",
"edt_dev_spec_PBFiFo_title": "Pi-Blaster FiFo",
"edt_dev_spec_pid_title": "PID",
"edt_dev_spec_port_title": "Port",
"edt_dev_spec_printTimeStamp_title": "Add timestamp",
"edt_dev_spec_pwmChannel_title": "PWM channel",
"edt_dev_spec_restoreOriginalState_title": "Restore lights' original state when disabled",
"edt_dev_spec_restoreOriginalState_title": "Restore lights' state",
"edt_dev_spec_restoreOriginalState_title_info": "Restore the device's original state when device is disabled",
"edt_dev_spec_serial_title": "Serial number",
"edt_dev_spec_spipath_title": "SPI path",
"edt_dev_spec_spipath_title": "SPI Device",
"edt_dev_spec_sslHSTimeoutMax_title": "Streamer handshake timeout maximum",
"edt_dev_spec_sslHSTimeoutMin_title": "Streamer handshake timeout minimum",
"edt_dev_spec_sslReadTimeout_title": "Streamer read timeout",
"edt_dev_spec_switchOffOnBlack_title": "Switch off on black",
"edt_dev_spec_switchOffOnbelowMinBrightness_title": "Switch-off, below minimum",
"edt_dev_spec_targetIpHost_title": "Target IP/Hostname",
"edt_dev_spec_targetIp_title": "Target IP",
"edt_dev_spec_switchOffOnBlack_title": "Switch off on black",
"edt_dev_spec_syncOverwrite_title": "Disable synchronisation",
"edt_dev_spec_targetIp_title": "Target IP-address",
"edt_dev_spec_targetIpHost_title": "Target Hostname/IP-address",
"edt_dev_spec_targetIpHost_title_info": "The device's hostname or IP-address",
"edt_dev_spec_transeffect_title": "Transition effect",
"edt_dev_spec_transistionTimeExtra_title": "Extra time darkness",
"edt_dev_spec_transistionTime_title": "Transition time",
"edt_dev_spec_transistionTimeExtra_title": "Extra time darkness",
"edt_dev_spec_uid_title": "UID",
"edt_dev_spec_universe_title": "Universe",
"edt_dev_spec_useEntertainmentAPI_title": "Use Hue Entertainment API",
@@ -538,16 +554,16 @@
"edt_eff_collision_header": "color collision",
"edt_eff_collision_header_desc": "Two color projectiles are sent from random positions and collide with each other",
"edt_eff_color": "Color",
"edt_eff_colorHour": "Color hour",
"edt_eff_colorMarker": "Marker color",
"edt_eff_colorMinute": "Color minute",
"edt_eff_colorSecond": "Color second",
"edt_eff_colorcount": "Color length",
"edt_eff_colorend": "Color end",
"edt_eff_colorendtime": "Time to hold start color",
"edt_eff_colorevel": "Color level",
"edt_eff_colorHour": "Color hour",
"edt_eff_colorMarker": "Marker color",
"edt_eff_colorMinute": "Color minute",
"edt_eff_colorone": "Color one",
"edt_eff_colorrandom": "Random color",
"edt_eff_colorSecond": "Color second",
"edt_eff_colorshift": "Color Shift",
"edt_eff_colorstart": "Color start",
"edt_eff_colorstarttime": "Time to hold end color",
@@ -603,13 +619,13 @@
"edt_eff_postcolor": "Post color",
"edt_eff_rainbowmood_header": "Rainbow Mood",
"edt_eff_rainbowmood_header_desc": "All LEDs rainbow mood",
"edt_eff_randomCenter": "Random Center",
"edt_eff_random_header": "Random",
"edt_eff_random_header_desc": "Pixel Dot, dot, dot...",
"edt_eff_randomCenter": "Random Center",
"edt_eff_repeat": "Repeat",
"edt_eff_repeatcount": "Repeat count",
"edt_eff_reverseRandomTime": "Reverse every",
"edt_eff_reversedirection": "Reverse direction",
"edt_eff_reverseRandomTime": "Reverse every",
"edt_eff_rotationtime": "Rotation time",
"edt_eff_saturation": "Saturation",
"edt_eff_showseconds": "Show seconds",
@@ -647,23 +663,23 @@
"edt_msg_button_expand": "Expand",
"edt_msg_button_move_down_title": "Move down",
"edt_msg_button_move_up_title": "Move up",
"edt_msg_error_additionalItems": "No additional items allowed in this array",
"edt_msg_error_additional_properties": "No additional properties allowed, but property $1 is set",
"edt_msg_error_additionalItems": "No additional items allowed in this array",
"edt_msg_error_anyOf": "Value must validate against at least one of the provided schemas",
"edt_msg_error_dependency": "Must have property $1",
"edt_msg_error_disallow": "Value must not be of type $1",
"edt_msg_error_disallow_union": "Value must not be one of the provided disallowed types",
"edt_msg_error_enum": "Value must be one of the enumerated values",
"edt_msg_error_maximum_excl": "Value must be less than $1",
"edt_msg_error_maximum_incl": "Value must be at most $1",
"edt_msg_error_maxItems": "Value must have at most $1 items",
"edt_msg_error_maxLength": "Value must be at most $1 characters long",
"edt_msg_error_maxProperties": "Object must have at most $1 properties",
"edt_msg_error_maximum_excl": "Value must be less than $1",
"edt_msg_error_maximum_incl": "Value must be at most $1",
"edt_msg_error_minimum_excl": "Value must be greater than $1",
"edt_msg_error_minimum_incl": "Value must be at least $1",
"edt_msg_error_minItems": "Value must have at least $1 items",
"edt_msg_error_minLength": "Value must be at least $1 characters long",
"edt_msg_error_minProperties": "Object must have at least $1 properties",
"edt_msg_error_minimum_excl": "Value must be greater than $1",
"edt_msg_error_minimum_incl": "Value must be at least $1",
"edt_msg_error_multipleOf": "Value must be a multiple of $1",
"edt_msg_error_not": "Value must not validate against the provided schema",
"edt_msg_error_notempty": "Value required",
@@ -698,6 +714,7 @@
"general_btn_off": "Off",
"general_btn_ok": "OK",
"general_btn_on": "On",
"general_btn_overwrite": "Overwrite",
"general_btn_rename": "Rename",
"general_btn_restarthyperion": "Restart Hyperion",
"general_btn_save": "Save",
@@ -745,20 +762,6 @@
"general_speech_zh-CN": "Chinese (simplified)",
"general_webui_title": "Hyperion - Web Configuration",
"general_wiki_moreto": "More information to \"$1\" at our Wiki",
"infoDialog_checklist_title": "Checklist!",
"infoDialog_effconf_created_text": "The effect \"$1\" has been created successfully!",
"infoDialog_effconf_deleted_text": "The effect \"$1\" has been deleted successfully!",
"infoDialog_general_error_title": "Error",
"infoDialog_general_success_title": "Success",
"infoDialog_general_warning_title": "Warning",
"infoDialog_import_comperror_text": "Sad! Your browser doesn't support a import. Please try again with another browser.",
"infoDialog_import_confirm_text": "Are you sure to import \"$1\"? This process can't be reverted!",
"infoDialog_import_confirm_title": "Confirm import",
"infoDialog_import_hyperror_text": "The selected configuration file \"$1\" can't be imported. It's not compatible with Hyperion 2.0 and higher!",
"infoDialog_import_jsonerror_text": "The selected configuration file \"$1\" is no .json file or it's corrupted. Error message: ($2)",
"infoDialog_wizrgb_text": "Your RGB Byte Order is already well adjusted.",
"infoDialog_writeconf_error_text": "Saving your configuration failed.",
"infoDialog_writeimage_error_text": "The selected file \"$1\" is no image file or it's corrupted! Please select another image file.",
"info_404": "The page you requested is not available!",
"info_conlost_label_autorecon": "We reconnect again after Hyperion is available.",
"info_conlost_label_autorefresh": "This page will be automatically refreshed.",
@@ -772,6 +775,31 @@
"info_restart_contusa": "...with your last steps. Thank you!",
"info_restart_rightback": "Hyperion will be right back immediately!",
"info_restart_title": "Restarts currently...",
"InfoDialog_access_text": "Depending on settings level you could adjust more options or get access to more features. Recommended is the \"Default\" level.",
"InfoDialog_access_title": "Settings level",
"InfoDialog_changePassword_success": "Password successfully saved!",
"InfoDialog_changePassword_title": "Change Password",
"infoDialog_checklist_title": "Checklist!",
"infoDialog_effconf_created_text": "The effect \"$1\" has been created successfully!",
"infoDialog_effconf_deleted_text": "The effect \"$1\" has been deleted successfully!",
"infoDialog_general_error_title": "Error",
"infoDialog_general_success_title": "Success",
"infoDialog_general_warning_title": "Warning",
"infoDialog_import_comperror_text": "Sad! Your browser doesn't support a import. Please try again with another browser.",
"infoDialog_import_confirm_text": "Are you sure to import \"$1\"? This process can't be reverted!",
"infoDialog_import_confirm_title": "Confirm import",
"infoDialog_import_hyperror_text": "The selected configuration file \"$1\" can't be imported. It's not compatible with Hyperion 2.0 and higher!",
"infoDialog_import_jsonerror_text": "The selected configuration file \"$1\" is no .json file or it's corrupted. Error message: ($2)",
"InfoDialog_iswitch_text": "If you run Hyperion more than once in your local network, you could switch between the web configurations. Select the Hyperion instance below and switch!",
"InfoDialog_iswitch_title": "Hyperion switcher",
"InfoDialog_lang_text": "If you don't like the result of the automatic language detection you could overwrite it here.",
"InfoDialog_lang_title": "Language setting",
"InfoDialog_nowrite_foottext": "The WebUI will be unlocked automatically after you solved the problem!",
"InfoDialog_nowrite_text": "Hyperion can't write to your current loaded configuration file. Please repair the file permissions to proceed.",
"InfoDialog_nowrite_title": "write permission error!",
"infoDialog_wizrgb_text": "Your RGB Byte Order is already well adjusted.",
"infoDialog_writeconf_error_text": "Saving your configuration failed.",
"infoDialog_writeimage_error_text": "The selected file \"$1\" is no image file or it's corrupted! Please select another image file.",
"main_ledsim_btn_togglelednumber": "LED numbers",
"main_ledsim_btn_toggleleds": "Show LEDs",
"main_ledsim_btn_togglelivevideo": "Live video",

View File

@@ -101,7 +101,7 @@
<span class="icon-bar middle-bar"></span>
<span class="icon-bar bottom-bar"></span>
</button>
<a class="navbar-brand" href="https://www.hyperion-project.org?pk_campaign=WebUI&pk_kwd=mainlogo" target="_blank"><img src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!" height="55"></a>
<a class="navbar-brand" href="https://www.hyperion-project.org" target="_blank"><img src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!" height="55"></a>
</div>
<!-- /.navbar-header -->
@@ -234,7 +234,7 @@
<a class="inactive"><i class="fa fa-industry fa-fw"></i><span data-i18n="main_menu_system_token">System</span><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li> <a class="inactive mnava" href="#conf_webconfig" id="load_webconfig"><i class="fa fa-wrench fa-fw"></i><span data-i18n="main_menu_webconfig_token">Webconfiguration</span></a> </li>
<li> <a class="inactive mnava" href="#conf_logging"><i class="fa fa-reorder fa-fw"></i><span data-i18n="main_menu_logging_token">Log</span></a> </li>
<li> <a class="inactive mnava" id="MenuItemLogging" href="#conf_logging"><i class="fa fa-reorder fa-fw"></i><span data-i18n="main_menu_logging_token">Log</span></a> </li>
<li> <a class="inactive mnava" href="#update"><i class="fa fa-download fa-fw"></i><span data-i18n="main_menu_update_token">Update</span></a> </li>
<li> <a class="inactive mnava" href="#about"><i class="fa fa-info-circle fa-fw"></i><span data-i18n="main_menu_about_token">About</span></a> </li>
</ul>

154
assets/webconfig/js/content_colors.js Normal file → Executable file
View File

@@ -1,84 +1,80 @@
$(document).ready( function() {
performTranslation();
var editor_color = null;
var editor_smoothing = null;
var editor_blackborder = null;
if(window.showOptHelp)
{
//color
$('#conf_cont').append(createRow('conf_cont_color'));
$('#conf_cont_color').append(createOptPanel('fa-photo', $.i18n("edt_conf_color_heading_title"), 'editor_container_color', 'btn_submit_color'));
$('#conf_cont_color').append(createHelpTable(window.schema.color.properties, $.i18n("edt_conf_color_heading_title")));
//smoothing
$('#conf_cont').append(createRow('conf_cont_smoothing'));
$('#conf_cont_smoothing').append(createOptPanel('fa-photo', $.i18n("edt_conf_smooth_heading_title"), 'editor_container_smoothing', 'btn_submit_smoothing'));
$('#conf_cont_smoothing').append(createHelpTable(window.schema.smoothing.properties, $.i18n("edt_conf_smooth_heading_title")));
//blackborder
$('#conf_cont').append(createRow('conf_cont_blackborder'));
$('#conf_cont_blackborder').append(createOptPanel('fa-photo', $.i18n("edt_conf_bb_heading_title"), 'editor_container_blackborder', 'btn_submit_blackborder'));
$('#conf_cont_blackborder').append(createHelpTable(window.schema.blackborderdetector.properties, $.i18n("edt_conf_bb_heading_title")));
}
else
{
$('#conf_cont').addClass('row');
$('#conf_cont').append(createOptPanel('fa-photo', $.i18n("edt_conf_color_heading_title"), 'editor_container_color', 'btn_submit_color'));
$('#conf_cont').append(createOptPanel('fa-photo', $.i18n("edt_conf_smooth_heading_title"), 'editor_container_smoothing', 'btn_submit_smoothing'));
$('#conf_cont').append(createOptPanel('fa-photo', $.i18n("edt_conf_bb_heading_title"), 'editor_container_blackborder', 'btn_submit_blackborder'));
}
//color
editor_color = createJsonEditor('editor_container_color', {
color : window.schema.color
}, true, true);
$(document).ready(function () {
performTranslation();
var editor_color = null;
var editor_smoothing = null;
var editor_blackborder = null;
editor_color.on('change',function() {
editor_color.validate().length || window.readOnlyMode ? $('#btn_submit_color').attr('disabled', true) : $('#btn_submit_color').attr('disabled', false);
});
$('#btn_submit_color').off().on('click',function() {
requestWriteConfig(editor_color.getValue());
});
//smoothing
editor_smoothing = createJsonEditor('editor_container_smoothing', {
smoothing : window.schema.smoothing
}, true, true);
if (window.showOptHelp) {
//color
$('#conf_cont').append(createRow('conf_cont_color'));
$('#conf_cont_color').append(createOptPanel('fa-photo', $.i18n("edt_conf_color_heading_title"), 'editor_container_color', 'btn_submit_color'));
$('#conf_cont_color').append(createHelpTable(window.schema.color.properties, $.i18n("edt_conf_color_heading_title")));
editor_smoothing.on('change',function() {
editor_smoothing.validate().length || window.readOnlyMode ? $('#btn_submit_smoothing').attr('disabled', true) : $('#btn_submit_smoothing').attr('disabled', false);
});
$('#btn_submit_smoothing').off().on('click',function() {
requestWriteConfig(editor_smoothing.getValue());
});
//smoothing
$('#conf_cont').append(createRow('conf_cont_smoothing'));
$('#conf_cont_smoothing').append(createOptPanel('fa-photo', $.i18n("edt_conf_smooth_heading_title"), 'editor_container_smoothing', 'btn_submit_smoothing'));
$('#conf_cont_smoothing').append(createHelpTable(window.schema.smoothing.properties, $.i18n("edt_conf_smooth_heading_title")));
//blackborder
editor_blackborder = createJsonEditor('editor_container_blackborder', {
blackborderdetector: window.schema.blackborderdetector
}, true, true);
//blackborder
$('#conf_cont').append(createRow('conf_cont_blackborder'));
$('#conf_cont_blackborder').append(createOptPanel('fa-photo', $.i18n("edt_conf_bb_heading_title"), 'editor_container_blackborder', 'btn_submit_blackborder'));
$('#conf_cont_blackborder').append(createHelpTable(window.schema.blackborderdetector.properties, $.i18n("edt_conf_bb_heading_title")));
}
else {
$('#conf_cont').addClass('row');
$('#conf_cont').append(createOptPanel('fa-photo', $.i18n("edt_conf_color_heading_title"), 'editor_container_color', 'btn_submit_color'));
$('#conf_cont').append(createOptPanel('fa-photo', $.i18n("edt_conf_smooth_heading_title"), 'editor_container_smoothing', 'btn_submit_smoothing'));
$('#conf_cont').append(createOptPanel('fa-photo', $.i18n("edt_conf_bb_heading_title"), 'editor_container_blackborder', 'btn_submit_blackborder'));
}
editor_blackborder.on('change',function() {
editor_blackborder.validate().length || window.readOnlyMode ? $('#btn_submit_blackborder').attr('disabled', true) : $('#btn_submit_blackborder').attr('disabled', false);
});
$('#btn_submit_blackborder').off().on('click',function() {
requestWriteConfig(editor_blackborder.getValue());
});
//wiki links
$('#editor_container_blackborder').append(buildWL("user/moretopics/bbmode","edt_conf_bb_mode_title",true));
//create introduction
if(window.showOptHelp)
{
createHint("intro", $.i18n('conf_colors_color_intro'), "editor_container_color");
createHint("intro", $.i18n('conf_colors_smoothing_intro'), "editor_container_smoothing");
createHint("intro", $.i18n('conf_colors_blackborder_intro'), "editor_container_blackborder");
}
removeOverlay();
//color
editor_color = createJsonEditor('editor_container_color', {
color: window.schema.color
}, true, true);
editor_color.on('change', function () {
editor_color.validate().length || window.readOnlyMode ? $('#btn_submit_color').attr('disabled', true) : $('#btn_submit_color').attr('disabled', false);
});
$('#btn_submit_color').off().on('click', function () {
requestWriteConfig(editor_color.getValue());
});
//smoothing
editor_smoothing = createJsonEditor('editor_container_smoothing', {
smoothing: window.schema.smoothing
}, true, true);
editor_smoothing.on('change', function () {
editor_smoothing.validate().length || window.readOnlyMode ? $('#btn_submit_smoothing').attr('disabled', true) : $('#btn_submit_smoothing').attr('disabled', false);
});
$('#btn_submit_smoothing').off().on('click', function () {
requestWriteConfig(editor_smoothing.getValue());
});
//blackborder
editor_blackborder = createJsonEditor('editor_container_blackborder', {
blackborderdetector: window.schema.blackborderdetector
}, true, true);
editor_blackborder.on('change', function () {
editor_blackborder.validate().length || window.readOnlyMode ? $('#btn_submit_blackborder').attr('disabled', true) : $('#btn_submit_blackborder').attr('disabled', false);
});
$('#btn_submit_blackborder').off().on('click', function () {
requestWriteConfig(editor_blackborder.getValue());
});
//wiki links
$('#editor_container_blackborder').append(buildWL("user/advanced/Advanced.html#blackbar-detection", "edt_conf_bb_mode_title", true));
//create introduction
if (window.showOptHelp) {
createHint("intro", $.i18n('conf_colors_color_intro'), "editor_container_color");
createHint("intro", $.i18n('conf_colors_smoothing_intro'), "editor_container_smoothing");
createHint("intro", $.i18n('conf_colors_blackborder_intro'), "editor_container_blackborder");
}
removeOverlay();
});

575
assets/webconfig/js/content_index.js Normal file → Executable file
View File

@@ -1,354 +1,357 @@
var instNameInit = false
$(document).ready(function () {
var darkModeOverwrite = getStorage("darkModeOverwrite", true);
var darkModeOverwrite = getStorage("darkModeOverwrite", true);
if (darkModeOverwrite == "false" || darkModeOverwrite == null) {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
handleDarkMode();
}
if(darkModeOverwrite == "false" || darkModeOverwrite == null)
{
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
handleDarkMode();
}
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
setStorage("darkMode", "off", false);
}
}
if(getStorage("darkMode", false) == "on")
{
handleDarkMode();
}
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
setStorage("darkMode", "off", false);
}
}
loadContentTo("#container_connection_lost", "connection_lost");
loadContentTo("#container_restart", "restart");
initWebSocket();
if (getStorage("darkMode", false) == "on") {
handleDarkMode();
}
$(window.hyperion).on("cmd-serverinfo", function (event) {
window.serverInfo = event.response.info;
window.readOnlyMode = window.sysInfo.hyperion.readOnlyMode;
// comps
window.comps = event.response.info.components
loadContentTo("#container_connection_lost", "connection_lost");
loadContentTo("#container_restart", "restart");
initWebSocket();
$(window.hyperion).trigger("ready");
$(window.hyperion).on("cmd-serverinfo", function (event) {
window.serverInfo = event.response.info;
window.comps.forEach(function (obj) {
if (obj.name == "ALL") {
if (obj.enabled)
$("#hyperion_disabled_notify").fadeOut("fast");
else
$("#hyperion_disabled_notify").fadeIn("fast");
}
});
window.readOnlyMode = window.sysInfo.hyperion.readOnlyMode;
// determine button visibility
var running = window.serverInfo.instance.filter(entry => entry.running);
if (running.length > 1)
$('#btn_hypinstanceswitch').toggle(true)
else
$('#btn_hypinstanceswitch').toggle(false)
// update listing at button
updateHyperionInstanceListing()
if (!instNameInit) {
window.currentHyperionInstanceName = getInstanceNameByIndex(0);
instNameInit = true;
}
// comps
window.comps = event.response.info.components
updateSessions();
}); // end cmd-serverinfo
$(window.hyperion).trigger("ready");
// Update language selection
$("#language-select").on('changed.bs.select',function (e, clickedIndex, isSelected, previousValue){
var newLang = availLang[clickedIndex-1];
if (newLang !== storedLang)
{
setStorage("langcode", newLang);
reload();
}
});
window.comps.forEach(function (obj) {
if (obj.name == "ALL") {
if (obj.enabled)
$("#hyperion_disabled_notify").fadeOut("fast");
else
$("#hyperion_disabled_notify").fadeIn("fast");
}
});
$("#language-select").selectpicker(
{
container: 'body'
});
// determine button visibility
var running = window.serverInfo.instance.filter(entry => entry.running);
if (running.length > 1)
$('#btn_hypinstanceswitch').toggle(true)
else
$('#btn_hypinstanceswitch').toggle(false)
// update listing at button
updateHyperionInstanceListing()
if (!instNameInit) {
window.currentHyperionInstanceName = getInstanceNameByIndex(0);
instNameInit = true;
}
$(".bootstrap-select").click(function () {
$(this).addClass("open");
});
updateSessions();
}); // end cmd-serverinfo
$(document).click(function(){
$(".bootstrap-select").removeClass("open");
});
// Update language selection
$("#language-select").on('changed.bs.select', function (e, clickedIndex, isSelected, previousValue) {
var newLang = availLang[clickedIndex - 1];
if (newLang !== storedLang) {
setStorage("langcode", newLang);
reload();
}
});
$(".bootstrap-select").click(function(e){
e.stopPropagation();
});
//End language selection
$(window.hyperion).on("cmd-sessions-update", function (event) {
window.serverInfo.sessions = event.response.data;
updateSessions();
});
$("#language-select").selectpicker(
{
container: 'body'
});
$(window.hyperion).on("cmd-authorize-tokenRequest cmd-authorize-getPendingTokenRequests", function (event) {
var val = event.response.info;
if (Array.isArray(event.response.info)) {
if (event.response.info.length == 0) {
return
}
val = event.response.info[0]
if (val.comment == '')
$('#modal_dialog').modal('hide');
}
$(".bootstrap-select").click(function () {
$(this).addClass("open");
});
showInfoDialog("grantToken", $.i18n('conf_network_tok_grantT'), $.i18n('conf_network_tok_grantMsg') + '<br><span style="font-weight:bold">App: ' + val.comment + '</span><br><span style="font-weight:bold">Code: ' + val.id + '</span>')
$("#tok_grant_acc").off().on('click', function () {
tokenList.push(val)
// forward event, in case we need to rebuild the list now
$(window.hyperion).trigger({ type: "build-token-list" });
requestHandleTokenRequest(val.id, true)
});
$("#tok_deny_acc").off().on('click', function () {
requestHandleTokenRequest(val.id, false)
});
});
$(document).click(function () {
$(".bootstrap-select").removeClass("open");
});
$(window.hyperion).one("cmd-authorize-getTokenList", function (event) {
tokenList = event.response.info;
requestServerInfo();
});
$(".bootstrap-select").click(function (e) {
e.stopPropagation();
});
$(window.hyperion).on("cmd-sysinfo", function (event) {
requestServerInfo();
window.sysInfo = event.response.info;
//End language selection
window.currentVersion = window.sysInfo.hyperion.version;
window.currentChannel = window.sysInfo.hyperion.channel;
});
$(window.hyperion).on("cmd-sessions-update", function (event) {
window.serverInfo.sessions = event.response.data;
updateSessions();
});
$(window.hyperion).one("cmd-config-getschema", function (event) {
window.serverSchema = event.response.info;
requestServerConfig();
$(window.hyperion).on("cmd-authorize-tokenRequest cmd-authorize-getPendingTokenRequests", function (event) {
var val = event.response.info;
if (Array.isArray(event.response.info)) {
if (event.response.info.length == 0) {
return
}
val = event.response.info[0]
if (val.comment == '')
$('#modal_dialog').modal('hide');
}
showInfoDialog("grantToken", $.i18n('conf_network_tok_grantT'), $.i18n('conf_network_tok_grantMsg') + '<br><span style="font-weight:bold">App: ' + val.comment + '</span><br><span style="font-weight:bold">Code: ' + val.id + '</span>')
$("#tok_grant_acc").off().on('click', function () {
tokenList.push(val)
// forward event, in case we need to rebuild the list now
$(window.hyperion).trigger({ type: "build-token-list" });
requestHandleTokenRequest(val.id, true)
});
$("#tok_deny_acc").off().on('click', function () {
requestHandleTokenRequest(val.id, false)
});
});
$(window.hyperion).one("cmd-authorize-getTokenList", function (event) {
tokenList = event.response.info;
requestServerInfo();
});
$(window.hyperion).on("cmd-sysinfo", function (event) {
requestServerInfo();
window.sysInfo = event.response.info;
window.currentVersion = window.sysInfo.hyperion.version;
window.currentChannel = window.sysInfo.hyperion.channel;
});
$(window.hyperion).one("cmd-config-getschema", function (event) {
window.serverSchema = event.response.info;
requestServerConfig();
requestTokenInfo();
requestGetPendingTokenRequests();
window.schema = window.serverSchema.properties;
});
window.schema = window.serverSchema.properties;
});
$(window.hyperion).on("cmd-config-getconfig", function (event) {
window.serverConfig = event.response.info;
requestSysInfo();
$(window.hyperion).on("cmd-config-getconfig", function (event) {
window.serverConfig = event.response.info;
requestSysInfo();
window.showOptHelp = window.serverConfig.general.showOptHelp;
});
window.showOptHelp = window.serverConfig.general.showOptHelp;
});
$(window.hyperion).on("cmd-config-setconfig", function (event) {
if (event.response.success === true) {
showNotification('success', $.i18n('dashboard_alert_message_confsave_success'), $.i18n('dashboard_alert_message_confsave_success_t'))
}
});
$(window.hyperion).on("cmd-config-setconfig", function (event) {
if (event.response.success === true) {
showNotification('success', $.i18n('dashboard_alert_message_confsave_success'), $.i18n('dashboard_alert_message_confsave_success_t'))
}
});
$(window.hyperion).on("cmd-authorize-login", function (event) {
$("#main-nav").removeAttr('style')
$("#top-navbar").removeAttr('style')
$(window.hyperion).on("cmd-authorize-login", function (event) {
$("#main-nav").removeAttr('style')
$("#top-navbar").removeAttr('style')
if (window.defaultPasswordIsSet === true && getStorage("suppressDefaultPwWarning") !== "true" )
{
var supprPwWarnCheckbox = '<div class="text-right">'+$.i18n('dashboard_message_do_not_show_again')
+ ' <input id="chk_suppressDefaultPw" type="checkbox" onChange="suppressDefaultPwWarning()"> </div>'
showNotification('warning', $.i18n('dashboard_message_default_password'), $.i18n('dashboard_message_default_password_t'), '<a style="cursor:pointer" onClick="changePassword()">'
+ $.i18n('InfoDialog_changePassword_title') + '</a>' + supprPwWarnCheckbox)
}
else
//if logged on and pw != default show option to lock ui
$("#btn_lock_ui").removeAttr('style')
if (window.defaultPasswordIsSet === true && getStorage("suppressDefaultPwWarning") !== "true") {
var supprPwWarnCheckbox = '<div class="text-right">' + $.i18n('dashboard_message_do_not_show_again')
+ ' <input id="chk_suppressDefaultPw" type="checkbox" onChange="suppressDefaultPwWarning()"> </div>'
showNotification('warning', $.i18n('dashboard_message_default_password'), $.i18n('dashboard_message_default_password_t'), '<a style="cursor:pointer" onClick="changePassword()">'
+ $.i18n('InfoDialog_changePassword_title') + '</a>' + supprPwWarnCheckbox)
}
else
//if logged on and pw != default show option to lock ui
$("#btn_lock_ui").removeAttr('style')
if (event.response.hasOwnProperty('info'))
setStorage("loginToken", event.response.info.token, true);
if (event.response.hasOwnProperty('info'))
setStorage("loginToken", event.response.info.token, true);
requestServerConfigSchema();
});
requestServerConfigSchema();
});
$(window.hyperion).on("cmd-authorize-newPassword", function (event) {
if (event.response.success === true) {
showInfoDialog("success", $.i18n('InfoDialog_changePassword_success'));
// not necessarily true, but better than nothing
window.defaultPasswordIsSet = false;
}
});
$(window.hyperion).on("cmd-authorize-newPassword", function (event) {
if (event.response.success === true) {
showInfoDialog("success", $.i18n('InfoDialog_changePassword_success'));
// not necessarily true, but better than nothing
window.defaultPasswordIsSet = false;
}
});
$(window.hyperion).on("cmd-authorize-newPasswordRequired", function (event) {
var loginToken = getStorage("loginToken", true)
$(window.hyperion).on("cmd-authorize-newPasswordRequired", function (event) {
var loginToken = getStorage("loginToken", true)
if (event.response.info.newPasswordRequired == true) {
window.defaultPasswordIsSet = true;
if (event.response.info.newPasswordRequired == true) {
window.defaultPasswordIsSet = true;
if (loginToken)
requestTokenAuthorization(loginToken)
else
requestAuthorization('hyperion');
}
else {
$("#main-nav").attr('style', 'display:none')
$("#top-navbar").attr('style', 'display:none')
if (loginToken)
requestTokenAuthorization(loginToken)
else
requestAuthorization('hyperion');
}
else {
$("#main-nav").attr('style', 'display:none')
$("#top-navbar").attr('style', 'display:none')
if (loginToken)
requestTokenAuthorization(loginToken)
else
loadContentTo("#page-content", "login")
}
});
if (loginToken)
requestTokenAuthorization(loginToken)
else
loadContentTo("#page-content", "login")
}
});
$(window.hyperion).on("cmd-authorize-adminRequired", function (event) {
//Check if a admin login is required.
//If yes: check if default pw is set. If no: go ahead to get server config and render page
if (event.response.info.adminRequired === true)
requestRequiresDefaultPasswortChange();
else
requestServerConfigSchema();
});
$(window.hyperion).on("cmd-authorize-adminRequired", function (event) {
//Check if a admin login is required.
//If yes: check if default pw is set. If no: go ahead to get server config and render page
if (event.response.info.adminRequired === true)
requestRequiresDefaultPasswortChange();
else
requestServerConfigSchema();
});
$(window.hyperion).on("error", function (event) {
//If we are getting an error "No Authorization" back with a set loginToken we will forward to new Login (Token is expired.
//e.g.: hyperiond was started new in the meantime)
if (event.reason == "No Authorization" && getStorage("loginToken", true)) {
removeStorage("loginToken", true);
requestRequiresAdminAuth();
}
else {
showInfoDialog("error", "Error", event.reason);
}
});
$(window.hyperion).on("error", function (event) {
//If we are getting an error "No Authorization" back with a set loginToken we will forward to new Login (Token is expired.
//e.g.: hyperiond was started new in the meantime)
if (event.reason == "No Authorization" && getStorage("loginToken", true)) {
removeStorage("loginToken", true);
requestRequiresAdminAuth();
}
else {
showInfoDialog("error", "Error", event.reason);
}
});
$(window.hyperion).on("open", function (event) {
requestRequiresAdminAuth();
});
$(window.hyperion).on("open", function (event) {
requestRequiresAdminAuth();
});
$(window.hyperion).one("ready", function (event) {
loadContent();
});
$(window.hyperion).one("ready", function (event) {
loadContent();
});
$(window.hyperion).on("cmd-adjustment-update", function (event) {
window.serverInfo.adjustment = event.response.data
});
$(window.hyperion).on("cmd-adjustment-update", function (event) {
window.serverInfo.adjustment = event.response.data
});
$(window.hyperion).on("cmd-videomode-update", function (event) {
window.serverInfo.videomode = event.response.data.videomode
});
$(window.hyperion).on("cmd-videomode-update", function (event) {
window.serverInfo.videomode = event.response.data.videomode
});
$(window.hyperion).on("cmd-components-update", function (event) {
let obj = event.response.data
$(window.hyperion).on("cmd-components-update", function (event) {
let obj = event.response.data
// notfication in index
if (obj.name == "ALL") {
if (obj.enabled)
$("#hyperion_disabled_notify").fadeOut("fast");
else
$("#hyperion_disabled_notify").fadeIn("fast");
}
// notfication in index
if (obj.name == "ALL") {
if (obj.enabled)
$("#hyperion_disabled_notify").fadeOut("fast");
else
$("#hyperion_disabled_notify").fadeIn("fast");
}
window.comps.forEach((entry, index) => {
if (entry.name === obj.name) {
window.comps[index] = obj;
}
});
// notify the update
$(window.hyperion).trigger("components-updated", event.response.data);
});
window.comps.forEach((entry, index) => {
if (entry.name === obj.name) {
window.comps[index] = obj;
}
});
// notify the update
$(window.hyperion).trigger("components-updated", event.response.data);
});
$(window.hyperion).on("cmd-instance-update", function (event) {
window.serverInfo.instance = event.response.data
var avail = event.response.data;
// notify the update
$(window.hyperion).trigger("instance-updated");
$(window.hyperion).on("cmd-instance-update", function (event) {
window.serverInfo.instance = event.response.data
var avail = event.response.data;
// notify the update
$(window.hyperion).trigger("instance-updated");
// if our current instance is no longer available we are at instance 0 again.
var isInData = false;
for (var key in avail) {
if (avail[key].instance == currentHyperionInstance && avail[key].running) {
isInData = true;
}
}
// if our current instance is no longer available we are at instance 0 again.
var isInData = false;
for (var key in avail) {
if (avail[key].instance == currentHyperionInstance && avail[key].running) {
isInData = true;
}
}
if (!isInData) {
//Delete Storage information about the last used but now stopped instance
if (getStorage('lastSelectedInstance', false))
removeStorage('lastSelectedInstance', false)
if (!isInData) {
//Delete Storage information about the last used but now stopped instance
if (getStorage('lastSelectedInstance', false))
removeStorage('lastSelectedInstance', false)
currentHyperionInstance = 0;
currentHyperionInstanceName = getInstanceNameByIndex(0);
requestServerConfig();
setTimeout(requestServerInfo, 100)
setTimeout(requestTokenInfo, 200)
setTimeout(loadContent, 300, undefined, true)
}
currentHyperionInstance = 0;
currentHyperionInstanceName = getInstanceNameByIndex(0);
requestServerConfig();
setTimeout(requestServerInfo, 100)
setTimeout(requestTokenInfo, 200)
setTimeout(loadContent, 300, undefined, true)
}
// determine button visibility
var running = serverInfo.instance.filter(entry => entry.running);
if (running.length > 1)
$('#btn_hypinstanceswitch').toggle(true)
else
$('#btn_hypinstanceswitch').toggle(false)
// determine button visibility
var running = serverInfo.instance.filter(entry => entry.running);
if (running.length > 1)
$('#btn_hypinstanceswitch').toggle(true)
else
$('#btn_hypinstanceswitch').toggle(false)
// update listing for button
updateHyperionInstanceListing()
});
// update listing for button
updateHyperionInstanceListing()
});
$(window.hyperion).on("cmd-instance-switchTo", function (event) {
requestServerConfig();
setTimeout(requestServerInfo, 200)
setTimeout(requestTokenInfo, 400)
setTimeout(loadContent, 400, undefined, true)
});
$(window.hyperion).on("cmd-instance-switchTo", function (event) {
requestServerConfig();
setTimeout(requestServerInfo, 200)
setTimeout(requestTokenInfo, 400)
setTimeout(loadContent, 400, undefined, true)
});
$(window.hyperion).on("cmd-effects-update", function (event) {
window.serverInfo.effects = event.response.data.effects
});
$(".mnava").bind('click.menu', function (e) {
loadContent(e);
window.scrollTo(0, 0);
});
$(window.hyperion).on("cmd-effects-update", function (event) {
window.serverInfo.effects = event.response.data.effects
});
$(".mnava").bind('click.menu', function (e) {
loadContent(e);
window.scrollTo(0, 0);
});
});
function suppressDefaultPwWarning(){
if (document.getElementById('chk_suppressDefaultPw').checked)
setStorage("suppressDefaultPwWarning", "true");
else
setStorage("suppressDefaultPwWarning", "false");
function suppressDefaultPwWarning() {
if (document.getElementById('chk_suppressDefaultPw').checked)
setStorage("suppressDefaultPwWarning", "true");
else
setStorage("suppressDefaultPwWarning", "false");
}
$(function () {
var sidebar = $('#side-menu'); // cache sidebar to a variable for performance
sidebar.delegate('a.inactive', 'click', function () {
sidebar.find('.active').toggleClass('active inactive');
$(this).toggleClass('active inactive');
});
var sidebar = $('#side-menu'); // cache sidebar to a variable for performance
sidebar.delegate('a.inactive', 'click', function () {
sidebar.find('.active').toggleClass('active inactive');
$(this).toggleClass('active inactive');
});
});
// hotfix body padding when bs modals overlap
$(document.body).on('hide.bs.modal,hidden.bs.modal', function () {
$('body').css('padding-right', '0');
$('body').css('padding-right', '0');
});
//Dark Mode
$("#btn_darkmode").off().on("click",function(e){
if(getStorage("darkMode", false) != "on")
{
handleDarkMode();
setStorage("darkModeOverwrite", true, true);
}
else {
setStorage("darkMode", "off", false);
setStorage("darkModeOverwrite", true, true);
location.reload();
}
$("#btn_darkmode").off().on("click", function (e) {
if (getStorage("darkMode", false) != "on") {
handleDarkMode();
setStorage("darkModeOverwrite", true, true);
}
else {
setStorage("darkMode", "off", false);
setStorage("darkModeOverwrite", true, true);
location.reload();
}
});
// Menuitem toggle;
function SwitchToMenuItem(target) {
document.getElementById(target).click(); // Get <a href menu item;
let sidebar = $('#side-menu'); // Get sidebar menu;
sidebar.find('.active').toggleClass('inactive'); // find all active classes and set inactive;
sidebar.find('.in').removeClass("in"); // Find all collapsed menu items and close it by remove "in" class;
$('#' + target).removeClass('inactive'); // Remove inactive state by classname;
$('#' + target).addClass('active'); // Add active state by classname;
let cl_object = $('#' + target).closest('ul'); // Find closest ul sidemenu header;
cl_object.addClass('in'); // add class "in" to expand header in sidebar menu;
};

2019
assets/webconfig/js/content_leds.js Normal file → Executable file

File diff suppressed because it is too large Load Diff

239
assets/webconfig/js/ui_utils.js Normal file → Executable file
View File

@@ -53,7 +53,7 @@ function updateSessions() {
if (sess && sess.length) {
window.wSess = [];
for (var i = 0; i < sess.length; i++) {
if (sess[i].type == "_hyperiond-http._tcp.") {
if (sess[i].type == "_http._tcp." || sess[i].type == "_https._tcp." || sess[i].type == "_hyperiond-http._tcp.") {
window.wSess.push(sess[i]);
}
}
@@ -134,13 +134,13 @@ function updateHyperionInstanceListing() {
var currInstMarker = (data[key].instance == window.currentHyperionInstance) ? "component-on" : "";
var html = '<li id="hyperioninstance_' + data[key].instance + '"> \
<a> \
<div> \
<i class="fa fa-circle fa-fw '+ currInstMarker + '"></i> \
<span>'+ data[key].friendly_name + '</span> \
</div> \
</a> \
</li> '
<a> \
<div> \
<i class="fa fa-circle fa-fw '+ currInstMarker + '"></i> \
<span>'+ data[key].friendly_name + '</span> \
</div> \
</a> \
</li> '
if (data.length - 1 > key)
html += '<li class="divider"></li>'
@@ -183,7 +183,6 @@ function initLanguageSelection() {
langText = availLangText[langIdx];
}
}
//console.log("langLocale: ", langLocale, "langText: ", langText);
$('#language-select').prop('title', langText);
$("#language-select").val(langIdx);
@@ -463,6 +462,170 @@ function createJsonEditor(container, schema, setconfig, usePanel, arrayre) {
return editor;
}
function updateJsonEditorSelection(editor, key, addElements, newEnumVals, newTitelVals, newDefaultVal, addSelect, addCustom, addCustomAsFirst, customText) {
var orginalProperties = editor.schema.properties[key];
var newSchema = [];
newSchema[key] =
{
"type": "string",
"enum": [],
"required": true,
"options": { "enum_titles": [], "infoText": "" },
"propertyOrder": 1
};
//Add additional elements to overwrite defaults
for (var item in addElements) {
newSchema[key][item] = addElements[item];
}
if (orginalProperties) {
if (orginalProperties["title"]) {
newSchema[key]["title"] = orginalProperties["title"];
}
if (orginalProperties["options"] && orginalProperties["options"]["infoText"]) {
newSchema[key]["options"]["infoText"] = orginalProperties["options"]["infoText"];
}
if (orginalProperties["propertyOrder"]) {
newSchema[key]["propertyOrder"] = orginalProperties["propertyOrder"];
}
}
if (addCustom) {
if (newTitelVals.length === 0) {
newTitelVals = [...newEnumVals];
}
if (!!!customText) {
customText = "edt_conf_enum_custom";
}
if (addCustomAsFirst) {
newEnumVals.unshift("CUSTOM");
newTitelVals.unshift(customText);
} else {
newEnumVals.push("CUSTOM");
newTitelVals.push(customText);
}
if (newSchema[key].options.infoText) {
var customInfoText = newSchema[key].options.infoText + "_custom";
newSchema[key].options.infoText = customInfoText;
}
}
if (addSelect) {
newEnumVals.unshift("SELECT");
newTitelVals.unshift("edt_conf_enum_please_select");
newDefaultVal = "SELECT";
}
if (newEnumVals) {
newSchema[key]["enum"] = newEnumVals;
}
if (newTitelVals) {
newSchema[key]["options"]["enum_titles"] = newTitelVals;
}
if (newDefaultVal) {
newSchema[key]["default"] = newDefaultVal;
}
editor.original_schema.properties[key] = orginalProperties;
editor.schema.properties[key] = newSchema[key];
editor.removeObjectProperty(key);
delete editor.cached_editors[key];
editor.addObjectProperty(key);
}
function updateJsonEditorMultiSelection(editor, key, addElements, newEnumVals, newTitelVals, newDefaultVal) {
var orginalProperties = editor.schema.properties[key];
var newSchema = [];
newSchema[key] =
{
"type": "array",
"format": "select",
"items": {
"type": "string",
"enum": [],
"options": { "enum_titles": [] },
},
"options": { "infoText": "" },
"default": [],
"propertyOrder": 1
};
//Add additional elements to overwrite defaults
for (var item in addElements) {
newSchema[key][item] = addElements[item];
}
if (orginalProperties) {
if (orginalProperties["title"]) {
newSchema[key]["title"] = orginalProperties["title"];
}
if (orginalProperties["options"] && orginalProperties["options"]["infoText"]) {
newSchema[key]["options"]["infoText"] = orginalProperties["options"]["infoText"];
}
if (orginalProperties["propertyOrder"]) {
newSchema[key]["propertyOrder"] = orginalProperties["propertyOrder"];
}
}
if (newEnumVals) {
newSchema[key]["items"]["enum"] = newEnumVals;
}
if (newTitelVals) {
newSchema[key]["items"]["options"]["enum_titles"] = newTitelVals;
}
if (newDefaultVal) {
newSchema[key]["default"] = newDefaultVal;
}
editor.original_schema.properties[key] = orginalProperties;
editor.schema.properties[key] = newSchema[key];
editor.removeObjectProperty(key);
delete editor.cached_editors[key];
editor.addObjectProperty(key);
}
function updateJsonEditorRange(editor, key, minimum, maximum, defaultValue, step) {
var orginalProperties = editor.schema.properties[key];
var newSchema = [];
newSchema[key] = orginalProperties;
if (minimum) {
newSchema[key]["minimum"] = minimum;
}
if (maximum) {
newSchema[key]["maximum"] = maximum;
}
if (defaultValue) {
newSchema[key]["default"] = defaultValue;
}
if (step) {
newSchema[key]["step"] = step;
}
editor.original_schema.properties[key] = orginalProperties;
editor.schema.properties[key] = newSchema[key];
editor.removeObjectProperty(key);
delete editor.cached_editors[key];
editor.addObjectProperty(key);
}
function buildWL(link, linkt, cl) {
var baseLink = "https://docs.hyperion-project.org/";
var lang;
@@ -655,6 +818,48 @@ function createOptPanel(phicon, phead, bodyid, footerid) {
return createPanel(phead, "", pfooter, "panel-default", bodyid);
}
function compareTwoValues(key1, key2, order = 'asc') {
return function innerSort(a, b) {
if (!a.hasOwnProperty(key1) || !b.hasOwnProperty(key1)) {
// property key1 doesn't exist on either object
return 0;
}
const varA1 = (typeof a[key1] === 'string')
? a[key1].toUpperCase() : a[key1];
const varB1 = (typeof b[key1] === 'string')
? b[key1].toUpperCase() : b[key1];
let comparison = 0;
if (varA1 > varB1) {
comparison = 1;
} else {
if (varA1 < varB1) {
comparison = -1;
} else {
if (!a.hasOwnProperty(key2) || !b.hasOwnProperty(key2)) {
// property key2 doesn't exist on either object
return 0;
}
const varA2 = (typeof a[key2] === 'string')
? a[key2].toUpperCase() : a[key2];
const varB2 = (typeof b[key1] === 'string')
? b[key2].toUpperCase() : b[key2];
if (varA2 > varB2) {
comparison = 1;
} else {
comparison = -1;
}
}
}
return (
(order === 'desc') ? (comparison * -1) : comparison
);
};
}
function sortProperties(list) {
for (var key in list) {
list[key].key = key;
@@ -876,3 +1081,19 @@ function handleDarkMode() {
$('#btn_darkmode_icon').removeClass('fa fa-moon-o');
$('#btn_darkmode_icon').addClass('fa fa-sun-o');
}
function isAccessLevelCompliant(accessLevel) {
var isOK = true;
if (accessLevel) {
if (accessLevel === 'system') {
isOK = false;
}
else if (accessLevel === 'advanced' && storedAccess === 'default') {
isOK = false;
}
else if (accessLevel === 'expert' && storedAccess !== 'expert') {
isOK = false;
}
}
return isOK
}

437
assets/webconfig/js/wizard.js Normal file → Executable file
View File

@@ -424,7 +424,7 @@ function startWizardCC() {
}
//create html
$('#wiz_header').html('<i class="fa fa-magic fa-fw"></i>' + $.i18n('wiz_cc_title'));
$('#wizp1_body').html('<h4 style="font-weight:bold;text-transform:uppercase;">' + $.i18n('wiz_cc_title') + '</h4><p>' + $.i18n('wiz_cc_intro1') + '</p><label>' + $.i18n('wiz_cc_kwebs') + '</label><input class="form-control" style="width:170px;margin:auto" id="wiz_cc_kodiip" type="text" placeholder="' + kodiAddress + '" value="' + kodiAddress + '" /><span id="kodi_status"></span><span id="multi_cali"></span>');
$('#wizp1_body').html('<h4 style="font-weight:bold;text-transform:uppercase;">' + $.i18n('wiz_cc_title') + '</h4><p>' + $.i18n('wiz_cc_intro1') + '</p><label>' + $.i18n('wiz_cc_kwebs') + '</label><input class="form-control" style="width:170px;margin:auto" id="wiz_cc_kodiip" type="text" placeholder="' + kodiAddress + '" value="' + kodiAddress + '" /><span id="kodi_status"></span><span id="multi_cali"></span>');
$('#wizp1_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_cont" disabled="disabled"><i class="fa fa-fw fa-check"></i>' + $.i18n('general_btn_continue') + '</button><button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
$('#wizp2_body').html('<div id="wiz_cc_desc" style="font-weight:bold"></div><div id="editor_container_wiz"></div>');
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_back"><i class="fa fa-fw fa-chevron-left"></i>' + $.i18n('general_btn_back') + '</button><button type="button" class="btn btn-primary" id="btn_wiz_next">' + $.i18n('general_btn_next') + '<i style="margin-left:4px;"class="fa fa-fw fa-chevron-right"></i></button><button type="button" class="btn btn-warning" id="btn_wiz_save" style="display:none"><i class="fa fa-fw fa-save"></i>' + $.i18n('general_btn_save') + '</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
@@ -437,10 +437,9 @@ function startWizardCC() {
});
$('#wiz_cc_kodiip').off().on('change', function () {
kodiAddress = $(this).val().trim();
$('#wizp1_body').find("kodiAddress").val(kodiAddress);
$('#kodi_status').html('');
// Remove Kodi's default Web-Socket port (9090) from display and ensure Kodi's default REST-API port (8080) is mapped to web-socket port to ease migration
@@ -788,8 +787,6 @@ async function discover_hue_bridges() {
const r = res.info;
// Process devices returned by discovery
console.log(r);
if (r.devices.length == 0)
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip'));
else {
@@ -832,7 +829,7 @@ async function identify_hue_device(hostAddress, username, id) {
$('#btn_wiz_save').attr('disabled', true);
let params = { host: hostAddress, user: username, lightId: id };
const res = await requestLedDeviceIdentification('philipshue', params);
await requestLedDeviceIdentification('philipshue', params);
if (!window.readOnlyMode) {
$('#btn_wiz_save').attr('disabled', false);
@@ -1187,7 +1184,6 @@ function get_hue_lights() {
}
(cC == 0 || window.readOnlyMode) ? $('#btn_wiz_save').attr("disabled", true) : $('#btn_wiz_save').attr("disabled", false);
});
}
$('.hue_sel_watch').trigger('change');
@@ -1208,108 +1204,6 @@ function abortConnection(UserInterval) {
$("#wiz_hue_usrstate").html($.i18n('wiz_hue_failure_connection'));
}
//****************************
// Wizard WLED
//****************************
var lights = null;
function startWizardWLED(e) {
//create html
var wled_title = 'wiz_wled_title';
var wled_intro1 = 'wiz_wled_intro1';
$('#wiz_header').html('<i class="fa fa-magic fa-fw"></i>' + $.i18n(wled_title));
$('#wizp1_body').html('<h4 style="font-weight:bold;text-transform:uppercase;">' + $.i18n(wled_title) + '</h4><p>' + $.i18n(wled_intro1) + '</p>');
$('#wizp1_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_cont"><i class="fa fa-fw fa-check"></i>' + $.i18n('general_btn_continue') + '</button><button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
/*$('#wizp2_body').html('<div id="wh_topcontainer"></div>');
$('#wh_topcontainer').append('<div class="form-group" id="usrcont" style="display:none"></div>');
$('#wizp2_body').append('<div id="hue_ids_t" style="display:none"><p style="font-weight:bold" id="hue_id_headline">'+$.i18n('wiz_wled_desc2')+'</p></div>');
createTable("lidsh", "lidsb", "hue_ids_t");
$('.lidsh').append(createTableRow([$.i18n('edt_dev_spec_lights_title'),$.i18n('wiz_pos'),$.i18n('wiz_identify')], true));
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_save" style="display:none"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_save')+'</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
*/
//open modal
$("#wizard_modal").modal({
backdrop: "static",
keyboard: false,
show: true
});
//listen for continue
$('#btn_wiz_cont').off().on('click', function () {
/* For testing only
discover_wled();
var hostAddress = conf_editor.getEditor("root.specificOptions.host").getValue();
if(hostAddress != "")
{
getProperties_wled(hostAddress,"info");
identify_wled(hostAddress)
}
For testing only */
});
}
async function discover_wled() {
const res = await requestLedDeviceDiscovery('wled');
// TODO: error case unhandled
// res can be: false (timeout) or res.error (not found)
if (res && !res.error) {
const r = res.info
// Process devices returned by discovery
console.log(r);
if (r.devices.length == 0)
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip'));
else {
for (const device of r.devices) {
console.log("Device:", device);
var ip = device.hostname + ":" + device.port;
console.log("Host:", ip);
//wledIPs.push({internalipaddress : ip});
}
}
}
}
async function getProperties_wled(hostAddress, resourceFilter) {
let params = { host: hostAddress, filter: resourceFilter };
const res = await requestLedDeviceProperties('wled', params);
// TODO: error case unhandled
// res can be: false (timeout) or res.error (not found)
if (res && !res.error) {
const r = res.info
// Process properties returned
console.log(r);
}
}
async function identify_wled(hostAddress) {
// Take care that new record cannot be save during background process
$('#btn_wiz_save').attr('disabled', true);
let params = { host: hostAddress };
const res = await requestLedDeviceIdentification('wled', params);
if (!window.readOnlyMode) {
$('#btn_wiz_save').attr('disabled', false);
}
}
//****************************
// Wizard Yeelight
//****************************
@@ -1438,8 +1332,17 @@ async function discover_yeelight_lights() {
var light = {};
light.host = device.hostname;
light.port = device.port;
light.name = device.other.name;
light.model = device.other.model;
if (device.txt) {
light.name = device.name;
light.model = device.txt.md;
//Yeelight does not provide correct API port with mDNS response, use default one
light.port = 55443;
}
else {
light.name = device.other.name;
light.model = device.other.model;
}
lights.push(light);
}
}
@@ -1469,7 +1372,8 @@ async function discover_yeelight_lights() {
}
function assign_yeelight_lights() {
var models = ['color', 'color1', 'color2', 'color4', 'stripe', 'strip1'];
// Model mappings, see https://www.home-assistant.io/integrations/yeelight/
var models = ['color', 'color1', 'YLDP02YL', 'YLDP02YL', 'color2', 'YLDP06YL', 'color4', 'YLDP13YL', 'stripe', 'YLDD04YL', 'strip1', 'YLDD01YL', 'YLDD02YL'];
// If records are left for configuration
if (Object.keys(lights).length > 0) {
@@ -1534,7 +1438,7 @@ function assign_yeelight_lights() {
$('.yee_sel_watch').trigger('change');
}
else {
var noLightsTxt = '<p style="font-weight:bold;color:red;">' + $.i18n('wiz_noLights','Yeelights') + '</p>';
var noLightsTxt = '<p style="font-weight:bold;color:red;">' + $.i18n('wiz_noLights', 'Yeelights') + '</p>';
$('#wizp2_body').append(noLightsTxt);
}
}
@@ -1555,15 +1459,14 @@ async function getProperties_yeelight(hostname, port) {
}
async function identify_yeelight_device(hostname, port) {
// Take care that new record cannot be save during background process
$('#btn_wiz_save').attr('disabled', true);
let params = { hostname: hostname, port: port };
const res = await requestLedDeviceIdentification("yeelight", params);
await requestLedDeviceIdentification("yeelight", params);
if (!window.readOnlyMode) {
$('#btn_wiz_save').attr('disabled', false);
$('#btn_wiz_save').attr('disabled', false);
}
}
@@ -1675,14 +1578,12 @@ async function discover_atmoorb_lights(multiCastGroup, multiCastPort) {
var light = {};
var params = {};
if (multiCastGroup !== "")
{
if (multiCastGroup !== "") {
params.multiCastGroup = multiCastGroup;
}
if (multiCastPort !== 0)
{
params.multiCastPort = multiCastPort;
if (multiCastPort !== 0) {
params.multiCastPort = multiCastPort;
}
// Get discovered lights
@@ -1692,7 +1593,7 @@ async function discover_atmoorb_lights(multiCastGroup, multiCastPort) {
// res can be: false (timeout) or res.error (not found)
if (res && !res.error) {
const r = res.info;
// Process devices returned by discovery
for (const device of r.devices) {
if (device.id !== "") {
@@ -1774,7 +1675,7 @@ function assign_atmoorb_lights() {
$('.lidsb').append(createTableRow([orbId + lightAnnotation, '<select id="orb_' + lightid + '" ' + enabled + ' class="orb_sel_watch form-control">'
+ options
+ '</select>', '<button class="btn btn-sm btn-primary" ' + enabled + ' onClick=identify_atmoorb_device(' + orbId + ')>'
+ '</select>', '<button class="btn btn-sm btn-primary" ' + enabled + ' onClick=identify_atmoorb_device("' + orbId + '")>'
+ $.i18n('wiz_identify_light', orbId) + '</button>']));
}
@@ -1793,303 +1694,19 @@ function assign_atmoorb_lights() {
$('.orb_sel_watch').trigger('change');
}
else {
var noLightsTxt = '<p style="font-weight:bold;color:red;">' + $.i18n('wiz_noLights','AtmoOrbs') + '</p>';
var noLightsTxt = '<p style="font-weight:bold;color:red;">' + $.i18n('wiz_noLights', 'AtmoOrbs') + '</p>';
$('#wizp2_body').append(noLightsTxt);
}
}
async function identify_atmoorb_device(orbId) {
// Take care that new record cannot be save during background process
$('#btn_wiz_save').attr('disabled', true);
let params = { id: orbId };
const res = await requestLedDeviceIdentification("atmoorb", params);
await requestLedDeviceIdentification("atmoorb", params);
if (!window.readOnlyMode) {
$('#btn_wiz_save').attr('disabled', false);
}
}
//****************************
// Wizard/Routines Nanoleaf
//****************************
async function discover_nanoleaf() {
const res = await requestLedDeviceDiscovery('nanoleaf');
// TODO: error case unhandled
// res can be: false (timeout) or res.error (not found)
if (res && !res.error) {
const r = res.info
// Process devices returned by discovery
console.log(r);
if (r.devices.length == 0)
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip'));
else {
for (const device of r.devices) {
console.log("Device:", device);
var ip = device.hostname + ":" + device.port;
console.log("Host:", ip);
//nanoleafIPs.push({internalipaddress : ip});
}
}
}
}
async function getProperties_nanoleaf(hostAddress, authToken, resourceFilter) {
let params = { host: hostAddress, token: authToken, filter: resourceFilter };
const res = await requestLedDeviceProperties('nanoleaf', params);
// TODO: error case unhandled
// res can be: false (timeout) or res.error (not found)
if (res && !res.error) {
const r = res.info
// Process properties returned
console.log(r);
}
}
async function identify_nanoleaf(hostAddress, authToken) {
// Take care that new record cannot be save during background process
$('#btn_wiz_save').attr('disabled', true);
let params = { host: hostAddress, token: authToken };
const res = await requestLedDeviceIdentification('nanoleaf', params);
if (!window.readOnlyMode) {
$('#btn_wiz_save').attr('disabled', false);
}
}
//****************************
// Wizard Cololight
//****************************
var lights = null;
var selectedLightId = null;
function startWizardCololight(e) {
//create html
var cololight_title = 'wiz_cololight_title';
var cololight_intro1 = 'wiz_cololight_intro1';
$('#wiz_header').html('<i class="fa fa-magic fa-fw"></i>' + $.i18n(cololight_title));
$('#wizp1_body').html('<h4 style="font-weight:bold;text-transform:uppercase;">' + $.i18n(cololight_title) + '</h4><p>' + $.i18n(cololight_intro1) + '</p>');
$('#wizp1_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_cont"><i class="fa fa-fw fa-check"></i>' + $.i18n('general_btn_continue') + '</button><button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
$('#wizp2_body').html('<div id="wh_topcontainer"></div>');
$('#wh_topcontainer').append('<div class="form-group" id="usrcont" style="display:none"></div>');
$('#wizp2_body').append('<div id="colo_ids_t" style="display:none"><p style="font-weight:bold" id="colo_id_headline">' + $.i18n('wiz_cololight_desc2') + '</p></div>');
createTable("lidsh", "lidsb", "colo_ids_t");
$('.lidsh').append(createTableRow([$.i18n('edt_dev_spec_lights_title'), $.i18n('wiz_identify')], true));
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_save" style="display:none"><i class="fa fa-fw fa-save"></i>'
+ $.i18n('general_btn_save') + '</button><buttowindow.serverConfig.device = d;n type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'
+ $.i18n('general_btn_cancel') + '</button>');
//open modal
$("#wizard_modal").modal({
backdrop: "static",
keyboard: false,
show: true
});
//listen for continue
$('#btn_wiz_cont').off().on('click', function () {
beginWizardCololight();
$('#wizp1').toggle(false);
$('#wizp2').toggle(true);
});
}
function beginWizardCololight() {
lights = [];
discover_cololights();
$('#btn_wiz_save').off().on("click", function () {
//LED device config
//Start with a clean configuration
var d = {};
d.type = 'cololight';
//Cololight does not resolve into stable hostnames (as devices named the same), therefore use IP
if (!lights[selectedLightId].ip) {
d.host = lights[selectedLightId].host;
} else {
d.host = lights[selectedLightId].ip;
}
var coloLightProperties = lights[selectedLightId].props.properties;
if (Object.keys(coloLightProperties).length === 0) {
alert($.i18n('wiz_cololight_noprops'));
d.hardwareLedCount = 1;
}
else {
d.hardwareLedCount = coloLightProperties.ledCount;
}
d.colorOrder = conf_editor.getEditor("root.generalOptions.colorOrder").getValue();
d.latchTime = parseInt(conf_editor.getEditor("root.specificOptions.latchTime").getValue());;
window.serverConfig.device = d;
//LED layout - have initial layout prepared matching the LED-count
var coloLightLedConfig = [];
if (coloLightProperties.modelType === "Strip") {
coloLightLedConfig = createClassicLedLayoutSimple(d.hardwareLedCount / 2, d.hardwareLedCount / 4, d.hardwareLedCount / 4, 0, d.hardwareLedCount / 4 * 3, false);
} else {
coloLightLedConfig = createClassicLedLayoutSimple(0, 0, 0, d.hardwareLedCount, 0, true);
}
window.serverConfig.leds = coloLightLedConfig;
//smoothing off
window.serverConfig.smoothing.enable = false;
requestWriteConfig(window.serverConfig, true);
resetWizard();
});
$('#btn_wiz_abort').off().on('click', resetWizard);
}
async function discover_cololights() {
const res = await requestLedDeviceDiscovery('cololight');
if (res && !res.error) {
const r = res.info;
// Process devices returned by discovery
for (const device of r.devices) {
if (device.ip !== "") {
if (getIpInLights(device.ip).length === 0) {
var light = {};
light.ip = device.ip;
light.host = device.hostname;
light.name = device.name;
light.type = device.type;
lights.push(light);
}
}
}
assign_cololight_lights();
}
}
function assign_cololight_lights() {
// If records are left for configuration
if (Object.keys(lights).length > 0) {
$('#wh_topcontainer').toggle(false);
$('#colo_ids_t, #btn_wiz_save').toggle(true);
$('.lidsb').html("");
var options = "";
for (var lightid in lights) {
lights[lightid].id = lightid;
var lightHostname = lights[lightid].host;
var lightIP = lights[lightid].ip;
var val = lightHostname + " (" + lightIP + ")";
options += '<option value="' + lightid + '">' + val + '</option>';
}
var enabled = 'enabled';
$('.lidsb').append(createTableRow(['<select id="colo_select_id" ' + enabled + ' class="colo_sel_watch form-control">'
+ options
+ '</select>', '<button id="wiz_identify_btn" class="btn btn-sm btn-primary">'
+ $.i18n('wiz_identify') + '</button>']));
$('.colo_sel_watch').bind("change", function () {
selectedLightId = $('#colo_select_id').val();
var lightIP = lights[selectedLightId].ip;
$('#wiz_identify_btn').unbind().bind('click', function (event) { identify_cololight_device(lightIP); });
if (!lights[selectedLightId].props) {
getProperties_cololight(lightIP);
}
});
$('.colo_sel_watch').trigger('change');
}
else {
var noLightsTxt = '<p style="font-weight:bold;color:red;">' + $.i18n('wiz_noLights','Cololights') + '</p>';
$('#wizp2_body').append(noLightsTxt);
}
}
async function getProperties_cololight(ip) {
let params = { host: ip };
const res = await requestLedDeviceProperties('cololight', params);
if (res && !res.error) {
var coloLightProperties = res.info;
//Store properties along light with given IP-address
var id = getIpInLights(ip)[0].id;
lights[id].props = coloLightProperties;
}
}
async function identify_cololight_device(hostAddress) {
// Take care that new record cannot be save during background process
$('#btn_wiz_save').attr('disabled', true);
let params = { host: hostAddress };
const res = await requestLedDeviceIdentification('cololight', params);
if (!window.readOnlyMode) {
$('#btn_wiz_save').attr('disabled', false);
}
}
//****************************
// Wizard/Routines RS232-Devices
//****************************
async function discover_providerRs232(rs232Type) {
const res = await requestLedDeviceDiscovery(rs232Type);
// TODO: error case unhandled
// res can be: false (timeout) or res.error (not found)
if (res && !res.error) {
const r = res.info
// Process serialPorts returned by discover
console.log(r);
}
}
//****************************
// Wizard/Routines HID (USB)-Devices
//****************************
async function discover_providerHid(hidType) {
const res = await requestLedDeviceDiscovery(hidType);
// TODO: error case unhandled
// res can be: false (timeout) or res.error (not found)
if (res && !res.error) {
const r = res.info
// Process HID returned by discover
console.log(r);
$('#btn_wiz_save').attr('disabled', false);
}
}