mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2
.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></h3>
|
||||
<h3 class="page-header"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></h3>
|
||||
<div id="conf_cont"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
24
assets/webconfig/content/conf_instcapture.html
Normal file
24
assets/webconfig/content/conf_instcapture.html
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></h3>
|
||||
|
||||
<div class="panel panel-default" style="border:0px;">
|
||||
<div class="panel-heading panel-instance" style="border-radius:3px; border-bottom:0px;">
|
||||
<div class="dropdown">
|
||||
<a id="active_instance_dropdown" class="dropdown-toggle" data-toggle="dropdown" href="#" style="text-decoration:none;display:flex;align-items:center;">
|
||||
<div id="active_instance_friendly_name"></div>
|
||||
<div id="btn_hypinstanceswitch" style="white-space:nowrap;"><span class="mdi mdi-lightbulb-group mdi-24px" style="margin-right:0; margin-left:5px;"></span><span class="mdi mdi-menu-down mdi-24px"></span></div>
|
||||
</a>
|
||||
<ul id="hyp_inst_listing" class="dropdown-menu dropdown-alerts" style="cursor:pointer;"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="conf_cont"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/js/content_instcapture.js"></script>
|
@@ -6,17 +6,17 @@
|
||||
<div class="container-fluid">
|
||||
<h3 class="page-header"><i class="mdi mdi-lightbulb-on fa-fw"></i><span data-i18n="main_menu_leds_conf_token">LED Hardware</span></h3>
|
||||
|
||||
<div class="panel panel-default" style="border:0px;">
|
||||
<div class="panel-heading panel-instance" style="border-radius:3px; border-bottom:0px;">
|
||||
<div class="dropdown">
|
||||
<a id="active_instance_dropdown" class="dropdown-toggle" data-toggle="dropdown" href="#" style="text-decoration:none;display:flex;align-items:center;">
|
||||
<div class="panel panel-default" style="border:0px;">
|
||||
<div class="panel-heading panel-instance" style="border-radius:3px; border-bottom:0px;">
|
||||
<div class="dropdown">
|
||||
<a id="active_instance_dropdown" class="dropdown-toggle" data-toggle="dropdown" href="#" style="text-decoration:none;display:flex;align-items:center;">
|
||||
<div id="active_instance_friendly_name"></div>
|
||||
<div id="btn_hypinstanceswitch" style="white-space:nowrap;"><span class="mdi mdi-lightbulb-group mdi-24px" style="margin-right:0; margin-left:5px;"></span><span class="mdi mdi-menu-down mdi-24px"></span></div>
|
||||
</a>
|
||||
<ul id="hyp_inst_listing" class="dropdown-menu dropdown-alerts" style="cursor:pointer;"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="btn_hypinstanceswitch" style="white-space:nowrap;"><span class="mdi mdi-lightbulb-group mdi-24px" style="margin-right:0; margin-left:5px;"></span><span class="mdi mdi-menu-down mdi-24px"></span></div>
|
||||
</a>
|
||||
<ul id="hyp_inst_listing" class="dropdown-menu dropdown-alerts" style="cursor:pointer;"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
@@ -37,10 +37,10 @@
|
||||
<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 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')" data-i18n="main_menu_logging_token" style="cursor:pointer"></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">
|
||||
<button id='btn_test_controller' class="btn btn-primary" 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">
|
||||
|
@@ -16,6 +16,34 @@
|
||||
<span id="dash_config_status">Status</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">
|
||||
<i class="mdi mdi-camera"></i>
|
||||
<span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td data-i18n="edt_conf_fg_heading_title">Screen-Grabber</td>
|
||||
<td style="text-align: right; padding-right: 0">
|
||||
<span id="dash_screen_grabber">disabled</span>
|
||||
<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem('MenuItemGrabber', 'editor_container_screengrabber')" style="text-decoration: none; cursor: pointer"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td data-i18n="edt_conf_v4l2_heading_title">Video-Grabber</td>
|
||||
<td style="text-align: right; padding-right: 0">
|
||||
<span id="dash_video_grabber">disabled</span>
|
||||
<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem('MenuItemGrabber', 'editor_container_videograbber')" style="text-decoration: none; cursor: pointer"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -29,22 +57,34 @@
|
||||
<tr>
|
||||
<td></td>
|
||||
<td data-i18n="dashboard_infobox_label_port_proto">proto</td>
|
||||
<td id="dash_pbPort" style="text-align:right">unknown</td>
|
||||
<td style="text-align: right; padding-right: 0">
|
||||
<span id="dash_pbPort">unknown</span>
|
||||
<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem('MenuItemNetwork', 'editor_container_protoserver')" style="text-decoration: none; cursor: pointer"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td data-i18n="dashboard_infobox_label_port_flat">flat</td>
|
||||
<td id="dash_fbPort" style="text-align:right">unknown</td>
|
||||
<td style="text-align: right; padding-right: 0">
|
||||
<span id="dash_fbPort">unknown</span>
|
||||
<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem('MenuItemNetwork', 'editor_container_fbserver')" style="text-decoration: none; cursor: pointer"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td data-i18n="dashboard_infobox_label_port_json">json</td>
|
||||
<td id="dash_jsonPort" style="text-align:right">unknown</td>
|
||||
<td style="text-align: right; padding-right: 0">
|
||||
<span id="dash_jsonPort">unknown</span>
|
||||
<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem('MenuItemNetwork', 'editor_container_jsonserver')" style="text-decoration: none; cursor: pointer"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td data-i18n="dashboard_infobox_label_ports_websocket">websocket</td>
|
||||
<td id="dash_wsPorts" style="text-align:right">unknown</td>
|
||||
<td style="text-align: right; padding-right: 0">
|
||||
<span id="dash_wsPorts">unknown</span>
|
||||
<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem('MenuItemWeb')" style="text-decoration: none; cursor: pointer"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -61,17 +101,17 @@
|
||||
<tr>
|
||||
<td></td>
|
||||
<td data-i18n="dashboard_infobox_label_currenthyp">Hyperion version:</td>
|
||||
<td id="dash_currv" style="text-align:right">unknown</td>
|
||||
<td id="dash_currv" style="text-align: right">unknown</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td data-i18n="dashboard_infobox_label_watchedversionbranch">Watched version branch:</td>
|
||||
<td id="dash_watchedversionbranch" style="text-align:right">unknown</td>
|
||||
<td id="dash_watchedversionbranch" style="text-align: right">unknown</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td data-i18n="dashboard_infobox_label_latesthyp">Latest version:</td>
|
||||
<td id="dash_latev" style="text-align:right">unknown</td>
|
||||
<td id="dash_latev" style="text-align: right">unknown</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@@ -8,6 +8,7 @@
|
||||
<div class="panel-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="username" class="form-control" type="text" id="username" value="hyperion"/>
|
||||
<input name="password" class="form-control" type="password" id="password" placeholder="Password" autocomplete="off" />
|
||||
<input name="show_pw" type="checkbox" id="show_pw" /><label for="show_pw">Show/Hide Password</label>
|
||||
</div>
|
||||
|
@@ -24,14 +24,34 @@ body{
|
||||
*/
|
||||
/* fixed brand icon */
|
||||
@media (min-width: 768px){
|
||||
.navbar-brand{position:fixed}
|
||||
#main-nav{position:absolute !important;}
|
||||
#wrapper{
|
||||
padding-left: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.navbar-brand{
|
||||
position:fixed;
|
||||
height: 80px;
|
||||
}
|
||||
#main-nav{
|
||||
position:absolute !important;
|
||||
}
|
||||
.navbar-top-links li a > .fa{
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
/*mobile nav*/
|
||||
@media (max-width: 768px){
|
||||
.navbar-toggle{position:fixed;right:0px;}
|
||||
#main-nav{position:fixed;right:-200px;}
|
||||
#wrapper{
|
||||
padding: 0px;
|
||||
}
|
||||
.navbar-toggle{
|
||||
position:fixed;right:0px;
|
||||
}
|
||||
#main-nav{
|
||||
position:fixed;right:-200px;
|
||||
}
|
||||
}
|
||||
.navbar-toggle .icon-bar {
|
||||
background-color:#4c4c4c !important;
|
||||
@@ -72,23 +92,25 @@ table.input-group{width:100%}
|
||||
@media (max-width: 767px) {.ltd{white-space:normal;}}
|
||||
|
||||
/*icon spacing*/
|
||||
.fa-fw,.mdi-24px{margin-right:5px;}
|
||||
.fa-fw, .mdi-24px{margin-right:5px;}
|
||||
|
||||
/*table*/
|
||||
table.borderless td,table.borderless th{border: none !important;}
|
||||
table.borderless td:first-child{width: 25px !important;}
|
||||
.borderless {margin-bottom:0px}
|
||||
table label{margin:0}
|
||||
table.first_cell_borderless td:first-child,table.first_cell_borderless th:first-child{border: none !important;}
|
||||
table.first_cell_borderless td:first-child{width: 25px !important;}
|
||||
|
||||
/*Header*/
|
||||
.navbar-brand{padding-top:4px;padding-bottom:0px;padding-left:2;}
|
||||
.sidebar{margin-top:65px;}
|
||||
.navbar-brand{top:0px;left:17px;padding-top:0;}
|
||||
.sidebar{margin-top:85px;}
|
||||
.dropdown{font-size:18px;}
|
||||
@media (max-width: 767px) {.sidebar{margin-top:0px;padding-top:0px !important;}}
|
||||
.page-header{margin-top:0px;}
|
||||
|
||||
.navbar-top-links li a {
|
||||
min-height: 64px;
|
||||
min-height: 84px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
@@ -216,6 +238,7 @@ table.first_cell_borderless td:first-child,table.first_cell_borderless th:first-
|
||||
.btn-transparent {
|
||||
background-color: transparent;
|
||||
border-style: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
/*general instance management button*/
|
||||
|
@@ -274,6 +274,9 @@
|
||||
"edt_conf_enum_NTSC": "NTSC",
|
||||
"edt_conf_enum_PAL": "PAL",
|
||||
"edt_conf_enum_SECAM": "SECAM",
|
||||
"edt_conf_enum_HORIZONTAL": "Horizontal",
|
||||
"edt_conf_enum_VERTICAL": "Vertikal",
|
||||
"edt_conf_enum_BOTH": "Horizontal & Vertikal",
|
||||
"edt_conf_enum_automatic": "Automatisch",
|
||||
"edt_conf_enum_bbclassic": "Klassisch",
|
||||
"edt_conf_enum_bbdefault": "Standard",
|
||||
@@ -442,6 +445,8 @@
|
||||
"edt_conf_v4l2_sizeDecimation_title": "Bildverkleinerung Faktor",
|
||||
"edt_conf_v4l2_standard_expl": "Wähle das passende Videoformat deiner Region. Auf 'Automatisch' wird der gewählte Modus vom v4l interface beibehalten.",
|
||||
"edt_conf_v4l2_standard_title": "Videoformat",
|
||||
"edt_conf_v4l2_flip_expl": "Hiermit kannst du das Bild in horizontaler, vertikaler oder beiden Richtung spiegeln.",
|
||||
"edt_conf_v4l2_flip_title": "Spiegelung",
|
||||
"edt_conf_webc_crtPath_expl": "Pfad zur Zertifikats-Datei (Format sollte PEM sein)",
|
||||
"edt_conf_webc_crtPath_title": "Zertifikats-Pfad",
|
||||
"edt_conf_webc_docroot_expl": "Lokaler Pfad zum WebUI Wurzelverzeichnis (Nur für WebUI Entwickler)",
|
||||
|
@@ -5,11 +5,13 @@
|
||||
"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_nostorage_text": "Your browser does not support localStorage. You cannot save a specific language setting (fallback to 'auto detection') and access level (fallback to 'default'). Some wizards may be hidden. You could still use the webinterface without further issues",
|
||||
"InfoDialog_nostorage_title": "Cannot store settings",
|
||||
"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_password_current_text": "Current password",
|
||||
"infoDialog_password_new_text": "New password",
|
||||
"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",
|
||||
@@ -42,7 +44,8 @@
|
||||
"conf_general_intro": "Basic settings around Hyperion and WebUI that don't fit into another category.",
|
||||
"conf_general_label_title": "General settings",
|
||||
"conf_grabber_fg_intro": "Screen capture is your local system capture as input source, Hyperion is installed on.",
|
||||
"conf_grabber_v4l_intro": "USB capture is a (capture)device connected via USB which is used to input source pictures for processing.",
|
||||
"conf_grabber_inst_grabber_config_info": "Configure your capturing hardware devices to be used by the instance in advance",
|
||||
"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",
|
||||
@@ -127,10 +130,12 @@
|
||||
"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_other": "Other",
|
||||
"conf_leds_optgroup_usb": "USB/Serial",
|
||||
"conf_logging_btn_autoscroll": "Auto scrolling",
|
||||
"conf_logging_btn_clipboard": "Copy Log to Clipboard",
|
||||
"conf_logging_btn_pbupload": "Upload a report for support requests",
|
||||
"conf_logging_contpolicy": "Report Privacy Policy",
|
||||
"conf_logging_label_intro": "Area to check log messages, you will see more or less information depending on the logging level set.",
|
||||
@@ -274,6 +279,9 @@
|
||||
"edt_conf_enum_NTSC": "NTSC",
|
||||
"edt_conf_enum_PAL": "PAL",
|
||||
"edt_conf_enum_SECAM": "SECAM",
|
||||
"edt_conf_enum_HORIZONTAL": "Horizontal",
|
||||
"edt_conf_enum_VERTICAL": "Vertical",
|
||||
"edt_conf_enum_BOTH": "Horizontal & Vertical",
|
||||
"edt_conf_enum_automatic": "Automatic",
|
||||
"edt_conf_enum_bbclassic": "Classic",
|
||||
"edt_conf_enum_bbdefault": "Default",
|
||||
@@ -358,11 +366,20 @@
|
||||
"edt_conf_general_port_title": "Port",
|
||||
"edt_conf_general_priority_expl": "The priority of this component",
|
||||
"edt_conf_general_priority_title": "Priority channel",
|
||||
"edt_conf_instC_systemEnable_expl": "Enables the screen capture for this LED hardware instance",
|
||||
"edt_conf_grabber_discovered_expl": "Select your capture device discovered",
|
||||
"edt_conf_grabber_discovered_none": "No capture device discovered",
|
||||
"edt_conf_grabber_discovered_title": "Device discovered",
|
||||
"edt_conf_grabber_discovered_title_info": "Select your capture device discovered",
|
||||
"edt_conf_grabber_discovery_inprogress": "Discovery in progress",
|
||||
"edt_conf_instC_screen_grabber_device_expl": "The screen capture device used",
|
||||
"edt_conf_instC_screen_grabber_device_title": "Screen capture device",
|
||||
"edt_conf_instC_systemEnable_expl": "Enables the screen capture for this led hardware instance",
|
||||
"edt_conf_instC_systemEnable_title": "Enable screen capture",
|
||||
"edt_conf_instC_v4lEnable_expl": "Enables the USB capture for this LED hardware instance",
|
||||
"edt_conf_instC_v4lEnable_title": "Enable USB capture",
|
||||
"edt_conf_instCapture_heading_title": "Instance Capture",
|
||||
"edt_conf_instC_video_grabber_device_expl": "The video capture device used",
|
||||
"edt_conf_instC_video_grabber_device_title": "Video capture device",
|
||||
"edt_conf_instCapture_heading_title": "Capture Devices",
|
||||
"edt_conf_js_heading_title": "JSON Server",
|
||||
"edt_conf_log_heading_title": "Logging",
|
||||
"edt_conf_log_level_expl": "Depending on loglevel you see less or more messages in your log.",
|
||||
@@ -415,6 +432,8 @@
|
||||
"edt_conf_v4l2_cropRight_title": "Crop right",
|
||||
"edt_conf_v4l2_cropTop_expl": "Count of pixels on the top side that are removed from the picture.",
|
||||
"edt_conf_v4l2_cropTop_title": "Crop top",
|
||||
"edt_conf_v4l2_cropWidthValidation_error": "Crop left + Crop right cannot be greater than Width ($1)",
|
||||
"edt_conf_v4l2_cropHeightValidation_error": "Crop top + Crop bottom cannot be greater than Height ($1)",
|
||||
"edt_conf_v4l2_device_expl": "The path to the USB capture interface. Set to 'Automatic' for automatic detection. Example: '/dev/video0'",
|
||||
"edt_conf_v4l2_device_title": "Device",
|
||||
"edt_conf_v4l2_framerate_expl": "The supported frames per second of the active device",
|
||||
@@ -442,6 +461,24 @@
|
||||
"edt_conf_v4l2_sizeDecimation_title": "Size decimation",
|
||||
"edt_conf_v4l2_standard_expl": "Select the video standard for your region. 'Automatic' keeps the value chosen by the v4l2 interface.",
|
||||
"edt_conf_v4l2_standard_title": "Video standard",
|
||||
"edt_conf_v4l2_flip_expl": "This allows you to flip the image horizontally, vertically, or both.",
|
||||
"edt_conf_v4l2_flip_title": "Image flip",
|
||||
"edt_conf_v4l2_fpsSoftwareDecimation_title": "Software frame skipping",
|
||||
"edt_conf_v4l2_fpsSoftwareDecimation_expl": "To save resources every n'th frame will be processed only. For ex. if grabber is set to 30FPS with this option set to 5 the final result will be around 6FPS (1 - disabled)",
|
||||
"edt_conf_v4l2_encoding_title": "Encoding format",
|
||||
"edt_conf_v4l2_encoding_expl": "Force video encoding for multiformat capable grabbers",
|
||||
"edt_conf_v4l2_hardware_brightness_title": "Hardware brightness control",
|
||||
"edt_conf_v4l2_hardware_brightness_expl": "Set hardware brightness if device supports it, check logs (0=disabled)",
|
||||
"edt_conf_v4l2_hardware_contrast_title": "Hardware contrast control",
|
||||
"edt_conf_v4l2_hardware_contrast_expl": "Set hardware contrast if device supports it, check logs (0=disabled)",
|
||||
"edt_conf_v4l2_hardware_hue_title": "Hardware hue control",
|
||||
"edt_conf_v4l2_hardware_hue_expl": "Set hardware hue if device supports it, check logs (0=disabled)",
|
||||
"edt_conf_v4l2_hardware_saturation_title": "Hardware saturation control",
|
||||
"edt_conf_v4l2_hardware_saturation_expl": "Set hardware saturation if device supports it, check logs (0=disabled)",
|
||||
"edt_conf_v4l2_hardware_set_defaults": "Default hardware controls",
|
||||
"edt_conf_v4l2_hardware_set_defaults_tip": "Set device's default values for brightness, contrast, hue and saturation",
|
||||
"edt_conf_v4l2_noSignalCounterThreshold_title": "Signal Counter Threshold",
|
||||
"edt_conf_v4l2_noSignalCounterThreshold_expl": "Count of frames (check that with grabber's current FPS mode) after which the no signal is triggered",
|
||||
"edt_conf_webc_crtPath_expl": "Path to the certification file (format should be PEM)",
|
||||
"edt_conf_webc_crtPath_title": "Certificate path",
|
||||
"edt_conf_webc_docroot_expl": "Local webinterface root path (just for webui developer)",
|
||||
@@ -607,6 +644,7 @@
|
||||
"edt_eff_height": "Height",
|
||||
"edt_eff_huechange": "Color change",
|
||||
"edt_eff_image": "Image file",
|
||||
"edt_eff_initial_blink" : "Flash for attention",
|
||||
"edt_eff_interval": "Interval",
|
||||
"edt_eff_knightrider_header": "Knight Rider",
|
||||
"edt_eff_knightrider_header_desc": "K.I.T.T is back! The front-scanner of the well known car, this time not just in red.",
|
||||
@@ -644,6 +682,7 @@
|
||||
"edt_eff_reversedirection": "Reverse direction",
|
||||
"edt_eff_rotationtime": "Rotation time",
|
||||
"edt_eff_saturation": "Saturation",
|
||||
"edt_eff_set_post_color" : "Set post color after alam",
|
||||
"edt_eff_showseconds": "Show seconds",
|
||||
"edt_eff_sleeptime": "Sleep time",
|
||||
"edt_eff_smooth_custom": "Enable smoothing",
|
||||
@@ -748,11 +787,11 @@
|
||||
"general_comp_BOBLIGHTSERVER": "Boblight Server",
|
||||
"general_comp_FLATBUFSERVER": "Flatbuffers Server",
|
||||
"general_comp_FORWARDER": "Forwarder",
|
||||
"general_comp_GRABBER": "Screen Capture",
|
||||
"general_comp_LEDDEVICE": "LED device",
|
||||
"general_comp_GRABBER": "Capture Screen",
|
||||
"general_comp_LEDDEVICE": "LED Output",
|
||||
"general_comp_PROTOSERVER": "Protocol Buffers Server",
|
||||
"general_comp_SMOOTHING": "Smoothing",
|
||||
"general_comp_V4L": "USB Capture",
|
||||
"general_comp_V4L": "Capture USB-Input",
|
||||
"general_country_cn": "China",
|
||||
"general_country_de": "Germany",
|
||||
"general_country_es": "Spain",
|
||||
@@ -812,6 +851,7 @@
|
||||
"main_ledsim_btn_togglelednumber": "LED numbers",
|
||||
"main_ledsim_btn_toggleleds": "Show LEDs",
|
||||
"main_ledsim_btn_togglelivevideo": "Live video",
|
||||
"main_ledsim_btn_togglesigdetect": "Signal detection area",
|
||||
"main_ledsim_text": "Live visualization of LED colors and optional the current video stream of your capture device.",
|
||||
"main_ledsim_title": "LED Visualization",
|
||||
"main_menu_about_token": "About Hyperion",
|
||||
@@ -823,7 +863,8 @@
|
||||
"main_menu_general_conf_token": "General",
|
||||
"main_menu_grabber_conf_token": "Capturing Hardware",
|
||||
"main_menu_input_selection_token": "Input Selection",
|
||||
"main_menu_leds_conf_token": "LED Hardware",
|
||||
"main_menu_instcapture_conf_token": "Sources",
|
||||
"main_menu_leds_conf_token": "LED Output",
|
||||
"main_menu_logging_token": "Log",
|
||||
"main_menu_network_conf_token": "Network Services",
|
||||
"main_menu_remotecontrol_token": "Remote Control",
|
||||
@@ -956,6 +997,7 @@
|
||||
"wiz_hue_title": "Philips Hue Wizard",
|
||||
"wiz_hue_username": "User ID:",
|
||||
"wiz_identify": "Identify",
|
||||
"wiz_identify_tip": "Identify configured device by lighting it up",
|
||||
"wiz_identify_light": "Identify $1",
|
||||
"wiz_ids_disabled": "Deactivated",
|
||||
"wiz_ids_entire": "Whole picture",
|
||||
@@ -974,4 +1016,4 @@
|
||||
"wiz_yeelight_intro1": "This wizards configures Hyperion for the Yeelight system. Features are the Yeelighs' auto detection, setting each light to a specific position on your picture or disable it and tune the Hyperion settings automatically! So in short: All you need are some clicks and you are done!",
|
||||
"wiz_yeelight_title": "Yeelight Wizard",
|
||||
"wiz_yeelight_unsupported": "Unsupported"
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
Binary file not shown.
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 15 KiB |
@@ -2,359 +2,365 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<script>
|
||||
if (/MSIE/.test(navigator.userAgent) || /Trident/.test(navigator.userAgent))
|
||||
{
|
||||
window.location.pathname = '/content/ie_not_supported.html';
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
if (/MSIE/.test(navigator.userAgent) || /Trident/.test(navigator.userAgent)) {
|
||||
window.location.pathname = '/content/ie_not_supported.html';
|
||||
}
|
||||
</script>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
|
||||
<meta name="description" content="Hyperion Web Configuration">
|
||||
<meta name="msapplication-TileColor" content="#91989C">
|
||||
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
|
||||
<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" href="/favicon.png" sizes="32x32">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
|
||||
<meta name="description" content="Hyperion Web Configuration">
|
||||
<meta name="msapplication-TileColor" content="#91989C">
|
||||
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
|
||||
<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" href="/favicon.png" sizes="32x32">
|
||||
|
||||
<title data-i18n="general_webui_title">Hyperion - Web Configuration</title>
|
||||
<title data-i18n="general_webui_title">Hyperion - Web Configuration</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="js/lib/jquery.min.js"></script>
|
||||
<!-- jQuery -->
|
||||
<script src="js/lib/jquery.min.js"></script>
|
||||
|
||||
<!-- SemVer -->
|
||||
<script src='js/lib/semver.js'></script>
|
||||
<!-- SemVer -->
|
||||
<script src='js/lib/semver.js'></script>
|
||||
|
||||
<!-- md Stuff -->
|
||||
<script src="js/lib/marked.min.js"></script>
|
||||
<script type="text/javascript" src="js/lib/purify.min.js"></script>
|
||||
<!-- md Stuff -->
|
||||
<script src="js/lib/marked.min.js"></script>
|
||||
<script type="text/javascript" src="js/lib/purify.min.js"></script>
|
||||
|
||||
<!-- Hyperion -->
|
||||
<script src="js/hyperion.js"></script>
|
||||
<script src="js/ui_utils.js"></script>
|
||||
<!-- Hyperion -->
|
||||
<script src="js/hyperion.js"></script>
|
||||
<script src="js/ui_utils.js"></script>
|
||||
|
||||
<!-- Colorpicker -->
|
||||
<script src="js/lib/bootstrap-colorpicker.min.js"></script>
|
||||
<!-- Colorpicker -->
|
||||
<script src="js/lib/bootstrap-colorpicker.min.js"></script>
|
||||
|
||||
<!-- BS Notfiy -->
|
||||
<script src="js/lib/bootstrap-notify.min.js"></script>
|
||||
<!-- BS Notfiy -->
|
||||
<script src="js/lib/bootstrap-notify.min.js"></script>
|
||||
|
||||
<!-- JSONEditor -->
|
||||
<script src="js/lib/jsoneditor.js"></script>
|
||||
<!-- JSONEditor -->
|
||||
<script src="js/lib/jsoneditor.js"></script>
|
||||
|
||||
<!--Language Support -->
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.js"></script>
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.messagestore.js"></script>
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.fallbacks.js"></script>
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.parser.js"></script>
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.emitter.js"></script>
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.language.js"></script>
|
||||
<script src="js/lib/jquery.i18n/CLDRPluralRuleParser.js"></script>
|
||||
<!--Language Support -->
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.js"></script>
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.messagestore.js"></script>
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.fallbacks.js"></script>
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.parser.js"></script>
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.emitter.js"></script>
|
||||
<script src="js/lib/jquery.i18n/jquery.i18n.language.js"></script>
|
||||
<script src="js/lib/jquery.i18n/CLDRPluralRuleParser.js"></script>
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="js/languages.js"></script>
|
||||
|
||||
<link href="css/bootstrap-colorpicker.min.css" rel="stylesheet">
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- BSToggle -->
|
||||
<link href="css/bootstrap-toggle.min.css" rel="stylesheet">
|
||||
<link href="css/bootstrap-colorpicker.min.css" rel="stylesheet">
|
||||
|
||||
<!-- BSSelect -->
|
||||
<link href="css/bootstrap-select.min.css" rel="stylesheet">
|
||||
<!-- BSToggle -->
|
||||
<link href="css/bootstrap-toggle.min.css" rel="stylesheet">
|
||||
|
||||
<!-- MetisMenu CSS -->
|
||||
<link href="css/metisMenu.css" rel="stylesheet">
|
||||
<!-- BSSelect -->
|
||||
<link href="css/bootstrap-select.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link href="css/sb-admin-2.css" rel="stylesheet">
|
||||
<link href="css/hyperion.css" rel="stylesheet">
|
||||
<!-- MetisMenu CSS -->
|
||||
<link href="css/metisMenu.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom Fonts -->
|
||||
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||||
<!-- Custom CSS -->
|
||||
<link href="css/sb-admin-2.css" rel="stylesheet">
|
||||
<link href="css/hyperion.css" rel="stylesheet">
|
||||
|
||||
<!-- Material Design Icons - https://github.com/Templarian/MaterialDesign-Webfont -->
|
||||
<link href="css/materialdesignicons.min.css" media="all" rel="stylesheet" type="text/css">
|
||||
<!-- Custom Fonts -->
|
||||
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<!-- Material Design Icons - https://github.com/Templarian/MaterialDesign-Webfont -->
|
||||
<link href="css/materialdesignicons.min.css" media="all" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>
|
||||
<div style="color:red;margin: 40px 0;text-align:center">
|
||||
<img src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!">
|
||||
<h3>Hyperion Web Configuration requires Javascript. Please enable Javascript in your browser for this page in order to use it!</h3>
|
||||
</div>
|
||||
<style type="text/css"> #loading_overlay, #wrapper{ display: none } </style>
|
||||
</noscript>
|
||||
<noscript>
|
||||
<div style="color:red;margin: 40px 0;text-align:center">
|
||||
<img src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!">
|
||||
<h3>Hyperion Web Configuration requires Javascript. Please enable Javascript in your browser for this page in order to use it!</h3>
|
||||
</div>
|
||||
<style type="text/css">
|
||||
#loading_overlay, #wrapper {
|
||||
display: none
|
||||
}
|
||||
</style>
|
||||
</noscript>
|
||||
|
||||
<div id="loading_overlay" class="overlay"></div>
|
||||
<div id="wrapper">
|
||||
<div id="loading_overlay" class="overlay"></div>
|
||||
<div id="wrapper">
|
||||
|
||||
<!-- Navigation -->
|
||||
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0; min-height: 65px">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle closed" aria-controls="navbar">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar top-bar"></span>
|
||||
<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" target="_blank"><img id="navbar_brand_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!" height="60"></a>
|
||||
<!-- Navigation -->
|
||||
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0; min-height: 85px">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle closed" aria-controls="navbar">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar top-bar"></span>
|
||||
<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" target="_blank"><img id="navbar_brand_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!" height="80"></a>
|
||||
|
||||
</div>
|
||||
<!-- /.navbar-header -->
|
||||
</div>
|
||||
<!-- /.navbar-header -->
|
||||
|
||||
<ul class="nav navbar-top-links navbar-right" id="top-navbar">
|
||||
<!-- Browser built in capture stream - streamer.js -->
|
||||
<li class="dropdown" id="btn_streamer" style="display:none">
|
||||
<!-- Hidden helpers -->
|
||||
<canvas style="display:none" id="streamcanvas"></canvas>
|
||||
<video style="display:none" id="streamvideo" autoplay></video>
|
||||
<a>
|
||||
<i id="btn_streamer_icon" class="fa fa-video-camera fa-fw"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown" id="btn_darkmode">
|
||||
<a>
|
||||
<i id="btn_darkmode_icon" class="fa fa-moon-o"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown" id="btn_open_ledsim">
|
||||
<a>
|
||||
<i class="fa fa-television fa-fw"></i>
|
||||
</a>
|
||||
</li>
|
||||
<!-- /.dropdown -->
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-magic fa-fw"></i> <i class="fa fa-caret-down"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-alerts">
|
||||
<li id="btn_wizard_byteorder">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-magic fa-fw"></i>
|
||||
<span data-i18n="wiz_rgb_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li id="btn_wizard_colorcalibration">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-magic fa-fw"></i>
|
||||
<span data-i18n="wiz_cc_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<!-- /.dropdown -->
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-wrench fa-fw"></i> <i class="fa fa-caret-down"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-alerts">
|
||||
<ul class="nav navbar-top-links navbar-right" id="top-navbar">
|
||||
<!-- Browser built in capture stream - streamer.js -->
|
||||
<li class="dropdown" id="btn_streamer" style="display:none">
|
||||
<!-- Hidden helpers -->
|
||||
<canvas style="display:none" id="streamcanvas"></canvas>
|
||||
<video style="display:none" id="streamvideo" autoplay></video>
|
||||
<a>
|
||||
<i id="btn_streamer_icon" class="fa fa-video-camera fa-fw"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown" id="btn_darkmode">
|
||||
<a>
|
||||
<i id="btn_darkmode_icon" class="fa fa-moon-o"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown" id="btn_open_ledsim">
|
||||
<a>
|
||||
<i class="fa fa-television fa-fw"></i>
|
||||
</a>
|
||||
</li>
|
||||
<!-- /.dropdown -->
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-magic fa-fw"></i> <i class="fa fa-caret-down"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-alerts">
|
||||
<li id="btn_wizard_byteorder">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-magic fa-fw"></i>
|
||||
<span data-i18n="wiz_rgb_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li id="btn_wizard_colorcalibration">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-magic fa-fw"></i>
|
||||
<span data-i18n="wiz_cc_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<!-- /.dropdown -->
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-wrench fa-fw"></i> <i class="fa fa-caret-down"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-alerts">
|
||||
|
||||
<!-- /.language selector -->
|
||||
<li id="btn_setlang">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-globe"></i>
|
||||
<select id="language-select" class="selectpicker" data-width="fit" data-style="btn-transparent" > </select>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li id="btn_setaccess">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-wrench fa-fw"></i>
|
||||
<span data-i18n="InfoDialog_access_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li id="btn_changePassword">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-key fa-fw"></i>
|
||||
<span data-i18n="InfoDialog_changePassword_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<!-- /.language selector -->
|
||||
<li id="btn_setlang">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-globe fa-fw"></i>
|
||||
<select id="language-select" class="selectpicker" data-width="fit" data-style="btn-transparent"> </select>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li id="btn_setaccess">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-wrench fa-fw"></i>
|
||||
<span data-i18n="InfoDialog_access_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li id="btn_changePassword">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-key fa-fw"></i>
|
||||
<span data-i18n="InfoDialog_changePassword_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<!-- /.lock-ui -->
|
||||
<li class="dropdown" id="btn_lock_ui" style="display:none">
|
||||
<a>
|
||||
<i class="fa fa-lock fa-fw"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- /.navbar-top-left -->
|
||||
<!-- /.lock-ui -->
|
||||
<li class="dropdown" id="btn_lock_ui" style="display:none">
|
||||
<a>
|
||||
<i class="fa fa-lock fa-fw"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- /.navbar-top-left -->
|
||||
|
||||
<div id="main-nav" class="navbar-default sidebar" role="navigation">
|
||||
<div class="sidebar-nav navbar-collapse">
|
||||
<ul class="nav" id="side-menu">
|
||||
<li> <a class="inactive mnava" href="#dashboard"><i class="fa fa-dashboard fa-fw"></i><span data-i18n="main_menu_dashboard_token">Dashboard</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#conf_general"><i class="fa fa-wrench fa-fw"></i><span data-i18n="main_menu_general_conf_token">General</span></a> </li>
|
||||
<li>
|
||||
<a class="inactive"><i class="fa fa-cog fa-fw"></i><span data-i18n="main_menu_configuration_token">Configuration</span><span class="fa arrow"></span></a>
|
||||
<ul class="nav nav-second-level">
|
||||
<li> <a class="inactive mnava" href="#conf_leds"><i class="mdi mdi-lightbulb-on fa-fw"></i><span data-i18n="main_menu_leds_conf_token">LED Hardware</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#conf_effect"><i class="fa fa-spinner fa-fw"></i><span data-i18n="main_menu_effect_conf_token">Effects</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#conf_colors"><i class="fa fa-photo fa-fw"></i><span data-i18n="main_menu_colors_conf_token">Image Processing</span></a> </li>
|
||||
</ul>
|
||||
</li>
|
||||
<li> <a class="inactive mnava" href="#conf_grabber"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#conf_network"><i class="fa fa-sitemap fa-fw"></i><span data-i18n="main_menu_network_conf_token">Network</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#remote"><i class="fa fa-wifi fa-fw"></i><span data-i18n="main_menu_remotecontrol_token">Remote Control</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#effects_configurator"><i class="fa fa-cogs fa-fw"></i><span data-i18n="main_menu_effectsconfigurator_token">Effects Configurator</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#support"><i class="fa fa-info fa-fw"></i><span data-i18n="main_menu_support_token">Support</span></a> </li>
|
||||
<li>
|
||||
<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" 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>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.sidebar-collapse -->
|
||||
</div>
|
||||
<!-- /.navbar-static-side -->
|
||||
</nav>
|
||||
<div id="main-nav" class="navbar-default sidebar" role="navigation">
|
||||
<div class="sidebar-nav navbar-collapse">
|
||||
<ul class="nav" id="side-menu">
|
||||
<li> <a class="inactive mnava" href="#dashboard"><i class="fa fa-dashboard fa-fw"></i><span data-i18n="main_menu_dashboard_token">Dashboard</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#conf_general"><i class="fa fa-wrench fa-fw"></i><span data-i18n="main_menu_general_conf_token">General</span></a> </li>
|
||||
<li>
|
||||
<a class="inactive"><i class="fa fa-cog fa-fw"></i><span data-i18n="main_menu_configuration_token">LED-Instances</span><span class="fa arrow"></span></a>
|
||||
<ul class="nav nav-second-level">
|
||||
<li> <a class="inactive mnava" id="MenuItemLeds" href="#conf_leds"><i class="mdi mdi-lightbulb-on fa-fw"></i><span data-i18n="main_menu_leds_conf_token">LED Hardware</span></a> </li>
|
||||
<li> <a class="inactive mnava" id="MenuItemInstCapture" href="#conf_instcapture"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_instcapture_conf_token">Sources</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#conf_effect"><i class="fa fa-spinner fa-fw"></i><span data-i18n="main_menu_effect_conf_token">Effects</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#conf_colors"><i class="fa fa-photo fa-fw"></i><span data-i18n="main_menu_colors_conf_token">Image Processing</span></a> </li>
|
||||
</ul>
|
||||
</li>
|
||||
<li> <a class="inactive mnava" id="MenuItemGrabber" href="#conf_grabber"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></a> </li>
|
||||
<li> <a class="inactive mnava" id="MenuItemNetwork" href="#conf_network"><i class="fa fa-sitemap fa-fw"></i><span data-i18n="main_menu_network_conf_token">Network</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#remote"><i class="fa fa-wifi fa-fw"></i><span data-i18n="main_menu_remotecontrol_token">Remote Control</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#effects_configurator"><i class="fa fa-cogs fa-fw"></i><span data-i18n="main_menu_effectsconfigurator_token">Effects Configurator</span></a> </li>
|
||||
<li> <a class="inactive mnava" href="#support"><i class="fa fa-info fa-fw"></i><span data-i18n="main_menu_support_token">Support</span></a> </li>
|
||||
<li>
|
||||
<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" id="MenuItemWeb" 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" 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>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- /.sidebar-collapse -->
|
||||
</div>
|
||||
<!-- /.navbar-static-side -->
|
||||
</nav>
|
||||
|
||||
<!-- Page Content -->
|
||||
<div id="page-wrapper" style="padding-top:10px; overflow: hidden;">
|
||||
<div id="hyperion_disabled_notify" style="display:none;padding:0 10px;margin:0">
|
||||
<div class="bs-callout bs-callout-danger">
|
||||
<h4 data-i18n="dashboard_alert_message_disabled_t"></h4>
|
||||
<span data-i18n="dashboard_alert_message_disabled"></span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Page Content -->
|
||||
<div id="page-wrapper" style="padding-top:10px; overflow: hidden;">
|
||||
<div id="hyperion_disabled_notify" style="display:none;padding:0 10px;margin:0">
|
||||
<div class="bs-callout bs-callout-danger">
|
||||
<h4 data-i18n="dashboard_alert_message_disabled_t"></h4>
|
||||
<span data-i18n="dashboard_alert_message_disabled"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="page-content"></div>
|
||||
</div>
|
||||
<div id="page-content"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- /#wrapper -->
|
||||
</div>
|
||||
<!-- /#wrapper -->
|
||||
|
||||
<div id="container_connection_lost" style="display:none"></div>
|
||||
<div id="container_restart" style="display:none"></div>
|
||||
<div id="container_connection_lost" style="display:none"></div>
|
||||
<div id="container_restart" style="display:none"></div>
|
||||
|
||||
<!-- infoDialog -->
|
||||
<div id="modal_dialog" class="modal fade" role="dialog" style="z-index:9999">
|
||||
<div class="modal-dialog">
|
||||
<center>
|
||||
<div class="modal-content">
|
||||
<div id="id_body" class="modal-body"></div>
|
||||
<div id="id_footer" class="modal-footer" style="text-align:center"></div>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<!-- infoDialog -->
|
||||
<div id="modal_dialog" class="modal fade" role="dialog" style="z-index:9999">
|
||||
<div class="modal-dialog">
|
||||
<center>
|
||||
<div class="modal-content">
|
||||
<div id="id_body" class="modal-body"></div>
|
||||
<div id="id_footer" class="modal-footer" style="text-align:center"></div>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- renameDialog -->
|
||||
<div id="modal_dialog_rename" class="modal fade" role="dialog" style="z-index:9999">
|
||||
<div class="modal-dialog">
|
||||
<center>
|
||||
<div class="modal-content">
|
||||
<div id="id_body_rename" class="modal-body"></div>
|
||||
<div id="id_footer_rename" class="modal-footer" style="text-align:center"></div>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<!-- renameDialog -->
|
||||
<div id="modal_dialog_rename" class="modal fade" role="dialog" style="z-index:9999">
|
||||
<div class="modal-dialog">
|
||||
<center>
|
||||
<div class="modal-content">
|
||||
<div id="id_body_rename" class="modal-body"></div>
|
||||
<div id="id_footer_rename" class="modal-footer" style="text-align:center"></div>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- wizardDialog -->
|
||||
<div id="wizard_modal" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div id="wiz_header" class="modal-header"></div>
|
||||
<div id="wizp1">
|
||||
<div class="modal-body" style="text-align:center">
|
||||
<img id="wizard_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!" style="margin-bottom:15px">
|
||||
<div id="wizp1_body" ></div>
|
||||
</div>
|
||||
<div id="wizp1_footer" class="modal-footer" style="text-align:center"></div>
|
||||
</div>
|
||||
<div id="wizp2" style="display:none">
|
||||
<center>
|
||||
<div class="modal-body">
|
||||
<img id="wizard_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!" style="margin-bottom:15px">
|
||||
<div id="wizp2_body"></div>
|
||||
</div>
|
||||
</center>
|
||||
<div id="wizp2_footer" class="modal-footer" style="text-align:center"></div>
|
||||
</div>
|
||||
<div id="wizp3" style="display:none">
|
||||
<center>
|
||||
<div class="modal-body">
|
||||
<img id="wizard_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!" style="margin-bottom:15px">
|
||||
<div id="wizp3_body"></div>
|
||||
</div>
|
||||
</center>
|
||||
<div id="wizp3_footer" class="modal-footer" style="text-align:center"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- wizardDialog -->
|
||||
<div id="wizard_modal" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div id="wiz_header" class="modal-header"></div>
|
||||
<div id="wizp1">
|
||||
<div class="modal-body" style="text-align:center">
|
||||
<img id="wizard_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!" style="margin-bottom:15px">
|
||||
<div id="wizp1_body"></div>
|
||||
</div>
|
||||
<div id="wizp1_footer" class="modal-footer" style="text-align:center"></div>
|
||||
</div>
|
||||
<div id="wizp2" style="display:none">
|
||||
<center>
|
||||
<div class="modal-body">
|
||||
<img id="wizard_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!" style="margin-bottom:15px">
|
||||
<div id="wizp2_body"></div>
|
||||
</div>
|
||||
</center>
|
||||
<div id="wizp2_footer" class="modal-footer" style="text-align:center"></div>
|
||||
</div>
|
||||
<div id="wizp3" style="display:none">
|
||||
<center>
|
||||
<div class="modal-body">
|
||||
<img id="wizard_logo" src="img/hyperion/logo_positiv.png" alt="Redefine ambient light!" style="margin-bottom:15px">
|
||||
<div id="wizp3_body"></div>
|
||||
</div>
|
||||
</center>
|
||||
<div id="wizp3_footer" class="modal-footer" style="text-align:center"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ledsimDialog -->
|
||||
<div id="ledsim_dialog" style="display:none; z-index:9998">
|
||||
<div data-role="body" style="padding:0px;">
|
||||
<div id="ledsim_text"></div>
|
||||
<div id="leds_canvas"></div>
|
||||
</div>
|
||||
<div data-role="footer" style="text-align:center">
|
||||
<button type="button" class="btn btn-success" id="leds_toggle"><i class="fa fa-fw fa-lightbulb-o"></i><span data-i18n="main_ledsim_btn_toggleleds">leds</span></button>
|
||||
<button type="button" class="btn btn-danger" id="leds_toggle_num"> <i class="fa fa-fw fa-info"></i><span data-i18n="main_ledsim_btn_togglelednumber">led numbers</span></button>
|
||||
<button type="button" class="btn btn-danger" id="leds_toggle_live_video"><i class="fa fa-fw fa-television"></i><span data-i18n="main_ledsim_btn_togglelivevideo">live video</span></button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ledsimDialog -->
|
||||
<div id="ledsim_dialog" style="display:none; z-index:9998">
|
||||
<div data-role="body" style="padding:0px;">
|
||||
<div id="ledsim_text"></div>
|
||||
<div id="leds_canvas"></div>
|
||||
</div>
|
||||
<div data-role="footer" style="text-align:center">
|
||||
<button type="button" class="btn btn-success" id="leds_toggle"><i class="fa fa-fw fa-lightbulb-o"></i><span data-i18n="main_ledsim_btn_toggleleds">leds</span></button>
|
||||
<button type="button" class="btn btn-danger" id="leds_toggle_num"> <i class="fa fa-fw fa-info"></i><span data-i18n="main_ledsim_btn_togglelednumber">led numbers</span></button>
|
||||
<button type="button" class="btn btn-danger" id="sigDetectArea_toggle"><i class="fa fa-fw fa-info"></i><span data-i18n="main_ledsim_btn_togglesigdetect">signal detection area</span></button>
|
||||
<button type="button" class="btn btn-danger" id="leds_toggle_live_video"><i class="fa fa-fw fa-television"></i><span data-i18n="main_ledsim_btn_togglelivevideo">live video</span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap Core JavaScript -->
|
||||
<script src="js/lib/bootstrap.min.js"></script>
|
||||
<!-- Bootstrap Core JavaScript -->
|
||||
<script src="js/lib/bootstrap.min.js"></script>
|
||||
|
||||
<!-- BSToggle -->
|
||||
<script src="js/lib/bootstrap-toggle.min.js"></script>
|
||||
<!-- BSToggle -->
|
||||
<script src="js/lib/bootstrap-toggle.min.js"></script>
|
||||
|
||||
<!-- Bootstrap Select JavaScript -->
|
||||
<script src="js/lib/bootstrap-select.min.js"></script>
|
||||
<!-- Bootstrap Select JavaScript -->
|
||||
<script src="js/lib/bootstrap-select.min.js"></script>
|
||||
|
||||
<!-- Metis Menu Plugin JavaScript -->
|
||||
<script src="js/lib/metisMenu.min.js"></script>
|
||||
<!-- Metis Menu Plugin JavaScript -->
|
||||
<script src="js/lib/metisMenu.min.js"></script>
|
||||
|
||||
<!-- Custom Theme JavaScript -->
|
||||
<script src="js/lib/sb-admin-2.js"></script>
|
||||
<!-- Custom Theme JavaScript -->
|
||||
<script src="js/lib/sb-admin-2.js"></script>
|
||||
|
||||
<script src="js/content_index.js"></script>
|
||||
<script src="js/settings.js"></script>
|
||||
<script src="js/streamer.js"></script>
|
||||
<script src="js/wizard.js"></script>
|
||||
<script src="js/content_index.js"></script>
|
||||
<script src="js/settings.js"></script>
|
||||
<script src="js/streamer.js"></script>
|
||||
<script src="js/wizard.js"></script>
|
||||
|
||||
<!--gijgo dialog-->
|
||||
<script src="js/lib/draggable.min.js"></script>
|
||||
<script src="js/lib/dialog.min.js"></script>
|
||||
<script src="js/ledsim.js"></script>
|
||||
<!--gijgo dialog-->
|
||||
<script src="js/lib/draggable.min.js"></script>
|
||||
<script src="js/lib/dialog.min.js"></script>
|
||||
<script src="js/ledsim.js"></script>
|
||||
|
||||
<!--Client-side download-->
|
||||
<script src='js/lib/download.min.js'></script>
|
||||
<!--Client-side download-->
|
||||
<script src='js/lib/download.min.js'></script>
|
||||
|
||||
<!--JsonAceEditor-->
|
||||
<script src='js/lib/jsonaceeditor.min.js'></script>
|
||||
<link href="css/jsonaceeditor.min.css" rel="stylesheet" type="text/css">
|
||||
<!--JsonAceEditor-->
|
||||
<script src='js/lib/jsonaceeditor.min.js'></script>
|
||||
<link href="css/jsonaceeditor.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -13,7 +13,6 @@ $(document).ready(function () {
|
||||
instances_html += '</a><ul id="hyp_inst_listing" class="dropdown-menu dropdown-alerts" style="cursor:pointer;"></ul>'
|
||||
instances_html += '</div></div>';
|
||||
|
||||
|
||||
instances_html += '<div class="panel-body">';
|
||||
instances_html += '<table class="table borderless">';
|
||||
instances_html += '<thead><tr><th style="vertical-align:middle"><i class="mdi mdi-lightbulb-on fa-fw"></i>';
|
||||
@@ -39,10 +38,13 @@ $(document).ready(function () {
|
||||
instances_html += '<i class="fa fa-info-circle fa-fw"></i>';
|
||||
instances_html += '<span>' + $.i18n('dashboard_infobox_label_title') + '</span>';
|
||||
instances_html += '</th></tr></thead>';
|
||||
instances_html += '<tbody><tr><td></td>';
|
||||
instances_html += '<td>' + $.i18n('conf_leds_contr_label_contrtype') + '</td>';
|
||||
instances_html += '<td style="text-align:right">' + window.serverConfig.device.type + '</td>';
|
||||
instances_html += '</tr><tr></tbody></table>';
|
||||
instances_html += '<tbody>';
|
||||
instances_html += '<tr><td></td><td>' + $.i18n('conf_leds_contr_label_contrtype') + '</td>';
|
||||
instances_html += '<td style="text-align:right; padding-right:0">';
|
||||
instances_html += '<span>' + window.serverConfig.device.type + '</span>';
|
||||
instances_html += '<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem(\'MenuItemLeds\')" style="text-decoration:none;cursor:pointer"></a>';
|
||||
instances_html += '</td></tr>';
|
||||
instances_html += '</tbody></table>';
|
||||
|
||||
instances_html += '<table class="table first_cell_borderless">';
|
||||
instances_html += '<thead><tr><th colspan="3">';
|
||||
@@ -50,28 +52,35 @@ $(document).ready(function () {
|
||||
instances_html += '<span>' + $.i18n('dashboard_componentbox_label_title') + '</span>';
|
||||
instances_html += '</th></tr></thead>';
|
||||
|
||||
var tab_components = "";
|
||||
var componentBtn = "";
|
||||
var instance_components = "";
|
||||
for (var idx = 0; idx < components.length; idx++) {
|
||||
if (components[idx].name != "ALL") {
|
||||
var comp_enabled = components[idx].enabled ? "checked" : "";
|
||||
const general_comp = "general_comp_" + components[idx].name;
|
||||
var componentBtn = '<input ' +
|
||||
'id="' + general_comp + '" ' + comp_enabled +
|
||||
' type="checkbox" ' +
|
||||
'data-toggle="toggle" ' +
|
||||
'data-size="mini" ' +
|
||||
'data-onstyle="success" ' +
|
||||
'data-on="' + $.i18n('general_btn_on') + '" ' +
|
||||
'data-off="' + $.i18n('general_btn_off') + '">';
|
||||
if ((components[idx].name === "FORWARDER" && window.currentHyperionInstance != 0) ||
|
||||
(components[idx].name === "GRABBER" && !window.serverConfig.framegrabber.enable) ||
|
||||
(components[idx].name === "V4L" && !window.serverConfig.grabberV4L2.enable))
|
||||
continue;
|
||||
|
||||
tab_components += '<tr><td></td><td>' + $.i18n('general_comp_' + components[idx].name) + '</td><td style="text-align:right">' + componentBtn + '</td></tr>';
|
||||
var comp_enabled = components[idx].enabled ? "checked" : "";
|
||||
const general_comp = "general_comp_" + components[idx].name;
|
||||
componentBtn = '<input ' +
|
||||
'id="' + general_comp + '" ' + comp_enabled +
|
||||
' type="checkbox" ' +
|
||||
'data-toggle="toggle" ' +
|
||||
'data-size="mini" ' +
|
||||
'data-onstyle="success" ' +
|
||||
'data-on="' + $.i18n('general_btn_on') + '" ' +
|
||||
'data-off="' + $.i18n('general_btn_off') + '">';
|
||||
|
||||
instance_components += '<tr><td></td><td>' + $.i18n('general_comp_' + components[idx].name) + '</td><td style="text-align:right">' + componentBtn + '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
instances_html += '<tbody>' + tab_components + '</tbody></table>';
|
||||
instances_html += '<tbody>' + instance_components + '</tbody></table>';
|
||||
instances_html += '</div></div></div>';
|
||||
|
||||
$('.instances').prepend(instances_html);
|
||||
|
||||
updateUiOnInstance(window.currentHyperionInstance);
|
||||
updateHyperionInstanceListing();
|
||||
|
||||
@@ -83,7 +92,7 @@ $(document).ready(function () {
|
||||
for (var idx = 0; idx < components.length; idx++) {
|
||||
if (components[idx].name != "ALL") {
|
||||
$("#general_comp_" + components[idx].name).bootstrapToggle();
|
||||
$("#general_comp_" + components[idx].name).bootstrapToggle(hyperion_enabled ? "enable" : "disable")
|
||||
$("#general_comp_" + components[idx].name).bootstrapToggle(hyperion_enabled ? "enable" : "disable");
|
||||
$("#general_comp_" + components[idx].name).change(e => {
|
||||
requestSetComponentState(e.currentTarget.id.split('_')[2], e.currentTarget.checked);
|
||||
});
|
||||
@@ -92,6 +101,12 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
// add more info
|
||||
|
||||
var screenGrabber = window.serverConfig.framegrabber.enable ? $.i18n('general_enabled') : $.i18n('general_disabled');
|
||||
$('#dash_screen_grabber').html(screenGrabber);
|
||||
var videoGrabber = window.serverConfig.grabberV4L2.enable ? $.i18n('general_enabled') : $.i18n('general_disabled');
|
||||
$('#dash_video_grabber').html(videoGrabber);
|
||||
|
||||
var fbPort = window.serverConfig.flatbufServer.enable ? window.serverConfig.flatbufServer.port : $.i18n('general_disabled');
|
||||
$('#dash_fbPort').html(fbPort);
|
||||
var pbPort = window.serverConfig.protoServer.enable ? window.serverConfig.protoServer.port : $.i18n('general_disabled');
|
||||
|
@@ -1,196 +1,182 @@
|
||||
$(document).ready( function() {
|
||||
performTranslation();
|
||||
$(document).ready(function () {
|
||||
performTranslation();
|
||||
|
||||
var importedConf;
|
||||
var confName;
|
||||
var conf_editor = null;
|
||||
var importedConf;
|
||||
var confName;
|
||||
var conf_editor = null;
|
||||
|
||||
$('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_gen_heading_title"), 'editor_container', 'btn_submit', 'panel-system'));
|
||||
if(window.showOptHelp)
|
||||
{
|
||||
$('#conf_cont').append(createHelpTable(window.schema.general.properties, $.i18n("edt_conf_gen_heading_title")));
|
||||
}
|
||||
else
|
||||
$('#conf_imp').appendTo('#conf_cont');
|
||||
$('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_gen_heading_title"), 'editor_container', 'btn_submit', 'panel-system'));
|
||||
if (window.showOptHelp) {
|
||||
$('#conf_cont').append(createHelpTable(window.schema.general.properties, $.i18n("edt_conf_gen_heading_title")));
|
||||
}
|
||||
else
|
||||
$('#conf_imp').appendTo('#conf_cont');
|
||||
|
||||
conf_editor = createJsonEditor('editor_container', {
|
||||
general: window.schema.general
|
||||
}, true, true);
|
||||
conf_editor = createJsonEditor('editor_container', {
|
||||
general: window.schema.general
|
||||
}, true, true);
|
||||
|
||||
conf_editor.on('change',function() {
|
||||
conf_editor.validate().length || window.readOnlyMode ? $('#btn_submit').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
});
|
||||
conf_editor.on('change', function () {
|
||||
conf_editor.validate().length || window.readOnlyMode ? $('#btn_submit').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
});
|
||||
|
||||
$('#btn_submit').off().on('click',function() {
|
||||
requestWriteConfig(conf_editor.getValue());
|
||||
});
|
||||
$('#btn_submit').off().on('click', function () {
|
||||
window.showOptHelp = conf_editor.getEditor("root.general.showOptHelp").getValue();
|
||||
requestWriteConfig(conf_editor.getValue());
|
||||
});
|
||||
|
||||
// Instance handling
|
||||
function handleInstanceRename(e)
|
||||
{
|
||||
// Instance handling
|
||||
function handleInstanceRename(e) {
|
||||
|
||||
conf_editor.on('change',function() {
|
||||
window.readOnlyMode ? $('#btn_cl_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
window.readOnlyMode ? $('#btn_ma_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
});
|
||||
conf_editor.on('change', function () {
|
||||
window.readOnlyMode ? $('#btn_cl_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
window.readOnlyMode ? $('#btn_ma_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
});
|
||||
|
||||
var inst = e.currentTarget.id.split("_")[1];
|
||||
showInfoDialog('renInst', $.i18n('conf_general_inst_renreq_t'), getInstanceNameByIndex(inst));
|
||||
var inst = e.currentTarget.id.split("_")[1];
|
||||
showInfoDialog('renInst', $.i18n('conf_general_inst_renreq_t'), getInstanceNameByIndex(inst));
|
||||
|
||||
$("#id_btn_ok").off().on('click', function(){
|
||||
requestInstanceRename(inst, $('#renInst_name').val())
|
||||
});
|
||||
$("#id_btn_ok").off().on('click', function () {
|
||||
requestInstanceRename(inst, $('#renInst_name').val())
|
||||
});
|
||||
|
||||
$('#renInst_name').off().on('input',function(e) {
|
||||
(e.currentTarget.value.length >= 5 && e.currentTarget.value != getInstanceNameByIndex(inst)) ? $('#id_btn_ok').attr('disabled', false) : $('#id_btn_ok').attr('disabled', true);
|
||||
});
|
||||
}
|
||||
$('#renInst_name').off().on('input', function (e) {
|
||||
(e.currentTarget.value.length >= 5 && e.currentTarget.value != getInstanceNameByIndex(inst)) ? $('#id_btn_ok').attr('disabled', false) : $('#id_btn_ok').attr('disabled', true);
|
||||
});
|
||||
}
|
||||
|
||||
function handleInstanceDelete(e)
|
||||
{
|
||||
var inst = e.currentTarget.id.split("_")[1];
|
||||
showInfoDialog('delInst',$.i18n('conf_general_inst_delreq_h'),$.i18n('conf_general_inst_delreq_t',getInstanceNameByIndex(inst)));
|
||||
$("#id_btn_yes").off().on('click', function(){
|
||||
requestInstanceDelete(inst)
|
||||
});
|
||||
}
|
||||
function handleInstanceDelete(e) {
|
||||
var inst = e.currentTarget.id.split("_")[1];
|
||||
showInfoDialog('delInst', $.i18n('conf_general_inst_delreq_h'), $.i18n('conf_general_inst_delreq_t', getInstanceNameByIndex(inst)));
|
||||
$("#id_btn_yes").off().on('click', function () {
|
||||
requestInstanceDelete(inst)
|
||||
});
|
||||
}
|
||||
|
||||
function buildInstanceList()
|
||||
{
|
||||
var inst = serverInfo.instance
|
||||
$('.itbody').html("");
|
||||
for(var key in inst)
|
||||
{
|
||||
var enable_style = inst[key].running ? "checked" : "";
|
||||
var renameBtn = '<button id="instren_'+inst[key].instance+'" type="button" class="btn btn-primary"><i class="mdi mdi-lead-pencil""></i></button>';
|
||||
var startBtn = ""
|
||||
var delBtn = "";
|
||||
if(inst[key].instance > 0)
|
||||
{
|
||||
delBtn = '<button id="instdel_'+inst[key].instance+'" type="button" class="btn btn-danger"><i class="mdi mdi-delete-forever""></i></button>';
|
||||
startBtn = '<input id="inst_'+inst[key].instance+'"'+enable_style+' type="checkbox" data-toggle="toggle" data-onstyle="success font-weight-bold" data-on="'+$.i18n('general_btn_on')+'" data-offstyle="default font-weight-bold" data-off="'+$.i18n('general_btn_off')+'">';
|
||||
function buildInstanceList() {
|
||||
var inst = serverInfo.instance
|
||||
$('.itbody').html("");
|
||||
for (var key in inst) {
|
||||
var enable_style = inst[key].running ? "checked" : "";
|
||||
var renameBtn = '<button id="instren_' + inst[key].instance + '" type="button" class="btn btn-primary"><i class="mdi mdi-lead-pencil""></i></button>';
|
||||
var startBtn = ""
|
||||
var delBtn = "";
|
||||
if (inst[key].instance > 0) {
|
||||
delBtn = '<button id="instdel_' + inst[key].instance + '" type="button" class="btn btn-danger"><i class="mdi mdi-delete-forever""></i></button>';
|
||||
startBtn = '<input id="inst_' + inst[key].instance + '"' + enable_style + ' type="checkbox" data-toggle="toggle" data-onstyle="success font-weight-bold" data-on="' + $.i18n('general_btn_on') + '" data-offstyle="default font-weight-bold" data-off="' + $.i18n('general_btn_off') + '">';
|
||||
|
||||
}
|
||||
$('.itbody').append(createTableRow([inst[key].friendly_name, startBtn, renameBtn, delBtn], false, true));
|
||||
$('#instren_'+inst[key].instance).off().on('click', handleInstanceRename);
|
||||
}
|
||||
$('.itbody').append(createTableRow([inst[key].friendly_name, startBtn, renameBtn, delBtn], false, true));
|
||||
$('#instren_' + inst[key].instance).off().on('click', handleInstanceRename);
|
||||
|
||||
$('#inst_'+inst[key].instance).bootstrapToggle();
|
||||
$('#inst_'+inst[key].instance).change(e => {
|
||||
requestInstanceStartStop(e.currentTarget.id.split('_').pop(), e.currentTarget.checked);
|
||||
});
|
||||
$('#instdel_'+inst[key].instance).off().on('click', handleInstanceDelete);
|
||||
$('#inst_' + inst[key].instance).bootstrapToggle();
|
||||
$('#inst_' + inst[key].instance).change(e => {
|
||||
requestInstanceStartStop(e.currentTarget.id.split('_').pop(), e.currentTarget.checked);
|
||||
});
|
||||
$('#instdel_' + inst[key].instance).off().on('click', handleInstanceDelete);
|
||||
|
||||
window.readOnlyMode ? $('#instren_'+inst[key].instance).attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
window.readOnlyMode ? $('#inst_'+inst[key].instance).attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
window.readOnlyMode ? $('#instdel_'+inst[key].instance).attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
}
|
||||
}
|
||||
window.readOnlyMode ? $('#instren_' + inst[key].instance).attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
window.readOnlyMode ? $('#inst_' + inst[key].instance).attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
window.readOnlyMode ? $('#instdel_' + inst[key].instance).attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
createTable('ithead', 'itbody', 'itable');
|
||||
$('.ithead').html(createTableRow([$.i18n('conf_general_inst_namehead'), "", $.i18n('conf_general_inst_actionhead'), ""], true, true));
|
||||
buildInstanceList();
|
||||
createTable('ithead', 'itbody', 'itable');
|
||||
$('.ithead').html(createTableRow([$.i18n('conf_general_inst_namehead'), "", $.i18n('conf_general_inst_actionhead'), ""], true, true));
|
||||
buildInstanceList();
|
||||
|
||||
$('#inst_name').off().on('input',function(e) {
|
||||
(e.currentTarget.value.length >= 5) && !window.readOnlyMode ? $('#btn_create_inst').attr('disabled', false) : $('#btn_create_inst').attr('disabled', true);
|
||||
if(5-e.currentTarget.value.length >= 1 && 5-e.currentTarget.value.length <= 4)
|
||||
$('#inst_chars_needed').html(5-e.currentTarget.value.length + " " + $.i18n('general_chars_needed'))
|
||||
else
|
||||
$('#inst_chars_needed').html("<br />")
|
||||
});
|
||||
$('#inst_name').off().on('input', function (e) {
|
||||
(e.currentTarget.value.length >= 5) && !window.readOnlyMode ? $('#btn_create_inst').attr('disabled', false) : $('#btn_create_inst').attr('disabled', true);
|
||||
if (5 - e.currentTarget.value.length >= 1 && 5 - e.currentTarget.value.length <= 4)
|
||||
$('#inst_chars_needed').html(5 - e.currentTarget.value.length + " " + $.i18n('general_chars_needed'))
|
||||
else
|
||||
$('#inst_chars_needed').html("<br />")
|
||||
});
|
||||
|
||||
$('#btn_create_inst').off().on('click',function(e) {
|
||||
requestInstanceCreate($('#inst_name').val());
|
||||
$('#inst_name').val("");
|
||||
$('#btn_create_inst').attr('disabled', true)
|
||||
});
|
||||
$('#btn_create_inst').off().on('click', function (e) {
|
||||
requestInstanceCreate($('#inst_name').val());
|
||||
$('#inst_name').val("");
|
||||
$('#btn_create_inst').attr('disabled', true)
|
||||
});
|
||||
|
||||
$(hyperion).off("instance-updated").on("instance-updated", function(event) {
|
||||
buildInstanceList()
|
||||
});
|
||||
$(hyperion).off("instance-updated").on("instance-updated", function (event) {
|
||||
buildInstanceList()
|
||||
});
|
||||
|
||||
//import
|
||||
function dis_imp_btn(state)
|
||||
{
|
||||
state || window.readOnlyMode ? $('#btn_import_conf').attr('disabled', true) : $('#btn_import_conf').attr('disabled', false);
|
||||
}
|
||||
//import
|
||||
function dis_imp_btn(state) {
|
||||
state || window.readOnlyMode ? $('#btn_import_conf').attr('disabled', true) : $('#btn_import_conf').attr('disabled', false);
|
||||
}
|
||||
|
||||
function readFile(evt)
|
||||
{
|
||||
var f = evt.target.files[0];
|
||||
function readFile(evt) {
|
||||
var f = evt.target.files[0];
|
||||
|
||||
if (f)
|
||||
{
|
||||
var r = new FileReader();
|
||||
r.onload = function(e)
|
||||
{
|
||||
var content = e.target.result.replace(/[^:]?\/\/.*/g, ''); //remove Comments
|
||||
if (f) {
|
||||
var r = new FileReader();
|
||||
r.onload = function (e) {
|
||||
var content = e.target.result.replace(/[^:]?\/\/.*/g, ''); //remove Comments
|
||||
|
||||
//check file is json
|
||||
var check = isJsonString(content);
|
||||
if(check.length != 0)
|
||||
{
|
||||
showInfoDialog('error', "", $.i18n('infoDialog_import_jsonerror_text', f.name, JSON.stringify(check)));
|
||||
dis_imp_btn(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
content = JSON.parse(content);
|
||||
//check for hyperion json
|
||||
if(typeof content.leds === 'undefined' || typeof content.general === 'undefined')
|
||||
{
|
||||
showInfoDialog('error', "", $.i18n('infoDialog_import_hyperror_text', f.name));
|
||||
dis_imp_btn(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
dis_imp_btn(false);
|
||||
importedConf = content;
|
||||
confName = f.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
r.readAsText(f);
|
||||
}
|
||||
}
|
||||
//check file is json
|
||||
var check = isJsonString(content);
|
||||
if (check.length != 0) {
|
||||
showInfoDialog('error', "", $.i18n('infoDialog_import_jsonerror_text', f.name, JSON.stringify(check)));
|
||||
dis_imp_btn(true);
|
||||
}
|
||||
else {
|
||||
content = JSON.parse(content);
|
||||
//check for hyperion json
|
||||
if (typeof content.leds === 'undefined' || typeof content.general === 'undefined') {
|
||||
showInfoDialog('error', "", $.i18n('infoDialog_import_hyperror_text', f.name));
|
||||
dis_imp_btn(true);
|
||||
}
|
||||
else {
|
||||
dis_imp_btn(false);
|
||||
importedConf = content;
|
||||
confName = f.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
r.readAsText(f);
|
||||
}
|
||||
}
|
||||
|
||||
$('#btn_import_conf').off().on('click', function(){
|
||||
showInfoDialog('import', $.i18n('infoDialog_import_confirm_title'), $.i18n('infoDialog_import_confirm_text', confName));
|
||||
$('#btn_import_conf').off().on('click', function () {
|
||||
showInfoDialog('import', $.i18n('infoDialog_import_confirm_title'), $.i18n('infoDialog_import_confirm_text', confName));
|
||||
|
||||
$('#id_btn_import').off().on('click', function(){
|
||||
requestWriteConfig(importedConf, true);
|
||||
setTimeout(initRestart, 100);
|
||||
});
|
||||
});
|
||||
$('#id_btn_import').off().on('click', function () {
|
||||
requestWriteConfig(importedConf, true);
|
||||
setTimeout(initRestart, 100);
|
||||
});
|
||||
});
|
||||
|
||||
$('#select_import_conf').off().on('change', function(e){
|
||||
if (window.File && window.FileReader && window.FileList && window.Blob)
|
||||
readFile(e);
|
||||
else
|
||||
showInfoDialog('error', "", $.i18n('infoDialog_import_comperror_text'));
|
||||
});
|
||||
$('#select_import_conf').off().on('change', function (e) {
|
||||
if (window.File && window.FileReader && window.FileList && window.Blob)
|
||||
readFile(e);
|
||||
else
|
||||
showInfoDialog('error', "", $.i18n('infoDialog_import_comperror_text'));
|
||||
});
|
||||
|
||||
//export
|
||||
$('#btn_export_conf').off().on('click', function(){
|
||||
var name = window.serverConfig.general.name;
|
||||
//export
|
||||
$('#btn_export_conf').off().on('click', function () {
|
||||
var name = window.serverConfig.general.name;
|
||||
|
||||
var d = new Date();
|
||||
var month = d.getMonth()+1;
|
||||
var day = d.getDate();
|
||||
var d = new Date();
|
||||
var month = d.getMonth() + 1;
|
||||
var day = d.getDate();
|
||||
|
||||
var timestamp = d.getFullYear() + '.' +
|
||||
(month<10 ? '0' : '') + month + '.' +
|
||||
(day<10 ? '0' : '') + day;
|
||||
var timestamp = d.getFullYear() + '.' +
|
||||
(month < 10 ? '0' : '') + month + '.' +
|
||||
(day < 10 ? '0' : '') + day;
|
||||
|
||||
download(JSON.stringify(window.serverConfig, null, "\t"), 'Hyperion-'+window.currentVersion+'-Backup ('+name+') '+timestamp+'.json', "application/json");
|
||||
});
|
||||
download(JSON.stringify(window.serverConfig, null, "\t"), 'Hyperion-' + window.currentVersion + '-Backup (' + name + ') ' + timestamp + '.json', "application/json");
|
||||
});
|
||||
|
||||
//create introduction
|
||||
if(window.showOptHelp)
|
||||
{
|
||||
createHint("intro", $.i18n('conf_general_intro'), "editor_container");
|
||||
createHint("intro", $.i18n('conf_general_tok_desc'), "tok_desc_cont");
|
||||
createHint("intro", $.i18n('conf_general_inst_desc'), "inst_desc_cont");
|
||||
}
|
||||
//create introduction
|
||||
if (window.showOptHelp) {
|
||||
createHint("intro", $.i18n('conf_general_intro'), "editor_container");
|
||||
createHint("intro", $.i18n('conf_general_tok_desc'), "tok_desc_cont");
|
||||
createHint("intro", $.i18n('conf_general_inst_desc'), "inst_desc_cont");
|
||||
}
|
||||
|
||||
removeOverlay();
|
||||
removeOverlay();
|
||||
});
|
||||
|
1055
assets/webconfig/js/content_grabber.js
Normal file → Executable file
1055
assets/webconfig/js/content_grabber.js
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
@@ -307,12 +307,17 @@ $(document).ready(function () {
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
|
||||
$(window).scroll(function(){
|
||||
$(window).scroll(function() {
|
||||
if ($(window).scrollTop() > 65)
|
||||
$("#navbar_brand_logo").css("display", "none");
|
||||
else
|
||||
$("#navbar_brand_logo").css("display", "");
|
||||
});
|
||||
});
|
||||
|
||||
$('#side-menu li a, #side-menu li ul li a').click(function() {
|
||||
$('#side-menu').find('.active').toggleClass('inactive'); // find all active classes and set inactive;
|
||||
$(this).addClass('active');
|
||||
});
|
||||
});
|
||||
|
||||
function suppressDefaultPwWarning() {
|
||||
@@ -349,7 +354,7 @@ $("#btn_darkmode").off().on("click", function (e) {
|
||||
});
|
||||
|
||||
// Menuitem toggle;
|
||||
function SwitchToMenuItem(target) {
|
||||
function SwitchToMenuItem(target, item) {
|
||||
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;
|
||||
@@ -357,6 +362,21 @@ function SwitchToMenuItem(target) {
|
||||
$('#' + 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;
|
||||
cl_object.addClass('in'); // Add class "in" to expand header in sidebar menu;
|
||||
if (item) { // Jump to div "item" if available. Time limit 3 seconds
|
||||
function scrollTo(counter) {
|
||||
if(counter < 30) {
|
||||
setTimeout(function() {
|
||||
counter++;
|
||||
if ($('#' + item).length)
|
||||
$('#' + item)[0].scrollIntoView();
|
||||
else
|
||||
scrollTo(counter);
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
scrollTo(0);
|
||||
}
|
||||
};
|
||||
|
||||
|
99
assets/webconfig/js/content_instcapture.js
Normal file
99
assets/webconfig/js/content_instcapture.js
Normal file
@@ -0,0 +1,99 @@
|
||||
$(document).ready(function () {
|
||||
performTranslation();
|
||||
|
||||
// update instance listing
|
||||
updateHyperionInstanceListing();
|
||||
|
||||
var conf_editor_instCapt = null;
|
||||
|
||||
// Instance Capture
|
||||
$('#conf_cont').append(createRow('conf_cont_instCapt'));
|
||||
$('#conf_cont_instCapt').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt', ''));
|
||||
if (window.showOptHelp) {
|
||||
$('#conf_cont_instCapt').append(createHelpTable(window.schema.instCapture.properties, $.i18n("edt_conf_instCapture_heading_title")));
|
||||
}
|
||||
|
||||
// Instance Capture
|
||||
conf_editor_instCapt = createJsonEditor('editor_container_instCapt', {
|
||||
instCapture: window.schema.instCapture
|
||||
}, true, true);
|
||||
|
||||
var grabber_config_info_html = '<div class="bs-callout bs-callout-info" style="margin-top:0px"><h4>' + $.i18n('dashboard_infobox_label_title') + '</h4 >';
|
||||
grabber_config_info_html += '<span>' + $.i18n('conf_grabber_inst_grabber_config_info') + '</span>';
|
||||
grabber_config_info_html += '<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem(\'MenuItemGrabber\')" style="text-decoration:none;cursor:pointer"></a>';
|
||||
grabber_config_info_html += '</div>';
|
||||
$('#editor_container_instCapt').append(grabber_config_info_html);
|
||||
|
||||
conf_editor_instCapt.on('ready', function () {
|
||||
|
||||
if (!window.serverConfig.framegrabber.enable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemEnable").setValue(false);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemEnable").disable();
|
||||
}
|
||||
else {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemEnable").setValue(window.serverConfig.instCapture.systemEnable);
|
||||
}
|
||||
|
||||
if (!window.serverConfig.grabberV4L2.enable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").setValue(false);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").disable();
|
||||
}
|
||||
else {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").setValue(window.serverConfig.instCapture.v4lEnable);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
conf_editor_instCapt.on('change', function () {
|
||||
|
||||
if (!conf_editor_instCapt.validate().length) {
|
||||
if (!window.serverConfig.framegrabber.enable && !window.serverConfig.grabberV4L2.enable) {
|
||||
$('#btn_submit_instCapt').attr('disabled', true);
|
||||
} else {
|
||||
window.readOnlyMode ? $('#btn_submit_instCapt').attr('disabled', true) : $('#btn_submit_instCapt').attr('disabled', false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('#btn_submit_instCapt').attr('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
conf_editor_instCapt.watch('root.instCapture.systemEnable', () => {
|
||||
|
||||
var screenEnable = conf_editor_instCapt.getEditor("root.instCapture.systemEnable").getValue();
|
||||
if (screenEnable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemGrabberDevice").setValue(window.serverConfig.framegrabber.available_devices);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemGrabberDevice").disable();
|
||||
showInputOptions("instCapture", ["systemGrabberDevice"], true);
|
||||
showInputOptions("instCapture", ["systemPriority"], true);
|
||||
|
||||
} else {
|
||||
showInputOptions("instCapture", ["systemGrabberDevice"], false);
|
||||
showInputOptions("instCapture", ["systemPriority"], false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
conf_editor_instCapt.watch('root.instCapture.v4lEnable', () => {
|
||||
var videoEnable = conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").getValue();
|
||||
if (videoEnable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lGrabberDevice").setValue(window.serverConfig.grabberV4L2.available_devices);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lGrabberDevice").disable();
|
||||
showInputOptions("instCapture", ["v4lGrabberDevice"], true);
|
||||
showInputOptions("instCapture", ["v4lPriority"], true);
|
||||
}
|
||||
else {
|
||||
if (!window.serverConfig.grabberV4L2.enable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").disable();
|
||||
}
|
||||
showInputOptions("instCapture", ["v4lGrabberDevice"], false);
|
||||
showInputOptions("instCapture", ["v4lPriority"], false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#btn_submit_instCapt').off().on('click', function () {
|
||||
requestWriteConfig(conf_editor_instCapt.getValue());
|
||||
});
|
||||
|
||||
removeOverlay();
|
||||
});
|
@@ -701,6 +701,8 @@ $(document).ready(function () {
|
||||
var hwLedCountDefault = 1;
|
||||
var colorOrderDefault = "rgb";
|
||||
|
||||
$('#btn_test_controller').hide();
|
||||
|
||||
switch (ledType) {
|
||||
case "cololight":
|
||||
case "wled":
|
||||
@@ -769,11 +771,38 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
conf_editor.on('change', function () {
|
||||
//Check, if device can be identified/tested and/or saved
|
||||
// //Check, if device can be identified/tested and/or saved
|
||||
var canIdentify = false;
|
||||
var canSave = false;
|
||||
|
||||
switch (ledType) {
|
||||
|
||||
case "atmoorb":
|
||||
case "fadecandy":
|
||||
case "tinkerforge":
|
||||
case "tpm2net":
|
||||
case "udpe131":
|
||||
case "udpartnet":
|
||||
case "udph801":
|
||||
case "udpraw":
|
||||
var host = conf_editor.getEditor("root.specificOptions.host").getValue();
|
||||
if (host !== "") {
|
||||
canSave = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case "philipshue":
|
||||
var host = conf_editor.getEditor("root.specificOptions.host").getValue();
|
||||
var username = conf_editor.getEditor("root.specificOptions.username").getValue();
|
||||
if (host !== "" && username != "") {
|
||||
var useEntertainmentAPI = conf_editor.getEditor("root.specificOptions.useEntertainmentAPI").getValue();
|
||||
var clientkey = conf_editor.getEditor("root.specificOptions.clientkey").getValue();
|
||||
if (!useEntertainmentAPI || clientkey !== "") {
|
||||
canSave = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "cololight":
|
||||
case "wled":
|
||||
var hostList = conf_editor.getEditor("root.specificOptions.hostList").getValue();
|
||||
@@ -797,48 +826,20 @@ $(document).ready(function () {
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "adalight":
|
||||
var output = conf_editor.getEditor("root.specificOptions.output").getValue();
|
||||
if (output !== "NONE" && output !== "SELECT" && output !== "") {
|
||||
canIdentify = true;
|
||||
}
|
||||
case "atmo":
|
||||
case "dmx":
|
||||
case "karate":
|
||||
case "sedu":
|
||||
case "tpm2":
|
||||
case "apa102":
|
||||
case "apa104":
|
||||
case "ws2801":
|
||||
case "lpd6803":
|
||||
case "lpd8806":
|
||||
case "p9813":
|
||||
case "sk6812spi":
|
||||
case "sk6822spi":
|
||||
case "sk9822":
|
||||
case "ws2812spi":
|
||||
case "piblaster":
|
||||
var output = conf_editor.getEditor("root.specificOptions.output").getValue();
|
||||
if (output !== "NONE" && output !== "SELECT" && output !== "") {
|
||||
canSave = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
canIdentify = false;
|
||||
canSave = true;
|
||||
}
|
||||
|
||||
if (canIdentify) {
|
||||
$("#btn_test_controller").removeClass('hidden');
|
||||
$('#btn_test_controller').attr('disabled', false);
|
||||
}
|
||||
else {
|
||||
$('#btn_test_controller').attr('disabled', true);
|
||||
}
|
||||
|
||||
var hardwareLedCount = conf_editor.getEditor("root.generalOptions.hardwareLedCount").getValue();
|
||||
if (hardwareLedCount < 1) {
|
||||
if (!conf_editor.validate().length) {
|
||||
if (canIdentify) {
|
||||
$("#btn_test_controller").show();
|
||||
$('#btn_test_controller').attr('disabled', false);
|
||||
} else {
|
||||
$('#btn_test_controller').hide();
|
||||
$('#btn_test_controller').attr('disabled', true);
|
||||
}
|
||||
} else {
|
||||
canSave = false;
|
||||
}
|
||||
|
||||
@@ -886,9 +887,9 @@ $(document).ready(function () {
|
||||
conf_editor.getEditor(specOptPath + "host").setValue(val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
showAllDeviceInputOptions("hostList", showOptions);
|
||||
showAllDeviceInputOptions("hostList", showOptions);
|
||||
}
|
||||
});
|
||||
|
||||
conf_editor.watch('root.specificOptions.host', () => {
|
||||
@@ -900,8 +901,10 @@ $(document).ready(function () {
|
||||
else {
|
||||
let params = {};
|
||||
switch (ledType) {
|
||||
|
||||
case "cololight":
|
||||
params = { host: host };
|
||||
getProperties_device(ledType, host, params);
|
||||
break;
|
||||
|
||||
case "nanoleaf":
|
||||
@@ -910,33 +913,70 @@ $(document).ready(function () {
|
||||
return;
|
||||
}
|
||||
params = { host: host, token: token };
|
||||
getProperties_device(ledType, host, params);
|
||||
break;
|
||||
|
||||
case "wled":
|
||||
params = { host: host, filter: "info" };
|
||||
getProperties_device(ledType, host, params);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
getProperties_device(ledType, host, params);
|
||||
}
|
||||
});
|
||||
|
||||
conf_editor.watch('root.specificOptions.output', () => {
|
||||
var output = conf_editor.getEditor("root.specificOptions.output").getValue();
|
||||
if (output === "NONE" || output === "SELECT" || output === "") {
|
||||
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_test_controller').attr('disabled', true);
|
||||
$('#btn_test_controller').hide();
|
||||
|
||||
conf_editor.getEditor("root.generalOptions.hardwareLedCount").setValue(1);
|
||||
showAllDeviceInputOptions("output", false);
|
||||
}
|
||||
else {
|
||||
showAllDeviceInputOptions("output", true);
|
||||
let params = {};
|
||||
var canIdentify = false;
|
||||
switch (ledType) {
|
||||
case "adalight":
|
||||
canIdentify = true;
|
||||
break;
|
||||
case "atmo":
|
||||
case "karate":
|
||||
params = { serialPort: output };
|
||||
getProperties_device(ledType, output, params);
|
||||
break;
|
||||
case "dmx":
|
||||
case "sedu":
|
||||
case "tpm2":
|
||||
case "apa102":
|
||||
case "apa104":
|
||||
case "ws2801":
|
||||
case "lpd6803":
|
||||
case "lpd8806":
|
||||
case "p9813":
|
||||
case "sk6812spi":
|
||||
case "sk6822spi":
|
||||
case "sk9822":
|
||||
case "ws2812spi":
|
||||
case "piblaster":
|
||||
default:
|
||||
}
|
||||
|
||||
if (!conf_editor.validate().length) {
|
||||
if (canIdentify) {
|
||||
$("#btn_test_controller").show();
|
||||
$('#btn_test_controller').attr('disabled', false);
|
||||
} else {
|
||||
$('#btn_test_controller').hide();
|
||||
$('#btn_test_controller').attr('disabled', true);
|
||||
}
|
||||
if (!window.readOnlyMode) {
|
||||
$('#btn_submit_controller').attr('disabled', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1229,6 +1269,8 @@ function saveLedConfig(genDefLayout = false) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Rewrite whole LED & Layout configuration, in case changes were done accross tabs and no default layout
|
||||
if (genDefLayout !== true) {
|
||||
result.ledConfig = getLedConfig();
|
||||
@@ -1269,8 +1311,6 @@ var updateSelectList = function (ledType, discoveryInfo) {
|
||||
ledTypeGroup = "devRPiGPIO";
|
||||
}
|
||||
|
||||
var specOpt = conf_editor.getEditor('root.specificOptions'); // get specificOptions of the editor
|
||||
|
||||
switch (ledTypeGroup) {
|
||||
case "devNET":
|
||||
key = "hostList";
|
||||
@@ -1434,11 +1474,14 @@ var updateSelectList = function (ledType, discoveryInfo) {
|
||||
}
|
||||
|
||||
if (enumVals.length > 0) {
|
||||
updateJsonEditorSelection(specOpt, key, addSchemaElements, enumVals, enumTitelVals, enumDefaultVal, addSelect, addCustom);
|
||||
updateJsonEditorSelection(conf_editor, 'root.specificOptions', key, addSchemaElements, enumVals, enumTitelVals, enumDefaultVal, addSelect, addCustom);
|
||||
}
|
||||
};
|
||||
|
||||
async function discover_device(ledType, params) {
|
||||
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
|
||||
const result = await requestLedDeviceDiscovery(ledType, params);
|
||||
|
||||
var discoveryResult;
|
||||
@@ -1479,6 +1522,7 @@ async function getProperties_device(ledType, key, params) {
|
||||
}
|
||||
else {
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_test_controller').attr('disabled', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1544,8 +1588,7 @@ function updateElements(ledType, key) {
|
||||
if (ledProperties && ledProperties.ledCount) {
|
||||
if (ledProperties.ledCount.length > 0) {
|
||||
var configuredLedCount = window.serverConfig.device.hardwareLedCount;
|
||||
var generalOpt = conf_editor.getEditor('root.generalOptions');
|
||||
updateJsonEditorSelection(generalOpt, "hardwareLedCount", {}, ledProperties.ledCount, [], configuredLedCount);
|
||||
updateJsonEditorSelection(conf_editor, 'root.generalOptions', "hardwareLedCount", {}, ledProperties.ledCount, [], configuredLedCount);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -25,7 +25,7 @@ $(document).ready(function () {
|
||||
$('#btn_submit').off().on('click', function () {
|
||||
|
||||
var displayedLogLevel = conf_editor.getEditor("root.logger.level").getValue();
|
||||
var newLogLevel = {logger:{}};
|
||||
var newLogLevel = { logger: {} };
|
||||
newLogLevel.logger.level = displayedLogLevel;
|
||||
|
||||
requestWriteConfig(newLogLevel);
|
||||
@@ -103,7 +103,7 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
$('#log_footer').append('<button class="btn btn-primary pull-right" id="btn_clipboard"><i class="fa fa-fw fa-clipboard"></i>Copy Log to Clipboard</button>');
|
||||
$('#log_footer').append('<button class="btn btn-primary pull-right" id="btn_clipboard"><i class="fa fa-fw fa-clipboard"></i>' + $.i18n("conf_logging_btn_clipboard") + '</button>');
|
||||
|
||||
$('#btn_clipboard').off().on('click', function () {
|
||||
const temp = document.createElement('textarea');
|
||||
@@ -153,7 +153,7 @@ $(document).ready(function () {
|
||||
|
||||
$(window.hyperion).on("cmd-logging-update", function (event) {
|
||||
|
||||
var messages = (event.response.result.messages);
|
||||
var messages = (event.response.result.messages);
|
||||
|
||||
if (messages.length != 0) {
|
||||
if (!createdCont) {
|
||||
|
@@ -7,7 +7,7 @@ $(document).ready(function () {
|
||||
var oldEffects = [];
|
||||
var cpcolor = '#B500FF';
|
||||
var mappingList = window.serverSchema.properties.color.properties.imageToLedMappingType.enum;
|
||||
var duration = 0;
|
||||
var duration = ENDLESS;
|
||||
var rgb = { r: 255, g: 0, b: 0 };
|
||||
var lastImgData = "";
|
||||
var lastFileName = "";
|
||||
@@ -201,7 +201,9 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
for (const comp of components) {
|
||||
if (comp.name === "ALL")
|
||||
if (comp.name === "ALL" || (comp.name === "FORWARDER" && window.currentHyperionInstance != 0) ||
|
||||
(comp.name === "GRABBER" && !window.serverConfig.framegrabber.enable) ||
|
||||
(comp.name === "V4L" && !window.serverConfig.grabberV4L2.enable))
|
||||
continue;
|
||||
|
||||
const enable_style = (comp.enabled ? "checked" : "");
|
||||
|
@@ -33,37 +33,39 @@ window.comps = [];
|
||||
window.defaultPasswordIsSet = null;
|
||||
tokenList = {};
|
||||
|
||||
const ENDLESS = -1;
|
||||
|
||||
function initRestart()
|
||||
{
|
||||
$(window.hyperion).off();
|
||||
requestServerConfigReload();
|
||||
window.watchdog = 10;
|
||||
connectionLostDetection('restart');
|
||||
$(window.hyperion).off();
|
||||
requestServerConfigReload();
|
||||
window.watchdog = 10;
|
||||
connectionLostDetection('restart');
|
||||
}
|
||||
|
||||
function connectionLostDetection(type)
|
||||
{
|
||||
if ( window.watchdog > 2 )
|
||||
{
|
||||
var interval_id = window.setInterval(function(){clearInterval(interval_id);}, 9999); // Get a reference to the last
|
||||
for (var i = 1; i < interval_id; i++)
|
||||
window.clearInterval(i);
|
||||
if(type == 'restart')
|
||||
{
|
||||
$("body").html($("#container_restart").html());
|
||||
// setTimeout delay for probably slower systems, some browser don't execute THIS action
|
||||
setTimeout(restartAction,250);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("body").html($("#container_connection_lost").html());
|
||||
connectionLostAction();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$.get( "/cgi/cfg_jsonserver", function() {window.watchdog=0}).fail(function() {window.watchdog++;});
|
||||
}
|
||||
if ( window.watchdog > 2 )
|
||||
{
|
||||
var interval_id = window.setInterval(function(){clearInterval(interval_id);}, 9999); // Get a reference to the last
|
||||
for (var i = 1; i < interval_id; i++)
|
||||
window.clearInterval(i);
|
||||
if(type == 'restart')
|
||||
{
|
||||
$("body").html($("#container_restart").html());
|
||||
// setTimeout delay for probably slower systems, some browser don't execute THIS action
|
||||
setTimeout(restartAction,250);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("body").html($("#container_connection_lost").html());
|
||||
connectionLostAction();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$.get( "/cgi/cfg_jsonserver", function() {window.watchdog=0}).fail(function() {window.watchdog++;});
|
||||
}
|
||||
}
|
||||
|
||||
setInterval(connectionLostDetection, 3000);
|
||||
@@ -72,107 +74,107 @@ setInterval(connectionLostDetection, 3000);
|
||||
|
||||
function initWebSocket()
|
||||
{
|
||||
if ("WebSocket" in window)
|
||||
{
|
||||
if (window.websocket == null)
|
||||
{
|
||||
window.jsonPort = '';
|
||||
if(document.location.port == '' && document.location.protocol == "http:")
|
||||
window.jsonPort = '80';
|
||||
else if (document.location.port == '' && document.location.protocol == "https:")
|
||||
window.jsonPort = '443';
|
||||
else
|
||||
window.jsonPort = document.location.port;
|
||||
window.websocket = (document.location.protocol == "https:") ? new WebSocket('wss://'+document.location.hostname+":"+window.jsonPort) : new WebSocket('ws://'+document.location.hostname+":"+window.jsonPort);
|
||||
if ("WebSocket" in window)
|
||||
{
|
||||
if (window.websocket == null)
|
||||
{
|
||||
window.jsonPort = '';
|
||||
if(document.location.port == '' && document.location.protocol == "http:")
|
||||
window.jsonPort = '80';
|
||||
else if (document.location.port == '' && document.location.protocol == "https:")
|
||||
window.jsonPort = '443';
|
||||
else
|
||||
window.jsonPort = document.location.port;
|
||||
window.websocket = (document.location.protocol == "https:") ? new WebSocket('wss://'+document.location.hostname+":"+window.jsonPort) : new WebSocket('ws://'+document.location.hostname+":"+window.jsonPort);
|
||||
|
||||
window.websocket.onopen = function (event) {
|
||||
$(window.hyperion).trigger({type:"open"});
|
||||
window.websocket.onopen = function (event) {
|
||||
$(window.hyperion).trigger({type:"open"});
|
||||
|
||||
$(window.hyperion).on("cmd-serverinfo", function(event) {
|
||||
window.watchdog = 0;
|
||||
});
|
||||
};
|
||||
$(window.hyperion).on("cmd-serverinfo", function(event) {
|
||||
window.watchdog = 0;
|
||||
});
|
||||
};
|
||||
|
||||
window.websocket.onclose = function (event) {
|
||||
// See http://tools.ietf.org/html/rfc6455#section-7.4.1
|
||||
var reason;
|
||||
switch(event.code)
|
||||
{
|
||||
case 1000: reason = "Normal closure, meaning that the purpose for which the connection was established has been fulfilled."; break;
|
||||
case 1001: reason = "An endpoint is \"going away\", such as a server going down or a browser having navigated away from a page."; break;
|
||||
case 1002: reason = "An endpoint is terminating the connection due to a protocol error"; break;
|
||||
case 1003: reason = "An endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message)."; break;
|
||||
case 1004: reason = "Reserved. The specific meaning might be defined in the future."; break;
|
||||
case 1005: reason = "No status code was actually present."; break;
|
||||
case 1006: reason = "The connection was closed abnormally, e.g., without sending or receiving a Close control frame"; break;
|
||||
case 1007: reason = "An endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [http://tools.ietf.org/html/rfc3629] data within a text message)."; break;
|
||||
case 1008: reason = "An endpoint is terminating the connection because it has received a message that \"violates its policy\". This reason is given either if there is no other sutible reason, or if there is a need to hide specific details about the policy."; break;
|
||||
case 1009: reason = "An endpoint is terminating the connection because it has received a message that is too big for it to process."; break;
|
||||
case 1010: reason = "An endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake. <br /> Specifically, the extensions that are needed are: " + event.reason; break;
|
||||
case 1011: reason = "A server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."; break;
|
||||
case 1015: reason = "The connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."; break;
|
||||
default: reason = "Unknown reason";
|
||||
}
|
||||
$(window.hyperion).trigger({type:"close", reason:reason});
|
||||
window.watchdog = 10;
|
||||
connectionLostDetection();
|
||||
};
|
||||
window.websocket.onclose = function (event) {
|
||||
// See http://tools.ietf.org/html/rfc6455#section-7.4.1
|
||||
var reason;
|
||||
switch(event.code)
|
||||
{
|
||||
case 1000: reason = "Normal closure, meaning that the purpose for which the connection was established has been fulfilled."; break;
|
||||
case 1001: reason = "An endpoint is \"going away\", such as a server going down or a browser having navigated away from a page."; break;
|
||||
case 1002: reason = "An endpoint is terminating the connection due to a protocol error"; break;
|
||||
case 1003: reason = "An endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message)."; break;
|
||||
case 1004: reason = "Reserved. The specific meaning might be defined in the future."; break;
|
||||
case 1005: reason = "No status code was actually present."; break;
|
||||
case 1006: reason = "The connection was closed abnormally, e.g., without sending or receiving a Close control frame"; break;
|
||||
case 1007: reason = "An endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [http://tools.ietf.org/html/rfc3629] data within a text message)."; break;
|
||||
case 1008: reason = "An endpoint is terminating the connection because it has received a message that \"violates its policy\". This reason is given either if there is no other sutible reason, or if there is a need to hide specific details about the policy."; break;
|
||||
case 1009: reason = "An endpoint is terminating the connection because it has received a message that is too big for it to process."; break;
|
||||
case 1010: reason = "An endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake. <br /> Specifically, the extensions that are needed are: " + event.reason; break;
|
||||
case 1011: reason = "A server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."; break;
|
||||
case 1015: reason = "The connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."; break;
|
||||
default: reason = "Unknown reason";
|
||||
}
|
||||
$(window.hyperion).trigger({type:"close", reason:reason});
|
||||
window.watchdog = 10;
|
||||
connectionLostDetection();
|
||||
};
|
||||
|
||||
window.websocket.onmessage = function (event) {
|
||||
try
|
||||
{
|
||||
var response = JSON.parse(event.data);
|
||||
var success = response.success;
|
||||
var cmd = response.command;
|
||||
var tan = response.tan
|
||||
if (success || typeof(success) == "undefined")
|
||||
{
|
||||
$(window.hyperion).trigger({type:"cmd-"+cmd, response:response});
|
||||
}
|
||||
else
|
||||
{
|
||||
// skip tan -1 error handling
|
||||
if(tan != -1){
|
||||
var error = response.hasOwnProperty("error")? response.error : "unknown";
|
||||
$(window.hyperion).trigger({type:"error",reason:error});
|
||||
console.log("[window.websocket::onmessage] ",error)
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(exception_error)
|
||||
{
|
||||
$(window.hyperion).trigger({type:"error",reason:exception_error});
|
||||
console.log("[window.websocket::onmessage] ",exception_error)
|
||||
}
|
||||
};
|
||||
window.websocket.onmessage = function (event) {
|
||||
try
|
||||
{
|
||||
var response = JSON.parse(event.data);
|
||||
var success = response.success;
|
||||
var cmd = response.command;
|
||||
var tan = response.tan
|
||||
if (success || typeof(success) == "undefined")
|
||||
{
|
||||
$(window.hyperion).trigger({type:"cmd-"+cmd, response:response});
|
||||
}
|
||||
else
|
||||
{
|
||||
// skip tan -1 error handling
|
||||
if(tan != -1){
|
||||
var error = response.hasOwnProperty("error")? response.error : "unknown";
|
||||
$(window.hyperion).trigger({type:"error",reason:error});
|
||||
console.log("[window.websocket::onmessage] ",error)
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(exception_error)
|
||||
{
|
||||
$(window.hyperion).trigger({type:"error",reason:exception_error});
|
||||
console.log("[window.websocket::onmessage] ",exception_error)
|
||||
}
|
||||
};
|
||||
|
||||
window.websocket.onerror = function (error) {
|
||||
$(window.hyperion).trigger({type:"error",reason:error});
|
||||
console.log("[window.websocket::onerror] ",error)
|
||||
};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$(window.hyperion).trigger("error");
|
||||
alert("Websocket is not supported by your browser");
|
||||
return;
|
||||
}
|
||||
window.websocket.onerror = function (error) {
|
||||
$(window.hyperion).trigger({type:"error",reason:error});
|
||||
console.log("[window.websocket::onerror] ",error)
|
||||
};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$(window.hyperion).trigger("error");
|
||||
alert("Websocket is not supported by your browser");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function sendToHyperion(command, subcommand, msg)
|
||||
{
|
||||
if (typeof subcommand != 'undefined' && subcommand.length > 0)
|
||||
subcommand = ',"subcommand":"'+subcommand+'"';
|
||||
else
|
||||
subcommand = "";
|
||||
if (typeof subcommand != 'undefined' && subcommand.length > 0)
|
||||
subcommand = ',"subcommand":"'+subcommand+'"';
|
||||
else
|
||||
subcommand = "";
|
||||
|
||||
if (typeof msg != 'undefined' && msg.length > 0)
|
||||
msg = ","+msg;
|
||||
else
|
||||
msg = "";
|
||||
if (typeof msg != 'undefined' && msg.length > 0)
|
||||
msg = ","+msg;
|
||||
else
|
||||
msg = "";
|
||||
|
||||
window.websocket.send('{"command":"'+command+'", "tan":'+window.wsTan+subcommand+msg+'}');
|
||||
window.websocket.send('{"command":"'+command+'", "tan":'+window.wsTan+subcommand+msg+'}');
|
||||
}
|
||||
|
||||
// Send a json message to Hyperion and wait for a matching response
|
||||
@@ -228,250 +230,256 @@ async function __sendAsync (data) {
|
||||
// Test if admin requires authentication
|
||||
function requestRequiresAdminAuth()
|
||||
{
|
||||
sendToHyperion("authorize","adminRequired");
|
||||
sendToHyperion("authorize","adminRequired");
|
||||
}
|
||||
// Test if the default password needs to be changed
|
||||
function requestRequiresDefaultPasswortChange()
|
||||
{
|
||||
sendToHyperion("authorize","newPasswordRequired");
|
||||
sendToHyperion("authorize","newPasswordRequired");
|
||||
}
|
||||
// Change password
|
||||
function requestChangePassword(oldPw, newPw)
|
||||
{
|
||||
sendToHyperion("authorize","newPassword",'"password": "'+oldPw+'", "newPassword":"'+newPw+'"');
|
||||
sendToHyperion("authorize","newPassword",'"password": "'+oldPw+'", "newPassword":"'+newPw+'"');
|
||||
}
|
||||
|
||||
function requestAuthorization(password)
|
||||
{
|
||||
sendToHyperion("authorize","login",'"password": "' + password + '"');
|
||||
sendToHyperion("authorize","login",'"password": "' + password + '"');
|
||||
}
|
||||
|
||||
function requestTokenAuthorization(token)
|
||||
{
|
||||
sendToHyperion("authorize","login",'"token": "' + token + '"');
|
||||
sendToHyperion("authorize","login",'"token": "' + token + '"');
|
||||
}
|
||||
|
||||
function requestToken(comment)
|
||||
{
|
||||
sendToHyperion("authorize","createToken",'"comment": "'+comment+'"');
|
||||
sendToHyperion("authorize","createToken",'"comment": "'+comment+'"');
|
||||
}
|
||||
|
||||
function requestTokenInfo()
|
||||
{
|
||||
sendToHyperion("authorize","getTokenList","");
|
||||
sendToHyperion("authorize","getTokenList","");
|
||||
}
|
||||
|
||||
function requestGetPendingTokenRequests (id, state) {
|
||||
sendToHyperion("authorize", "getPendingTokenRequests", "");
|
||||
sendToHyperion("authorize", "getPendingTokenRequests", "");
|
||||
}
|
||||
|
||||
function requestHandleTokenRequest(id, state)
|
||||
{
|
||||
sendToHyperion("authorize","answerRequest",'"id":"'+id+'", "accept":'+state);
|
||||
sendToHyperion("authorize","answerRequest",'"id":"'+id+'", "accept":'+state);
|
||||
}
|
||||
|
||||
function requestTokenDelete(id)
|
||||
{
|
||||
sendToHyperion("authorize","deleteToken",'"id":"'+id+'"');
|
||||
sendToHyperion("authorize","deleteToken",'"id":"'+id+'"');
|
||||
}
|
||||
|
||||
function requestInstanceRename(inst, name)
|
||||
{
|
||||
sendToHyperion("instance", "saveName",'"instance": '+inst+', "name": "'+name+'"');
|
||||
sendToHyperion("instance", "saveName",'"instance": '+inst+', "name": "'+name+'"');
|
||||
}
|
||||
|
||||
function requestInstanceStartStop(inst, start)
|
||||
{
|
||||
if(start)
|
||||
sendToHyperion("instance","startInstance",'"instance": '+inst);
|
||||
else
|
||||
sendToHyperion("instance","stopInstance",'"instance": '+inst);
|
||||
if(start)
|
||||
sendToHyperion("instance","startInstance",'"instance": '+inst);
|
||||
else
|
||||
sendToHyperion("instance","stopInstance",'"instance": '+inst);
|
||||
}
|
||||
|
||||
function requestInstanceDelete(inst)
|
||||
{
|
||||
sendToHyperion("instance","deleteInstance",'"instance": '+inst);
|
||||
sendToHyperion("instance","deleteInstance",'"instance": '+inst);
|
||||
}
|
||||
|
||||
function requestInstanceCreate(name)
|
||||
{
|
||||
sendToHyperion("instance","createInstance",'"name": "'+name+'"');
|
||||
sendToHyperion("instance","createInstance",'"name": "'+name+'"');
|
||||
}
|
||||
|
||||
function requestInstanceSwitch(inst)
|
||||
{
|
||||
sendToHyperion("instance","switchTo",'"instance": '+inst);
|
||||
sendToHyperion("instance","switchTo",'"instance": '+inst);
|
||||
}
|
||||
|
||||
function requestServerInfo()
|
||||
{
|
||||
sendToHyperion("serverinfo","",'"subscribe":["components-update","sessions-update","priorities-update", "imageToLedMapping-update", "adjustment-update", "videomode-update", "effects-update", "settings-update", "instance-update"]');
|
||||
sendToHyperion("serverinfo","",'"subscribe":["components-update","sessions-update","priorities-update", "imageToLedMapping-update", "adjustment-update", "videomode-update", "effects-update", "settings-update", "instance-update"]');
|
||||
}
|
||||
|
||||
function requestSysInfo()
|
||||
{
|
||||
sendToHyperion("sysinfo");
|
||||
sendToHyperion("sysinfo");
|
||||
}
|
||||
|
||||
function requestServerConfigSchema()
|
||||
{
|
||||
sendToHyperion("config","getschema");
|
||||
sendToHyperion("config","getschema");
|
||||
}
|
||||
|
||||
function requestServerConfig()
|
||||
{
|
||||
sendToHyperion("config", "getconfig");
|
||||
sendToHyperion("config", "getconfig");
|
||||
}
|
||||
|
||||
function requestServerConfigReload()
|
||||
{
|
||||
sendToHyperion("config", "reload");
|
||||
sendToHyperion("config", "reload");
|
||||
}
|
||||
|
||||
function requestLedColorsStart()
|
||||
{
|
||||
window.ledStreamActive=true;
|
||||
sendToHyperion("ledcolors", "ledstream-start");
|
||||
window.ledStreamActive=true;
|
||||
sendToHyperion("ledcolors", "ledstream-start");
|
||||
}
|
||||
|
||||
function requestLedColorsStop()
|
||||
{
|
||||
window.ledStreamActive=false;
|
||||
sendToHyperion("ledcolors", "ledstream-stop");
|
||||
window.ledStreamActive=false;
|
||||
sendToHyperion("ledcolors", "ledstream-stop");
|
||||
}
|
||||
|
||||
function requestLedImageStart()
|
||||
{
|
||||
window.imageStreamActive=true;
|
||||
sendToHyperion("ledcolors", "imagestream-start");
|
||||
window.imageStreamActive=true;
|
||||
sendToHyperion("ledcolors", "imagestream-start");
|
||||
}
|
||||
|
||||
function requestLedImageStop()
|
||||
{
|
||||
window.imageStreamActive=false;
|
||||
sendToHyperion("ledcolors", "imagestream-stop");
|
||||
window.imageStreamActive=false;
|
||||
sendToHyperion("ledcolors", "imagestream-stop");
|
||||
}
|
||||
|
||||
function requestPriorityClear(prio)
|
||||
{
|
||||
if(typeof prio !== 'number')
|
||||
prio = window.webPrio;
|
||||
if(typeof prio !== 'number')
|
||||
prio = window.webPrio;
|
||||
|
||||
sendToHyperion("clear", "", '"priority":'+prio+'');
|
||||
sendToHyperion("clear", "", '"priority":'+prio+'');
|
||||
}
|
||||
|
||||
function requestClearAll()
|
||||
{
|
||||
requestPriorityClear(-1)
|
||||
requestPriorityClear(-1)
|
||||
}
|
||||
|
||||
function requestPlayEffect(effectName, duration)
|
||||
{
|
||||
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+window.webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+window.webOrigin+'"');
|
||||
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+window.webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+window.webOrigin+'"');
|
||||
}
|
||||
|
||||
function requestSetColor(r,g,b,duration)
|
||||
{
|
||||
sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+window.webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+window.webOrigin+'"');
|
||||
sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+window.webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+window.webOrigin+'"');
|
||||
}
|
||||
|
||||
function requestSetImage(data,duration,name)
|
||||
{
|
||||
sendToHyperion("image", "", '"imagedata":"'+data+'", "priority":'+window.webPrio+',"duration":'+validateDuration(duration)+', "format":"auto", "origin":"'+window.webOrigin+'", "name":"'+name+'"');
|
||||
sendToHyperion("image", "", '"imagedata":"'+data+'", "priority":'+window.webPrio+',"duration":'+validateDuration(duration)+', "format":"auto", "origin":"'+window.webOrigin+'", "name":"'+name+'"');
|
||||
}
|
||||
|
||||
function requestSetComponentState(comp, state)
|
||||
{
|
||||
var state_str = state ? "true" : "false";
|
||||
sendToHyperion("componentstate", "", '"componentstate":{"component":"'+comp+'","state":'+state_str+'}');
|
||||
var state_str = state ? "true" : "false";
|
||||
sendToHyperion("componentstate", "", '"componentstate":{"component":"'+comp+'","state":'+state_str+'}');
|
||||
}
|
||||
|
||||
function requestSetSource(prio)
|
||||
{
|
||||
if ( prio == "auto" )
|
||||
sendToHyperion("sourceselect", "", '"auto":true');
|
||||
else
|
||||
sendToHyperion("sourceselect", "", '"priority":'+prio);
|
||||
if ( prio == "auto" )
|
||||
sendToHyperion("sourceselect", "", '"auto":true');
|
||||
else
|
||||
sendToHyperion("sourceselect", "", '"priority":'+prio);
|
||||
}
|
||||
|
||||
function requestWriteConfig(config, full)
|
||||
{
|
||||
if(full === true)
|
||||
window.serverConfig = config;
|
||||
else
|
||||
{
|
||||
jQuery.each(config, function(i, val) {
|
||||
window.serverConfig[i] = val;
|
||||
});
|
||||
}
|
||||
if(full === true)
|
||||
window.serverConfig = config;
|
||||
else
|
||||
{
|
||||
jQuery.each(config, function(i, val) {
|
||||
window.serverConfig[i] = val;
|
||||
});
|
||||
}
|
||||
|
||||
sendToHyperion("config","setconfig", '"config":'+JSON.stringify(window.serverConfig));
|
||||
sendToHyperion("config","setconfig", '"config":'+JSON.stringify(window.serverConfig));
|
||||
}
|
||||
|
||||
function requestWriteEffect(effectName,effectPy,effectArgs,data)
|
||||
{
|
||||
var cutArgs = effectArgs.slice(1, -1);
|
||||
sendToHyperion("create-effect", "", '"name":"'+effectName+'", "script":"'+effectPy+'", '+cutArgs+',"imageData":"'+data+'"');
|
||||
var cutArgs = effectArgs.slice(1, -1);
|
||||
sendToHyperion("create-effect", "", '"name":"'+effectName+'", "script":"'+effectPy+'", '+cutArgs+',"imageData":"'+data+'"');
|
||||
}
|
||||
|
||||
function requestTestEffect(effectName,effectPy,effectArgs,data)
|
||||
{
|
||||
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'", "args":'+effectArgs+'}, "priority":'+window.webPrio+', "origin":"'+window.webOrigin+'", "pythonScript":"'+effectPy+'", "imageData":"'+data+'"');
|
||||
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'", "args":'+effectArgs+'}, "priority":'+window.webPrio+', "origin":"'+window.webOrigin+'", "pythonScript":"'+effectPy+'", "imageData":"'+data+'"');
|
||||
}
|
||||
|
||||
function requestDeleteEffect(effectName)
|
||||
{
|
||||
sendToHyperion("delete-effect", "", '"name":"'+effectName+'"');
|
||||
sendToHyperion("delete-effect", "", '"name":"'+effectName+'"');
|
||||
}
|
||||
|
||||
function requestLoggingStart()
|
||||
{
|
||||
window.loggingStreamActive=true;
|
||||
sendToHyperion("logging", "start");
|
||||
window.loggingStreamActive=true;
|
||||
sendToHyperion("logging", "start");
|
||||
}
|
||||
|
||||
function requestLoggingStop()
|
||||
{
|
||||
window.loggingStreamActive=false;
|
||||
sendToHyperion("logging", "stop");
|
||||
window.loggingStreamActive=false;
|
||||
sendToHyperion("logging", "stop");
|
||||
}
|
||||
|
||||
function requestMappingType(type)
|
||||
{
|
||||
sendToHyperion("processing", "", '"mappingType": "'+type+'"');
|
||||
sendToHyperion("processing", "", '"mappingType": "'+type+'"');
|
||||
}
|
||||
|
||||
function requestVideoMode(newMode)
|
||||
{
|
||||
sendToHyperion("videomode", "", '"videoMode": "'+newMode+'"');
|
||||
sendToHyperion("videomode", "", '"videoMode": "'+newMode+'"');
|
||||
}
|
||||
|
||||
function requestAdjustment(type, value, complete)
|
||||
{
|
||||
if(complete === true)
|
||||
sendToHyperion("adjustment", "", '"adjustment": '+type+'');
|
||||
else
|
||||
sendToHyperion("adjustment", "", '"adjustment": {"'+type+'": '+value+'}');
|
||||
if(complete === true)
|
||||
sendToHyperion("adjustment", "", '"adjustment": '+type+'');
|
||||
else
|
||||
sendToHyperion("adjustment", "", '"adjustment": {"'+type+'": '+value+'}');
|
||||
}
|
||||
|
||||
async function requestLedDeviceDiscovery(type, params)
|
||||
{
|
||||
let data = { ledDeviceType: type, params: params };
|
||||
let data = { ledDeviceType: type, params: params };
|
||||
|
||||
return sendAsyncToHyperion("leddevice", "discover", data, Math.floor(Math.random() * 1000) );
|
||||
return sendAsyncToHyperion("leddevice", "discover", data, Math.floor(Math.random() * 1000) );
|
||||
}
|
||||
|
||||
async function requestLedDeviceProperties(type, params)
|
||||
{
|
||||
let data = { ledDeviceType: type, params: params };
|
||||
let data = { ledDeviceType: type, params: params };
|
||||
|
||||
return sendAsyncToHyperion("leddevice", "getProperties", data, Math.floor(Math.random() * 1000));
|
||||
return sendAsyncToHyperion("leddevice", "getProperties", data, Math.floor(Math.random() * 1000));
|
||||
}
|
||||
|
||||
function requestLedDeviceIdentification(type, params)
|
||||
{
|
||||
//sendToHyperion("leddevice", "identify", '"ledDeviceType": "'+type+'","params": '+JSON.stringify(params)+'');
|
||||
let data = { ledDeviceType: type, params: params };
|
||||
return sendAsyncToHyperion("leddevice", "identify", data, Math.floor(Math.random() * 1000));
|
||||
|
||||
return sendAsyncToHyperion("leddevice", "identify", data, Math.floor(Math.random() * 1000));
|
||||
}
|
||||
|
||||
async function requestInputSourcesDiscovery(type, params) {
|
||||
let data = { sourceType: type, params: params };
|
||||
|
||||
return sendAsyncToHyperion("inputsource", "discover", data, Math.floor(Math.random() * 1000));
|
||||
}
|
||||
|
||||
|
33
assets/webconfig/js/languages.js
Normal file
33
assets/webconfig/js/languages.js
Normal file
@@ -0,0 +1,33 @@
|
||||
var storedLang;
|
||||
var availLang = ['cs', 'de', 'en', 'es', 'fr', 'it', 'nl', 'nb', 'pl', 'pt', 'ro', 'sv', 'vi', 'ru', 'tr', 'zh-CN'];
|
||||
var availLangText = ['Čeština', 'Deutsch', 'English', 'Español', 'Français', 'Italiano', 'Nederlands', 'Norsk Bokmål', 'Polski', 'Português', 'Română', 'Svenska', 'Tiếng Việt', 'русский', 'Türkçe', '汉语'];
|
||||
|
||||
//$.i18n.debug = true;
|
||||
|
||||
//i18n
|
||||
function initTrans(lc) {
|
||||
$.i18n().load("i18n", lc).done(
|
||||
function () {
|
||||
$.i18n().locale = lc;
|
||||
performTranslation();
|
||||
});
|
||||
}
|
||||
|
||||
storedLang = getStorage("langcode");
|
||||
if (storedLang == null || storedLang === "undefined") {
|
||||
|
||||
var langLocale = $.i18n().locale.substring(0, 2);
|
||||
//Test, if language is supported by hyperion
|
||||
var langIdx = availLang.indexOf(langLocale);
|
||||
if (langIdx === -1) {
|
||||
// If language is not supported by hyperion, try fallback language
|
||||
langLocale = $.i18n().options.fallbackLocale.substring(0, 2);
|
||||
langIdx = availLang.indexOf(langLocale);
|
||||
if (langIdx === -1) {
|
||||
langLocale = 'en';
|
||||
}
|
||||
}
|
||||
storedLang = langLocale;
|
||||
setStorage("langcode", storedLang);
|
||||
}
|
||||
initTrans(storedLang);
|
@@ -1,279 +1,329 @@
|
||||
$(document).ready(function() {
|
||||
var modalOpened = false;
|
||||
var ledsim_width = 540;
|
||||
var ledsim_height = 489;
|
||||
var dialog;
|
||||
var leds;
|
||||
var lC = false;
|
||||
var imageCanvasNodeCtx;
|
||||
var ledsCanvasNodeCtx;
|
||||
var canvas_height;
|
||||
var canvas_width;
|
||||
var twoDPaths = [];
|
||||
var toggleLeds, toggleLedsNum = false;
|
||||
$(document).ready(function () {
|
||||
var modalOpened = false;
|
||||
var ledsim_width = 540;
|
||||
var ledsim_height = 489;
|
||||
var dialog;
|
||||
var leds;
|
||||
var grabberConfig;
|
||||
var lC = false;
|
||||
var imageCanvasNodeCtx;
|
||||
var ledsCanvasNodeCtx;
|
||||
var canvas_height;
|
||||
var canvas_width;
|
||||
var twoDPaths = [];
|
||||
var toggleLeds = false;
|
||||
var toggleLedsNum = false;
|
||||
var toggleSigDetectArea = false;
|
||||
|
||||
/// add prototype for simple canvas clear() method
|
||||
CanvasRenderingContext2D.prototype.clear = function(){
|
||||
this.clearRect(0, 0, this.canvas.width, this.canvas.height)
|
||||
};
|
||||
var activeComponent = "";
|
||||
|
||||
function create2dPaths(){
|
||||
twoDPaths = [];
|
||||
for(var idx=0; idx<leds.length; idx++)
|
||||
{
|
||||
var led = leds[idx];
|
||||
twoDPaths.push( build2DPath(led.hmin * canvas_width, led.vmin * canvas_height, (led.hmax-led.hmin) * canvas_width, (led.vmax-led.vmin) * canvas_height, 5) );
|
||||
}
|
||||
}
|
||||
const image = new Image()
|
||||
image.src = "img/hyperion/logo_negativ.png",
|
||||
|
||||
/**
|
||||
* Draws a rounded rectangle into a new Path2D object, returns the created path.
|
||||
* If you omit the last three params, it will draw a rectangle
|
||||
* outline with a 5 pixel border radius
|
||||
* @param {Number} x The top left x coordinate
|
||||
* @param {Number} y The top left y coordinate
|
||||
* @param {Number} width The width of the rectangle
|
||||
* @param {Number} height The height of the rectangle
|
||||
* @param {Number} [radius = 5] The corner radius; It can also be an object
|
||||
* to specify different radii for corners
|
||||
* @param {Number} [radius.tl = 0] Top left
|
||||
* @param {Number} [radius.tr = 0] Top right
|
||||
* @param {Number} [radius.br = 0] Bottom right
|
||||
* @param {Number} [radius.bl = 0] Bottom left
|
||||
* @return {Path2D} The final path
|
||||
*/
|
||||
function build2DPath(x, y, width, height, radius) {
|
||||
if (typeof radius == 'number') {
|
||||
radius = {tl: radius, tr: radius, br: radius, bl: radius};
|
||||
} else {
|
||||
var defaultRadius = {tl: 0, tr: 0, br: 0, bl: 0};
|
||||
for (var side in defaultRadius) {
|
||||
radius[side] = radius[side] || defaultRadius[side];
|
||||
}
|
||||
}
|
||||
/// add prototype for simple canvas clear() method
|
||||
CanvasRenderingContext2D.prototype.clear = function () {
|
||||
this.clearRect(0, 0, this.canvas.width, this.canvas.height)
|
||||
};
|
||||
|
||||
var path = new Path2D();
|
||||
function create2dPaths() {
|
||||
twoDPaths = [];
|
||||
for (var idx = 0; idx < leds.length; idx++) {
|
||||
var led = leds[idx];
|
||||
twoDPaths.push(build2DPath(led.hmin * canvas_width, led.vmin * canvas_height, (led.hmax - led.hmin) * canvas_width, (led.vmax - led.vmin) * canvas_height, 5));
|
||||
}
|
||||
}
|
||||
|
||||
path.moveTo(x + radius.tl, y);
|
||||
path.lineTo(x + width - radius.tr, y);
|
||||
path.quadraticCurveTo(x + width, y, x + width, y + radius.tr);
|
||||
path.lineTo(x + width, y + height - radius.br);
|
||||
path.quadraticCurveTo(x + width, y + height, x + width - radius.br, y + height);
|
||||
path.lineTo(x + radius.bl, y + height);
|
||||
path.quadraticCurveTo(x, y + height, x, y + height - radius.bl);
|
||||
path.lineTo(x, y + radius.tl);
|
||||
path.quadraticCurveTo(x, y, x + radius.tl, y);
|
||||
/**
|
||||
* Draws a rounded rectangle into a new Path2D object, returns the created path.
|
||||
* If you omit the last three params, it will draw a rectangle
|
||||
* outline with a 5 pixel border radius
|
||||
* @param {Number} x The top left x coordinate
|
||||
* @param {Number} y The top left y coordinate
|
||||
* @param {Number} width The width of the rectangle
|
||||
* @param {Number} height The height of the rectangle
|
||||
* @param {Number} [radius = 5] The corner radius; It can also be an object
|
||||
* to specify different radii for corners
|
||||
* @param {Number} [radius.tl = 0] Top left
|
||||
* @param {Number} [radius.tr = 0] Top right
|
||||
* @param {Number} [radius.br = 0] Bottom right
|
||||
* @param {Number} [radius.bl = 0] Bottom left
|
||||
* @return {Path2D} The final path
|
||||
*/
|
||||
function build2DPath(x, y, width, height, radius) {
|
||||
if (typeof radius == 'number') {
|
||||
radius = { tl: radius, tr: radius, br: radius, bl: radius };
|
||||
} else {
|
||||
var defaultRadius = { tl: 0, tr: 0, br: 0, bl: 0 };
|
||||
for (var side in defaultRadius) {
|
||||
radius[side] = radius[side] || defaultRadius[side];
|
||||
}
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
var path = new Path2D();
|
||||
|
||||
$(window.hyperion).one("ready",function(){
|
||||
leds = window.serverConfig.leds;
|
||||
path.moveTo(x + radius.tl, y);
|
||||
path.lineTo(x + width - radius.tr, y);
|
||||
path.quadraticCurveTo(x + width, y, x + width, y + radius.tr);
|
||||
path.lineTo(x + width, y + height - radius.br);
|
||||
path.quadraticCurveTo(x + width, y + height, x + width - radius.br, y + height);
|
||||
path.lineTo(x + radius.bl, y + height);
|
||||
path.quadraticCurveTo(x, y + height, x, y + height - radius.bl);
|
||||
path.lineTo(x, y + radius.tl);
|
||||
path.quadraticCurveTo(x, y, x + radius.tl, y);
|
||||
|
||||
if(window.showOptHelp)
|
||||
{
|
||||
createHint('intro', $.i18n('main_ledsim_text'), 'ledsim_text');
|
||||
$('#ledsim_text').css({'margin':'10px 15px 0px 15px'});
|
||||
$('#ledsim_text .bs-callout').css("margin","0px")
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
if(getStorage('ledsim_width') != null)
|
||||
{
|
||||
ledsim_width = getStorage('ledsim_width');
|
||||
ledsim_height = getStorage('ledsim_height');
|
||||
}
|
||||
$(window.hyperion).one("ready", function () {
|
||||
leds = window.serverConfig.leds;
|
||||
grabberConfig = window.serverConfig.grabberV4L2;
|
||||
|
||||
dialog = $("#ledsim_dialog").dialog({
|
||||
uiLibrary: 'bootstrap',
|
||||
resizable: true,
|
||||
modal: false,
|
||||
minWidth: 250,
|
||||
width: ledsim_width,
|
||||
minHeight: 350,
|
||||
height: ledsim_height,
|
||||
closeOnEscape: true,
|
||||
autoOpen: false,
|
||||
title: $.i18n('main_ledsim_title'),
|
||||
resize: function (e) {
|
||||
updateLedLayout();
|
||||
},
|
||||
opened: function (e) {
|
||||
if(!lC)
|
||||
{
|
||||
updateLedLayout();
|
||||
lC = true;
|
||||
}
|
||||
modalOpened = true;
|
||||
requestLedColorsStart();
|
||||
if (window.showOptHelp) {
|
||||
createHint('intro', $.i18n('main_ledsim_text'), 'ledsim_text');
|
||||
$('#ledsim_text').css({ 'margin': '10px 15px 0px 15px' });
|
||||
$('#ledsim_text .bs-callout').css("margin", "0px")
|
||||
}
|
||||
|
||||
setClassByBool('#leds_toggle_live_video', window.imageStreamActive, "btn-danger", "btn-success");
|
||||
if($('#leds_toggle_live_video').hasClass('btn-success'))
|
||||
requestLedImageStart();
|
||||
},
|
||||
closed: function (e) {
|
||||
modalOpened = false;
|
||||
},
|
||||
resizeStop: function (e) {
|
||||
setStorage("ledsim_width", $("#ledsim_dialog").outerWidth());
|
||||
setStorage("ledsim_height", $("#ledsim_dialog").outerHeight());
|
||||
}
|
||||
});
|
||||
// apply new serverinfos
|
||||
$(window.hyperion).on("cmd-config-getconfig",function(event){
|
||||
leds = event.response.info.leds;
|
||||
updateLedLayout();
|
||||
});
|
||||
});
|
||||
if (getStorage('ledsim_width') != null) {
|
||||
ledsim_width = getStorage('ledsim_width');
|
||||
ledsim_height = getStorage('ledsim_height');
|
||||
}
|
||||
|
||||
function printLedsToCanvas(colors)
|
||||
{
|
||||
// toggle leds, do not print
|
||||
if(toggleLeds)
|
||||
return;
|
||||
dialog = $("#ledsim_dialog").dialog({
|
||||
uiLibrary: 'bootstrap',
|
||||
resizable: true,
|
||||
modal: false,
|
||||
minWidth: 250,
|
||||
width: ledsim_width,
|
||||
minHeight: 350,
|
||||
height: ledsim_height,
|
||||
closeOnEscape: true,
|
||||
autoOpen: false,
|
||||
title: $.i18n('main_ledsim_title'),
|
||||
resize: function (e) {
|
||||
updateLedLayout();
|
||||
},
|
||||
opened: function (e) {
|
||||
if (!lC) {
|
||||
updateLedLayout();
|
||||
lC = true;
|
||||
}
|
||||
modalOpened = true;
|
||||
requestLedColorsStart();
|
||||
|
||||
var useColor = false;
|
||||
var cPos = 0;
|
||||
ledsCanvasNodeCtx.clear();
|
||||
if(typeof colors != "undefined")
|
||||
useColor = true;
|
||||
setClassByBool('#leds_toggle_live_video', window.imageStreamActive, "btn-danger", "btn-success");
|
||||
if ($('#leds_toggle_live_video').hasClass('btn-success'))
|
||||
requestLedImageStart();
|
||||
},
|
||||
closed: function (e) {
|
||||
modalOpened = false;
|
||||
lC = false;
|
||||
},
|
||||
resizeStop: function (e) {
|
||||
setStorage("ledsim_width", $("#ledsim_dialog").outerWidth());
|
||||
setStorage("ledsim_height", $("#ledsim_dialog").outerHeight());
|
||||
}
|
||||
});
|
||||
// apply new serverinfos
|
||||
$(window.hyperion).on("cmd-config-getconfig", function (event) {
|
||||
leds = event.response.info.leds;
|
||||
grabberConfig = event.response.info.grabberV4L2;
|
||||
updateLedLayout();
|
||||
});
|
||||
});
|
||||
|
||||
// check size of ledcolors with leds length
|
||||
if(colors && colors.length/3 < leds.length)
|
||||
return;
|
||||
function printLedsToCanvas(colors) {
|
||||
|
||||
for(var idx=0; idx<leds.length; idx++)
|
||||
{
|
||||
var led = leds[idx];
|
||||
// can be used as fallback when Path2D is not available
|
||||
//roundRect(ledsCanvasNodeCtx, led.hmin * canvas_width, led.vmin * canvas_height, (led.hmax-led.hmin) * canvas_width, (led.vmax-led.vmin) * canvas_height, 4, true, colors[idx])
|
||||
//ledsCanvasNodeCtx.fillRect(led.hmin * canvas_width, led.vmin * canvas_height, (led.hmax-led.hmin) * canvas_width, (led.vmax-led.vmin) * canvas_height);
|
||||
if (grabberConfig.enable && grabberConfig.signalDetection && toggleSigDetectArea && storedAccess === 'expert') {
|
||||
|
||||
ledsCanvasNodeCtx.fillStyle = (useColor) ? "rgba("+colors[cPos]+","+colors[cPos+1]+","+colors[cPos+2]+",0.75)" : "hsla("+(idx*360/leds.length)+",100%,50%,0.75)";
|
||||
ledsCanvasNodeCtx.fill(twoDPaths[idx]);
|
||||
ledsCanvasNodeCtx.stroke(twoDPaths[idx]);
|
||||
sigDetectAreaCanvasNodeCtx.setLineDash([5, 5]);
|
||||
sigDetectAreaCanvasNodeCtx.stroke(build2DPath(grabberConfig.sDHOffsetMin * canvas_width,
|
||||
grabberConfig.sDVOffsetMin * canvas_height,
|
||||
(grabberConfig.sDHOffsetMax - grabberConfig.sDHOffsetMin) * canvas_width,
|
||||
(grabberConfig.sDVOffsetMax - grabberConfig.sDVOffsetMin) * canvas_height,
|
||||
5));
|
||||
}
|
||||
|
||||
if(toggleLedsNum)
|
||||
{
|
||||
//ledsCanvasNodeCtx.shadowOffsetX = 1;
|
||||
//ledsCanvasNodeCtx.shadowOffsetY = 1;
|
||||
//ledsCanvasNodeCtx.shadowColor = "black";
|
||||
//ledsCanvasNodeCtx.shadowBlur = 4;
|
||||
ledsCanvasNodeCtx.fillStyle = "white";
|
||||
ledsCanvasNodeCtx.textAlign = "center";
|
||||
ledsCanvasNodeCtx.fillText(((led.name) ? led.name : idx), (led.hmin * canvas_width) + ( ((led.hmax-led.hmin) * canvas_width) / 2), (led.vmin * canvas_height) + ( ((led.vmax-led.vmin) * canvas_height) / 2));
|
||||
}
|
||||
// toggle leds, do not print
|
||||
if (toggleLeds)
|
||||
return;
|
||||
|
||||
// increment colorsPosition
|
||||
cPos += 3;
|
||||
}
|
||||
}
|
||||
var useColor = false;
|
||||
var cPos = 0;
|
||||
ledsCanvasNodeCtx.clear();
|
||||
if (typeof colors != "undefined")
|
||||
useColor = true;
|
||||
|
||||
function updateLedLayout()
|
||||
{
|
||||
//calculate body size
|
||||
canvas_height = $('#ledsim_dialog').outerHeight()-$('#ledsim_text').outerHeight()-$('[data-role=footer]').outerHeight()-$('[data-role=header]').outerHeight()-40;
|
||||
canvas_width = $('#ledsim_dialog').outerWidth()-30;
|
||||
// check size of ledcolors with leds length
|
||||
if (colors && colors.length / 3 < leds.length)
|
||||
return;
|
||||
|
||||
$('#leds_canvas').html("");
|
||||
var leds_html = '<canvas id="image_preview_canv" width="'+canvas_width+'" height="'+canvas_height+'" style="position: absolute; left: 0; top: 0; z-index: 99998;"></canvas>';
|
||||
leds_html += '<canvas id="leds_preview_canv" width="'+canvas_width+'" height="'+canvas_height+'" style="position: absolute; left: 0; top: 0; z-index: 99999;"></canvas>';
|
||||
for (var idx = 0; idx < leds.length; idx++) {
|
||||
var led = leds[idx];
|
||||
// can be used as fallback when Path2D is not available
|
||||
//roundRect(ledsCanvasNodeCtx, led.hmin * canvas_width, led.vmin * canvas_height, (led.hmax-led.hmin) * canvas_width, (led.vmax-led.vmin) * canvas_height, 4, true, colors[idx])
|
||||
//ledsCanvasNodeCtx.fillRect(led.hmin * canvas_width, led.vmin * canvas_height, (led.hmax-led.hmin) * canvas_width, (led.vmax-led.vmin) * canvas_height);
|
||||
|
||||
$('#leds_canvas').html(leds_html);
|
||||
ledsCanvasNodeCtx.fillStyle = (useColor) ? "rgba(" + colors[cPos] + "," + colors[cPos + 1] + "," + colors[cPos + 2] + ",0.75)" : "hsla(" + (idx * 360 / leds.length) + ",100%,50%,0.75)";
|
||||
ledsCanvasNodeCtx.fill(twoDPaths[idx]);
|
||||
ledsCanvasNodeCtx.strokeStyle = '#323232';
|
||||
ledsCanvasNodeCtx.stroke(twoDPaths[idx]);
|
||||
|
||||
imageCanvasNodeCtx = document.getElementById("image_preview_canv").getContext("2d");
|
||||
ledsCanvasNodeCtx = document.getElementById("leds_preview_canv").getContext("2d");
|
||||
create2dPaths();
|
||||
printLedsToCanvas();
|
||||
resetImage();
|
||||
}
|
||||
if (toggleLedsNum) {
|
||||
//ledsCanvasNodeCtx.shadowOffsetX = 1;
|
||||
//ledsCanvasNodeCtx.shadowOffsetY = 1;
|
||||
//ledsCanvasNodeCtx.shadowColor = "black";
|
||||
//ledsCanvasNodeCtx.shadowBlur = 4;
|
||||
ledsCanvasNodeCtx.fillStyle = "white";
|
||||
ledsCanvasNodeCtx.textAlign = "center";
|
||||
ledsCanvasNodeCtx.fillText(((led.name) ? led.name : idx), (led.hmin * canvas_width) + (((led.hmax - led.hmin) * canvas_width) / 2), (led.vmin * canvas_height) + (((led.vmax - led.vmin) * canvas_height) / 2));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$('#leds_toggle_num').off().on("click", function() {
|
||||
toggleLedsNum = !toggleLedsNum
|
||||
toggleClass('#leds_toggle_num', "btn-danger", "btn-success");
|
||||
});
|
||||
// ------------------------------------------------------------------
|
||||
// increment colorsPosition
|
||||
cPos += 3;
|
||||
}
|
||||
}
|
||||
|
||||
$('#leds_toggle').off().on("click", function() {
|
||||
toggleLeds = !toggleLeds
|
||||
ledsCanvasNodeCtx.clear();
|
||||
toggleClass('#leds_toggle', "btn-success", "btn-danger");
|
||||
});
|
||||
function updateLedLayout() {
|
||||
if (grabberConfig.enable && grabberConfig.signalDetection && storedAccess === 'expert') {
|
||||
$("#sigDetectArea_toggle").show();
|
||||
} else {
|
||||
$("#sigDetectArea_toggle").hide();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$('#leds_toggle_live_video').off().on("click", function() {
|
||||
setClassByBool('#leds_toggle_live_video',window.imageStreamActive,"btn-success","btn-danger");
|
||||
if ( window.imageStreamActive )
|
||||
{
|
||||
requestLedImageStop();
|
||||
resetImage();
|
||||
}
|
||||
else
|
||||
{
|
||||
requestLedImageStart();
|
||||
}
|
||||
});
|
||||
//calculate body size
|
||||
canvas_height = $('#ledsim_dialog').outerHeight() - $('#ledsim_text').outerHeight() - $('[data-role=footer]').outerHeight() - $('[data-role=header]').outerHeight() - 40;
|
||||
canvas_width = $('#ledsim_dialog').outerWidth() - 30;
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$(window.hyperion).on("cmd-ledcolors-ledstream-update",function(event){
|
||||
if (!modalOpened)
|
||||
{
|
||||
requestLedColorsStop();
|
||||
}
|
||||
else
|
||||
{
|
||||
printLedsToCanvas(event.response.result.leds)
|
||||
}
|
||||
});
|
||||
$('#leds_canvas').html("");
|
||||
var leds_html = '<canvas id="image_preview_canv" width="' + canvas_width + '" height="' + canvas_height + '" style="position: absolute; left: 0; top: 0; z-index: 99998;"></canvas>';
|
||||
leds_html += '<canvas id="leds_preview_canv" width="' + canvas_width + '" height="' + canvas_height + '" style="position: absolute; left: 0; top: 0; z-index: 99999;"></canvas>';
|
||||
leds_html += '<canvas id="grab_preview_canv" width="' + canvas_width + '" height="' + canvas_height + '" style="position: absolute; left: 0; top: 0; z-index: 99999;"></canvas>';
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$(window.hyperion).on("cmd-ledcolors-imagestream-update",function(event){
|
||||
setClassByBool('#leds_toggle_live_video', window.imageStreamActive, "btn-danger", "btn-success");
|
||||
if (!modalOpened)
|
||||
{
|
||||
if ($('#leds_prev_toggle_live_video').length > 0)
|
||||
return;
|
||||
requestLedImageStop();
|
||||
}
|
||||
else
|
||||
{
|
||||
var imageData = (event.response.result.image);
|
||||
$('#leds_canvas').html(leds_html);
|
||||
|
||||
var image = new Image();
|
||||
image.onload = function() {
|
||||
imageCanvasNodeCtx.drawImage(image, 0, 0, canvas_width, canvas_height);
|
||||
};
|
||||
image.src = imageData;
|
||||
}
|
||||
});
|
||||
imageCanvasNodeCtx = document.getElementById("image_preview_canv").getContext("2d");
|
||||
ledsCanvasNodeCtx = document.getElementById("leds_preview_canv").getContext("2d");
|
||||
sigDetectAreaCanvasNodeCtx = document.getElementById("grab_preview_canv").getContext("2d");
|
||||
create2dPaths();
|
||||
printLedsToCanvas();
|
||||
resetImage();
|
||||
|
||||
$("#btn_open_ledsim").off().on("click", function(event) {
|
||||
dialog.open();
|
||||
});
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$(window.hyperion).on("cmd-settings-update",function(event){
|
||||
// ------------------------------------------------------------------
|
||||
$('#leds_toggle_num').off().on("click", function () {
|
||||
toggleLedsNum = !toggleLedsNum
|
||||
toggleClass('#leds_toggle_num', "btn-danger", "btn-success");
|
||||
});
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
var obj = event.response.data
|
||||
if ( obj.leds) {
|
||||
console.log("ledsim: cmd-settings-update", event.response.data);
|
||||
Object.getOwnPropertyNames(obj).forEach(function(val, idx, array) {
|
||||
window.serverInfo[val] = obj[val];
|
||||
});
|
||||
leds = window.serverConfig.leds
|
||||
updateLedLayout();
|
||||
}
|
||||
});
|
||||
$('#leds_toggle').off().on("click", function () {
|
||||
toggleLeds = !toggleLeds
|
||||
ledsCanvasNodeCtx.clear();
|
||||
toggleClass('#leds_toggle', "btn-success", "btn-danger");
|
||||
|
||||
function resetImage(){
|
||||
if (getStorage("darkMode", false) == "on") {
|
||||
imageCanvasNodeCtx.clear();
|
||||
} else {
|
||||
imageCanvasNodeCtx.fillStyle = "rgb(225,225,225)"
|
||||
imageCanvasNodeCtx.fillRect(0, 0, canvas_width, canvas_height);
|
||||
}
|
||||
if (!toggleLeds) {
|
||||
$("#leds_toggle_num").show();
|
||||
} else {
|
||||
$("#leds_toggle_num").hide();
|
||||
}
|
||||
});
|
||||
|
||||
var image = document.getElementById('navbar_brand_logo');
|
||||
imageCanvasNodeCtx.drawImage(image, canvas_width / 2 - image.width / 2, canvas_height / 2 - image.height / 2, image.width, image.height);
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
$('#leds_toggle_live_video').off().on("click", function () {
|
||||
setClassByBool('#leds_toggle_live_video', window.imageStreamActive, "btn-success", "btn-danger");
|
||||
if (window.imageStreamActive) {
|
||||
requestLedImageStop();
|
||||
resetImage();
|
||||
}
|
||||
else {
|
||||
requestLedImageStart();
|
||||
}
|
||||
});
|
||||
|
||||
$('#sigDetectArea_toggle').off().on("click", function () {
|
||||
toggleSigDetectArea = !toggleSigDetectArea
|
||||
sigDetectAreaCanvasNodeCtx.clear();
|
||||
toggleClass('#sigDetectArea_toggle', "btn-success", "btn-danger");
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$(window.hyperion).on("cmd-ledcolors-ledstream-update", function (event) {
|
||||
if (!modalOpened) {
|
||||
requestLedColorsStop();
|
||||
}
|
||||
else {
|
||||
printLedsToCanvas(event.response.result.leds)
|
||||
}
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$(window.hyperion).on("cmd-ledcolors-imagestream-update", function (event) {
|
||||
//console.log("cmd-ledcolors-imagestream-update", event.response);
|
||||
setClassByBool('#leds_toggle_live_video', window.imageStreamActive, "btn-danger", "btn-success");
|
||||
if (!modalOpened) {
|
||||
if ($('#leds_prev_toggle_live_video').length > 0)
|
||||
return;
|
||||
requestLedImageStop();
|
||||
}
|
||||
else {
|
||||
var imageData = (event.response.result.image);
|
||||
|
||||
var image = new Image();
|
||||
image.onload = function () {
|
||||
imageCanvasNodeCtx.drawImage(image, 0, 0, canvas_width, canvas_height);
|
||||
};
|
||||
image.src = imageData;
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_open_ledsim").off().on("click", function (event) {
|
||||
dialog.open();
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$(window.hyperion).on("cmd-settings-update", function (event) {
|
||||
|
||||
var obj = event.response.data
|
||||
if (obj.leds || obj.grabberV4L2) {
|
||||
//console.log("ledsim: cmd-settings-update", event.response.data);
|
||||
Object.getOwnPropertyNames(obj).forEach(function (val, idx, array) {
|
||||
window.serverInfo[val] = obj[val];
|
||||
});
|
||||
leds = window.serverConfig.leds;
|
||||
grabberConfig = window.serverConfig.grabberV4L2;
|
||||
updateLedLayout();
|
||||
}
|
||||
});
|
||||
|
||||
$(window.hyperion).on("cmd-priorities-update", function (event) {
|
||||
//console.log("cmd-priorities-update", event.response.data);
|
||||
|
||||
var prios = event.response.data.priorities;
|
||||
if (prios.length > 0)
|
||||
{
|
||||
//Clear image when new input
|
||||
if (prios[0].componentId !== activeComponent) {
|
||||
resetImage();
|
||||
activeComponent = prios[0].componentId;
|
||||
}
|
||||
else if (!prios[0].active) {
|
||||
resetImage();
|
||||
}
|
||||
}
|
||||
else {
|
||||
resetImage();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function resetImage() {
|
||||
if (typeof imageCanvasNodeCtx !== "undefined") {
|
||||
|
||||
imageCanvasNodeCtx.fillStyle = "#1c1c1c"; //90% gray
|
||||
imageCanvasNodeCtx.fillRect(0, 0, canvas_width, canvas_height);
|
||||
imageCanvasNodeCtx.drawImage(image, canvas_width / 2 - image.width / 2, canvas_height / 2 - image.height / 2, image.width, image.height);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -1839,7 +1839,14 @@ JSONEditor.AbstractEditor = Class.extend({
|
||||
this.parent = null;
|
||||
},
|
||||
getDefault: function() {
|
||||
if(this.schema["default"]) return this.schema["default"];
|
||||
var def = this.schema["default"];
|
||||
if(def) {
|
||||
if (typeof def === "string") {
|
||||
return $.i18n(def);
|
||||
} else {
|
||||
return def;
|
||||
}
|
||||
}
|
||||
if(this.schema["enum"]) return this.schema["enum"][0];
|
||||
|
||||
var type = this.schema.type || this.schema.oneOf;
|
||||
|
@@ -1,149 +1,111 @@
|
||||
var storedAccess;
|
||||
var storedLang;
|
||||
var availLang = ['cs', 'de', 'en', 'es', 'fr', 'it', 'nl', 'nb', 'pl', 'pt', 'ro', 'sv', 'vi', 'ru', 'tr', 'zh-CN'];
|
||||
var availLangText = ['Čeština', 'Deutsch', 'English', 'Español', 'Français', 'Italiano', 'Nederlands', 'Norsk Bokmål', 'Polski', 'Português', 'Română', 'Svenska', 'Tiếng Việt', 'русский', 'Türkçe', '汉语'];
|
||||
var availAccess = ['default', 'advanced', 'expert'];
|
||||
|
||||
//$.i18n.debug = true;
|
||||
var storedAccess;
|
||||
|
||||
//Change Password
|
||||
function changePassword(){
|
||||
showInfoDialog('changePassword', $.i18n('InfoDialog_changePassword_title'));
|
||||
showInfoDialog('changePassword', $.i18n('InfoDialog_changePassword_title'));
|
||||
|
||||
// fill default pw if default is set
|
||||
if(window.defaultPasswordIsSet)
|
||||
$('#oldPw').val('hyperion')
|
||||
// fill default pw if default is set
|
||||
if(window.defaultPasswordIsSet)
|
||||
$('#oldPw').val('hyperion')
|
||||
|
||||
$('#id_btn_ok').off().on('click',function() {
|
||||
var oldPw = $('#oldPw').val();
|
||||
var newPw = $('#newPw').val();
|
||||
$('#id_btn_ok').off().on('click',function() {
|
||||
var oldPw = $('#oldPw').val();
|
||||
var newPw = $('#newPw').val();
|
||||
|
||||
requestChangePassword(oldPw, newPw)
|
||||
});
|
||||
requestChangePassword(oldPw, newPw)
|
||||
});
|
||||
|
||||
$('#newPw, #oldPw').off().on('input',function(e) {
|
||||
($('#oldPw').val().length >= 8 && $('#newPw').val().length >= 8) && !window.readOnlyMode ? $('#id_btn_ok').attr('disabled', false) : $('#id_btn_ok').attr('disabled', true);
|
||||
});
|
||||
$('#newPw, #oldPw').off().on('input',function(e) {
|
||||
($('#oldPw').val().length >= 8 && $('#newPw').val().length >= 8) && !window.readOnlyMode ? $('#id_btn_ok').attr('disabled', false) : $('#id_btn_ok').attr('disabled', true);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready( function() {
|
||||
$(document).ready(function () {
|
||||
|
||||
//i18n
|
||||
function initTrans(lc){
|
||||
if (lc == 'auto')
|
||||
{
|
||||
$.i18n().load().done(
|
||||
function() {
|
||||
performTranslation();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$.i18n().locale = lc;
|
||||
$.i18n().load( "i18n", lc ).done(
|
||||
function() {
|
||||
performTranslation();
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!storageComp()) {
|
||||
showInfoDialog('warning', "Can't store settings", "Your browser doesn't support localStorage. You can't save a specific language setting (fallback to 'auto detection') and access level (fallback to 'default'). Some wizards may be hidden. You could still use the webinterface without further issues");
|
||||
$('#language-select').attr("disabled", true);
|
||||
$('#btn_setaccess').attr("disabled", true);
|
||||
}
|
||||
|
||||
if (storageComp())
|
||||
{
|
||||
storedLang = getStorage("langcode");
|
||||
if (storedLang == null)
|
||||
{
|
||||
setStorage("langcode", 'auto');
|
||||
storedLang = 'auto';
|
||||
initTrans(storedLang);
|
||||
}
|
||||
else
|
||||
{
|
||||
initTrans(storedLang);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
showInfoDialog('warning', "Can't store settings", "Your browser doesn't support localStorage. You can't save a specific language setting (fallback to 'auto detection') and access level (fallback to 'default'). Some wizards may be hidden. You could still use the webinterface without further issues");
|
||||
initTrans('auto');
|
||||
storedLang = 'auto';
|
||||
storedAccess = "default";
|
||||
$('#btn_setlang').attr("disabled", true);
|
||||
$('#btn_setaccess').attr("disabled", true);
|
||||
}
|
||||
initLanguageSelection();
|
||||
|
||||
initLanguageSelection();
|
||||
//access
|
||||
storedAccess = getStorage("accesslevel");
|
||||
if (storedAccess == null) {
|
||||
storedAccess = "default";
|
||||
setStorage("accesslevel", storedAccess);
|
||||
}
|
||||
|
||||
//access
|
||||
storedAccess = getStorage("accesslevel");
|
||||
if (storedAccess == null)
|
||||
{
|
||||
setStorage("accesslevel", "default");
|
||||
storedAccess = "default";
|
||||
}
|
||||
if (!storageComp()) {
|
||||
showInfoDialog('warning', $.i18n('InfoDialog_nostorage_title'), $.i18n('InfoDialog_nostorage_text'));
|
||||
$('#btn_setlang').attr("disabled", true);
|
||||
}
|
||||
|
||||
$('#btn_setaccess').off().on('click',function() {
|
||||
var newAccess;
|
||||
showInfoDialog('select', $.i18n('InfoDialog_access_title'), $.i18n('InfoDialog_access_text'));
|
||||
$('#btn_setaccess').off().on('click',function() {
|
||||
var newAccess;
|
||||
showInfoDialog('select', $.i18n('InfoDialog_access_title'), $.i18n('InfoDialog_access_text'));
|
||||
|
||||
for (var lcx = 0; lcx<availAccess.length; lcx++)
|
||||
{
|
||||
$('#id_select').append(createSelOpt(availAccess[lcx], $.i18n('general_access_'+availAccess[lcx])));
|
||||
}
|
||||
for (var lcx = 0; lcx<availAccess.length; lcx++)
|
||||
{
|
||||
$('#id_select').append(createSelOpt(availAccess[lcx], $.i18n('general_access_'+availAccess[lcx])));
|
||||
}
|
||||
|
||||
$('#id_select').val(storedAccess);
|
||||
$('#id_select').val(storedAccess);
|
||||
|
||||
$('#id_select').off().on('change',function() {
|
||||
newAccess = $('#id_select').val();
|
||||
if (newAccess == storedAccess)
|
||||
$('#id_btn_saveset').attr('disabled', true);
|
||||
else
|
||||
$('#id_btn_saveset').attr('disabled', false);
|
||||
});
|
||||
$('#id_select').off().on('change',function() {
|
||||
newAccess = $('#id_select').val();
|
||||
if (newAccess == storedAccess)
|
||||
$('#id_btn_saveset').attr('disabled', true);
|
||||
else
|
||||
$('#id_btn_saveset').attr('disabled', false);
|
||||
});
|
||||
|
||||
$('#id_btn_saveset').off().on('click',function() {
|
||||
setStorage("accesslevel", newAccess);
|
||||
reload();
|
||||
});
|
||||
$('#id_btn_saveset').off().on('click',function() {
|
||||
setStorage("accesslevel", newAccess);
|
||||
reload();
|
||||
});
|
||||
|
||||
$('#id_select').trigger('change');
|
||||
});
|
||||
$('#id_select').trigger('change');
|
||||
});
|
||||
|
||||
// change pw btn
|
||||
$('#btn_changePassword').off().on('click',function() {
|
||||
changePassword();
|
||||
});
|
||||
// change pw btn
|
||||
$('#btn_changePassword').off().on('click',function() {
|
||||
changePassword();
|
||||
});
|
||||
|
||||
//Lock Ui
|
||||
$('#btn_lock_ui').off().on('click',function() {
|
||||
removeStorage('loginToken', true);
|
||||
location.replace('/');
|
||||
});
|
||||
//Lock Ui
|
||||
$('#btn_lock_ui').off().on('click',function() {
|
||||
removeStorage('loginToken', true);
|
||||
location.replace('/');
|
||||
});
|
||||
|
||||
//hide menu elements
|
||||
if (storedAccess != 'expert')
|
||||
$('#load_webconfig').toggle(false);
|
||||
//hide menu elements
|
||||
if (storedAccess != 'expert')
|
||||
$('#load_webconfig').toggle(false);
|
||||
|
||||
|
||||
// instance switcher
|
||||
$('#btn_instanceswitch').off().on('click',function() {
|
||||
var lsys = window.sysInfo.system.hostName+':'+window.serverConfig.webConfig.port;
|
||||
showInfoDialog('iswitch', $.i18n('InfoDialog_iswitch_title'), $.i18n('InfoDialog_iswitch_text'));
|
||||
// instance switcher
|
||||
$('#btn_instanceswitch').off().on('click',function() {
|
||||
var lsys = window.sysInfo.system.hostName+':'+window.serverConfig.webConfig.port;
|
||||
showInfoDialog('iswitch', $.i18n('InfoDialog_iswitch_title'), $.i18n('InfoDialog_iswitch_text'));
|
||||
|
||||
for (var i = 0; i<window.wSess.length; i++)
|
||||
{
|
||||
if(lsys != window.wSess[i].host+':'+window.wSess[i].port)
|
||||
{
|
||||
var hyperionAddress = window.wSess[i].address;
|
||||
if(hyperionAddress.indexOf(':') > -1 && hyperionAddress.length == 36) hyperionAddress = '['+hyperionAddress+']';
|
||||
hyperionAddress = 'http://'+hyperionAddress+':'+window.wSess[i].port;
|
||||
$('#id_select').append(createSelOpt(hyperionAddress, window.wSess[i].name));
|
||||
}
|
||||
}
|
||||
for (var i = 0; i<window.wSess.length; i++)
|
||||
{
|
||||
if(lsys != window.wSess[i].host+':'+window.wSess[i].port)
|
||||
{
|
||||
var hyperionAddress = window.wSess[i].address;
|
||||
if(hyperionAddress.indexOf(':') > -1 && hyperionAddress.length == 36) hyperionAddress = '['+hyperionAddress+']';
|
||||
hyperionAddress = 'http://'+hyperionAddress+':'+window.wSess[i].port;
|
||||
$('#id_select').append(createSelOpt(hyperionAddress, window.wSess[i].name));
|
||||
}
|
||||
}
|
||||
|
||||
$('#id_btn_saveset').off().on('click',function() {
|
||||
$("#loading_overlay").addClass("overlay");
|
||||
window.location.href = $('#id_select').val();
|
||||
});
|
||||
$('#id_btn_saveset').off().on('click',function() {
|
||||
$("#loading_overlay").addClass("overlay");
|
||||
window.location.href = $('#id_select').val();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
100
assets/webconfig/js/ui_utils.js
Executable file → Normal file
100
assets/webconfig/js/ui_utils.js
Executable file → Normal file
@@ -67,7 +67,7 @@ function updateSessions() {
|
||||
|
||||
function validateDuration(d) {
|
||||
if (typeof d === "undefined" || d < 0)
|
||||
return 0;
|
||||
return ENDLESS;
|
||||
else
|
||||
return d *= 1000;
|
||||
}
|
||||
@@ -162,25 +162,22 @@ function initLanguageSelection() {
|
||||
|
||||
var langLocale = storedLang;
|
||||
|
||||
// If no language has been set, resolve browser locale
|
||||
if (langLocale === 'auto') {
|
||||
langLocale = $.i18n().locale.substring(0, 2);
|
||||
}
|
||||
|
||||
// Resolve text for language code
|
||||
var langText = 'Please Select';
|
||||
|
||||
//Test, if language is supported by hyperion
|
||||
var langIdx = availLang.indexOf(langLocale);
|
||||
if (langIdx > -1) {
|
||||
langText = availLangText[langIdx];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// If language is not supported by hyperion, try fallback language
|
||||
langLocale = $.i18n().options.fallbackLocale.substring(0, 2);
|
||||
langIdx = availLang.indexOf(langLocale);
|
||||
if (langIdx > -1) {
|
||||
langText = availLangText[langIdx];
|
||||
} else {
|
||||
langLocale = 'en';
|
||||
langIdx = availLang.indexOf(langLocale);
|
||||
if (langIdx > -1) {
|
||||
langText = availLangText[langIdx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,10 +192,12 @@ function updateUiOnInstance(inst) {
|
||||
$('#btn_hypinstanceswitch').toggle(true);
|
||||
$('#active_instance_dropdown').prop('disabled', false);
|
||||
$('#active_instance_dropdown').css('cursor', 'pointer');
|
||||
$("#active_instance_dropdown").css("pointer-events", "auto");
|
||||
} else {
|
||||
$('#btn_hypinstanceswitch').toggle(false);
|
||||
$('#active_instance_dropdown').prop('disabled', true);
|
||||
$("#active_instance_dropdown").css('cursor', 'default');
|
||||
$("#active_instance_dropdown").css("pointer-events", "none");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,10 +287,12 @@ function showInfoDialog(type, header, message) {
|
||||
}
|
||||
else if (type == "changePassword") {
|
||||
$('#id_body_rename').html('<i style="margin-bottom:20px" class="fa fa-key modal-icon-edit"><br>');
|
||||
$('#id_body_rename').append('<h4>' + header + '</h4>');
|
||||
$('#id_body_rename').append('<input class="form-control" id="oldPw" placeholder="Old" type="text"> <br />');
|
||||
$('#id_body_rename').append('<input class="form-control" id="newPw" placeholder="New" type="password">');
|
||||
$('#id_footer_rename').html('<button type="button" id="id_btn_ok" class="btn btn-success" data-dismiss-modal="#modal_dialog_rename" disabled><i class="fa fa-fw fa-save"></i>' + $.i18n('general_btn_ok') + '</button>');
|
||||
$('#id_body_rename').append('<h4>' + header + '</h4><br>');
|
||||
$('#id_body_rename').append('<div class="row"><div class="col-md-3"><p class="text-left">' + $.i18n('infoDialog_password_current_text') +
|
||||
'</p></div><div class="col-md-8"><input class="form-control" id="oldPw" placeholder="Old" type="password"></div></div><br>');
|
||||
$('#id_body_rename').append('<div class="row"><div class="col-md-3"><p class="text-left">' + $.i18n('infoDialog_password_new_text')+
|
||||
'</p></div><div class="col-md-8"><input class="form-control" id="newPw" placeholder="New" type="password"></div></div>');
|
||||
$('#id_footer_rename').html('<button type="button" id="id_btn_ok" class="btn btn-success" data-dismiss-modal="#modal_dialog_rename" disabled><i class="fa fa-fw fa-save"></ul>' + $.i18n('general_btn_ok') + '</button>');
|
||||
$('#id_footer_rename').append('<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
|
||||
}
|
||||
else if (type == "checklist") {
|
||||
@@ -461,7 +462,8 @@ function createJsonEditor(container, schema, setconfig, usePanel, arrayre) {
|
||||
return editor;
|
||||
}
|
||||
|
||||
function updateJsonEditorSelection(editor, key, addElements, newEnumVals, newTitelVals, newDefaultVal, addSelect, addCustom, addCustomAsFirst, customText) {
|
||||
function updateJsonEditorSelection(rootEditor, path, key, addElements, newEnumVals, newTitelVals, newDefaultVal, addSelect, addCustom, addCustomAsFirst, customText) {
|
||||
var editor = rootEditor.getEditor(path);
|
||||
var orginalProperties = editor.schema.properties[key];
|
||||
|
||||
var newSchema = [];
|
||||
@@ -536,13 +538,15 @@ function updateJsonEditorSelection(editor, key, addElements, newEnumVals, newTit
|
||||
|
||||
editor.original_schema.properties[key] = orginalProperties;
|
||||
editor.schema.properties[key] = newSchema[key];
|
||||
rootEditor.validator.schema.properties[editor.key].properties[key] = newSchema[key];
|
||||
|
||||
editor.removeObjectProperty(key);
|
||||
delete editor.cached_editors[key];
|
||||
editor.addObjectProperty(key);
|
||||
}
|
||||
|
||||
function updateJsonEditorMultiSelection(editor, key, addElements, newEnumVals, newTitelVals, newDefaultVal) {
|
||||
function updateJsonEditorMultiSelection(rootEditor, path, key, addElements, newEnumVals, newTitelVals, newDefaultVal) {
|
||||
var editor = rootEditor.getEditor(path);
|
||||
var orginalProperties = editor.schema.properties[key];
|
||||
|
||||
var newSchema = [];
|
||||
@@ -593,36 +597,55 @@ function updateJsonEditorMultiSelection(editor, key, addElements, newEnumVals, n
|
||||
|
||||
editor.original_schema.properties[key] = orginalProperties;
|
||||
editor.schema.properties[key] = newSchema[key];
|
||||
rootEditor.validator.schema.properties[editor.key].properties[key] = newSchema[key];
|
||||
|
||||
editor.removeObjectProperty(key);
|
||||
delete editor.cached_editors[key];
|
||||
editor.addObjectProperty(key);
|
||||
}
|
||||
|
||||
function updateJsonEditorRange(editor, key, minimum, maximum, defaultValue, step) {
|
||||
function updateJsonEditorRange(rootEditor, path, key, minimum, maximum, defaultValue, step, clear) {
|
||||
var editor = rootEditor.getEditor(path);
|
||||
|
||||
//Preserve current value when updating range
|
||||
var currentValue = rootEditor.getEditor(path + "." + key).getValue();
|
||||
|
||||
var orginalProperties = editor.schema.properties[key];
|
||||
var newSchema = [];
|
||||
newSchema[key] = orginalProperties;
|
||||
|
||||
if (minimum) {
|
||||
if (clear) {
|
||||
delete newSchema[key]["minimum"];
|
||||
delete newSchema[key]["maximum"];
|
||||
delete newSchema[key]["default"];
|
||||
delete newSchema[key]["step"];
|
||||
}
|
||||
|
||||
if (typeof minimum !== "undefined") {
|
||||
newSchema[key]["minimum"] = minimum;
|
||||
}
|
||||
if (maximum) {
|
||||
if (typeof maximum !== "undefined") {
|
||||
newSchema[key]["maximum"] = maximum;
|
||||
}
|
||||
if (defaultValue) {
|
||||
if (typeof defaultValue !== "undefined") {
|
||||
newSchema[key]["default"] = defaultValue;
|
||||
currentValue = defaultValue;
|
||||
}
|
||||
if (step) {
|
||||
|
||||
if (typeof step !== "undefined") {
|
||||
newSchema[key]["step"] = step;
|
||||
}
|
||||
|
||||
editor.original_schema.properties[key] = orginalProperties;
|
||||
editor.schema.properties[key] = newSchema[key];
|
||||
rootEditor.validator.schema.properties[editor.key].properties[key] = newSchema[key];
|
||||
|
||||
editor.removeObjectProperty(key);
|
||||
delete editor.cached_editors[key];
|
||||
editor.addObjectProperty(key);
|
||||
|
||||
// Restore current (new default) value for new range
|
||||
rootEditor.getEditor(path + "." + key).setValue(currentValue);
|
||||
}
|
||||
|
||||
function buildWL(link, linkt, cl) {
|
||||
@@ -807,14 +830,15 @@ function createRow(id) {
|
||||
return el;
|
||||
}
|
||||
|
||||
function createOptPanel(phicon, phead, bodyid, footerid, css) {
|
||||
function createOptPanel(phicon, phead, bodyid, footerid, css, panelId) {
|
||||
phead = '<i class="fa ' + phicon + ' fa-fw"></i>' + phead;
|
||||
|
||||
var pfooter = document.createElement('button');
|
||||
pfooter.className = "btn btn-primary";
|
||||
pfooter.setAttribute("id", footerid);
|
||||
pfooter.innerHTML = '<i class="fa fa-fw fa-save"></i>' + $.i18n('general_button_savesettings');
|
||||
|
||||
return createPanel(phead, "", pfooter, "panel-default", bodyid, css);
|
||||
return createPanel(phead, "", pfooter, "panel-default", bodyid, css, panelId);
|
||||
}
|
||||
|
||||
function compareTwoValues(key1, key2, order = 'asc') {
|
||||
@@ -1141,14 +1165,34 @@ function isAccessLevelCompliant(accessLevel) {
|
||||
|
||||
function showInputOptions(path, elements, state) {
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
$('[data-schemapath="' + path + '.' + elements[i] + '"]').toggle(state);
|
||||
$('[data-schemapath="root.' + path + '.' + elements[i] + '"]').toggle(state);
|
||||
}
|
||||
}
|
||||
|
||||
function showInputOptionsForKey(editor, item, showForKey, state) {
|
||||
function showInputOptionForItem(editor, path, item, state) {
|
||||
var accessLevel = editor.schema.properties[path].properties[item].access;
|
||||
// Enable element only, if access level compliant
|
||||
if (!state || isAccessLevelCompliant(accessLevel)) {
|
||||
showInputOptions(path, [item], state);
|
||||
}
|
||||
}
|
||||
|
||||
function showInputOptionsForKey(editor, item, showForKeys, state) {
|
||||
var elements = [];
|
||||
var keysToshow = [];
|
||||
|
||||
if (Array.isArray(showForKeys)) {
|
||||
keysToshow = showForKeys;
|
||||
} else {
|
||||
if (typeof showForKeys === 'string') {
|
||||
keysToshow.push(showForKeys);
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
for (var key in editor.schema.properties[item].properties) {
|
||||
if (showForKey !== key) {
|
||||
if ($.inArray(key, keysToshow) === -1) {
|
||||
var accessLevel = editor.schema.properties[item].properties[key].access;
|
||||
|
||||
//Always disable all elements, but only enable elements, if access level compliant
|
||||
@@ -1157,5 +1201,5 @@ function showInputOptionsForKey(editor, item, showForKey, state) {
|
||||
}
|
||||
}
|
||||
}
|
||||
showInputOptions("root." + item, elements, state);
|
||||
showInputOptions(item, elements, state);
|
||||
}
|
||||
|
Reference in New Issue
Block a user