mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Bugfixes [ColorOrder apply, hue wizard, ledDevice display] (#621)
* Resolve general colorOrder update issue * Fix: wizard.js syntax broken * Fix: Remove active device prop and migrate to config data * Fixing instanceStop Bug on WebUi (#10) * Fixing instanceStop Bug on WebUi * Added removeStorage * Changes to deletion logic * Improvements to deletion check * Feat: Show always save btn & rm generate btn
This commit is contained in:
parent
c94bcd8911
commit
145f88d5af
@ -182,7 +182,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer" style="text-align:right;">
|
||||
<button id="btn_cl_generate" class="btn btn-warning"><i class="fa fa-fw fa-television"></i><span data-i18n="conf_leds_layout_cl_generate">Generate LED configuration</span></button>
|
||||
<button id="btn_cl_save" class="btn btn-primary"><i class="fa fa-fw fa-save"></i><span data-i18n="conf_leds_layout_button_savelay">Save layout</span></button>
|
||||
</div>
|
||||
</div>
|
||||
@ -255,7 +254,6 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="panel-footer" style="text-align:right;">
|
||||
<button id="btn_ma_generate" class="btn btn-warning"><i class="fa fa-fw fa-th"></i><span data-i18n="conf_leds_layout_cl_generate">Generate LED configuration</span></button>
|
||||
<button id="btn_ma_save" class="btn btn-primary"><i class="fa fa-fw fa-save"></i><span data-i18n="conf_leds_layout_button_savelay">Save layout</span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -160,7 +160,6 @@
|
||||
"conf_leds_layout_cl_reversdir": "Richtung umkehren",
|
||||
"conf_leds_layout_cl_hleddepth": "Horizontale LED Tiefe",
|
||||
"conf_leds_layout_cl_vleddepth": "Vertikale LED Tiefe",
|
||||
"conf_leds_layout_cl_generate": "Generiere LED Konfiguration",
|
||||
"conf_leds_layout_cl_edgegap": "Rahmenabstand",
|
||||
"conf_leds_layout_cl_cornergap": "Eckabstand",
|
||||
"conf_leds_layout_cl_overlap": "Überlappung",
|
||||
|
@ -159,7 +159,6 @@
|
||||
"conf_leds_layout_cl_reversdir" : "Reverse direction",
|
||||
"conf_leds_layout_cl_hleddepth" : "Horizontal LED depth",
|
||||
"conf_leds_layout_cl_vleddepth" : "Vertical LED depth",
|
||||
"conf_leds_layout_cl_generate" : "Generate LED configuration",
|
||||
"conf_leds_layout_cl_edgegap" : "Edge Gap",
|
||||
"conf_leds_layout_cl_cornergap" : "Corner Gap",
|
||||
"conf_leds_layout_cl_overlap" : "Overlap",
|
||||
|
@ -74,7 +74,7 @@ $(document).ready( function() {
|
||||
}
|
||||
|
||||
// add more info
|
||||
$('#dash_leddevice').html(window.serverInfo.ledDevices.active);
|
||||
$('#dash_leddevice').html(window.serverConfig.device.type);
|
||||
$('#dash_currv').html(window.currentChannel+' '+window.currentVersion);
|
||||
$('#dash_instance').html(window.currentHyperionInstanceName);
|
||||
$('#dash_ports').html(window.serverConfig.flatbufServer.port+' | '+window.serverConfig.protoServer.port);
|
||||
|
@ -142,6 +142,10 @@ $(document).ready( function() {
|
||||
|
||||
if(!isInData)
|
||||
{
|
||||
//Delete Storage information about the last used but now stopped instance
|
||||
if (getStorage('lastSelectedInstance', false))
|
||||
removeStorage('lastSelectedInstance', false)
|
||||
|
||||
currentHyperionInstance = 0;
|
||||
currentHyperionInstanceName = getInstanceNameByIndex(0);
|
||||
requestServerConfig();
|
||||
|
@ -2,6 +2,7 @@
|
||||
var ledsCustomCfgInitialized = false;
|
||||
var finalLedArray = [];
|
||||
var conf_editor = null;
|
||||
var aceEdt = null;
|
||||
|
||||
function round(number) {
|
||||
var factor = Math.pow(10, 4);
|
||||
@ -53,6 +54,9 @@ function createLedPreview(leds, origin){
|
||||
if($('#leds_prev_toggle_num').hasClass('btn-success'))
|
||||
$('.led_prev_num').css("display", "inline");
|
||||
|
||||
// update ace Editor content
|
||||
aceEdt.set(finalLedArray);
|
||||
|
||||
}
|
||||
|
||||
function createClassicLeds(){
|
||||
@ -343,16 +347,9 @@ $(document).ready(function() {
|
||||
// check access level and adjust ui
|
||||
if(storedAccess == "default")
|
||||
{
|
||||
$('#btn_ma_generate').toggle(false);
|
||||
$('#btn_cl_generate').toggle(false);
|
||||
$('#texfield_panel').toggle(false);
|
||||
$('#previewcreator').toggle(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#btn_ma_save').toggle(false);
|
||||
$('#btn_cl_save').toggle(false);
|
||||
}
|
||||
|
||||
//Wiki link
|
||||
$('#leds_wl').append('<p style="font-weight:bold">'+$.i18n('general_wiki_moreto',$.i18n('conf_leds_nav_label_ledlayout'))+buildWL("user/moretopics/ledarea","Wiki")+'</p>');
|
||||
@ -371,7 +368,7 @@ $(document).ready(function() {
|
||||
// v4 of json schema with diff required assignment - remove when hyperion schema moved to v4
|
||||
var ledschema = {"items":{"additionalProperties":false,"required":["h","v"],"properties":{"colorOrder":{"enum":["rgb","bgr","rbg","brg","gbr","grb"],"type":"string"},"h":{"additionalProperties":false,"properties":{"max":{"maximum":1,"minimum":0,"type":"number"},"min":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"},"v":{"additionalProperties":false,"properties":{"max":{"maximum":1,"minimum":0,"type":"number"},"min":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"}},"type":"object"},"type":"array"};
|
||||
//create jsonace editor
|
||||
var aceEdt = new JSONACEEditor(document.getElementById("aceedit"),{
|
||||
aceEdt = new JSONACEEditor(document.getElementById("aceedit"),{
|
||||
mode: 'code',
|
||||
schema: ledschema,
|
||||
onChange: function(){
|
||||
@ -411,17 +408,6 @@ $(document).ready(function() {
|
||||
// leds to finalLedArray
|
||||
finalLedArray = window.serverConfig.leds;
|
||||
|
||||
// cl/ma leds push to textfield
|
||||
$('#btn_cl_generate, #btn_ma_generate').off().on("click", function(e) {
|
||||
if(e.currentTarget.id == "btn_cl_generate")
|
||||
$('#collapse1').collapse('hide');
|
||||
else
|
||||
$('#collapse2').collapse('hide');
|
||||
|
||||
aceEdt.set(finalLedArray);
|
||||
$('#collapse4').collapse('show');
|
||||
});
|
||||
|
||||
// create and update editor
|
||||
$("#leddevices").off().on("change", function() {
|
||||
var generalOptions = window.serverSchema.properties.device;
|
||||
@ -436,7 +422,7 @@ $(document).ready(function() {
|
||||
|
||||
var values_general = {};
|
||||
var values_specific = {};
|
||||
var isCurrentDevice = (window.serverInfo.ledDevices.active == $(this).val());
|
||||
var isCurrentDevice = (window.serverConfig.device.type == $(this).val());
|
||||
|
||||
for(var key in window.serverConfig.device){
|
||||
if (key != "type" && key in generalOptions.properties)
|
||||
@ -507,7 +493,7 @@ $(document).ready(function() {
|
||||
$("#leddevices").append(createSel(optArr[3], $.i18n('conf_leds_optgroup_network')));
|
||||
$("#leddevices").append(createSel(optArr[4], $.i18n('conf_leds_optgroup_usb')));
|
||||
$("#leddevices").append(createSel(optArr[5], $.i18n('conf_leds_optgroup_debug')));
|
||||
$("#leddevices").val(window.serverInfo.ledDevices.active);
|
||||
$("#leddevices").val(window.serverConfig.device.type);
|
||||
$("#leddevices").trigger("change");
|
||||
|
||||
// validate textfield and update preview
|
||||
|
@ -40,6 +40,17 @@ function setStorage(item, value, session)
|
||||
}
|
||||
}
|
||||
|
||||
function removeStorage(item, session)
|
||||
{
|
||||
if(storageComp())
|
||||
{
|
||||
if(session === true)
|
||||
sessionStorage.removeItem(item);
|
||||
else
|
||||
localStorage.removeItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
function debugMessage(msg)
|
||||
{
|
||||
if (window.debugMessagesActive)
|
||||
|
@ -705,6 +705,10 @@ function beginWizardHue()
|
||||
checkHueBridge(checkUserResult,$('#user').val() ? $('#user').val() : "newdeveloper");
|
||||
});
|
||||
|
||||
$('#btn_wiz_save').off().on("click", function(){
|
||||
var hueLedConfig = [];
|
||||
var finalLightIds = [];
|
||||
|
||||
//create hue led config
|
||||
for(var key in lightIDs)
|
||||
{
|
||||
@ -714,7 +718,7 @@ function beginWizardHue()
|
||||
finalLightIds.push(parseInt(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
window.serverConfig.leds = hueLedConfig;
|
||||
|
||||
|
@ -538,7 +538,6 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject& message, const QString&
|
||||
|
||||
// get available led devices
|
||||
QJsonObject ledDevices;
|
||||
ledDevices["active"] = _hyperion->getActiveDevice();
|
||||
QJsonArray availableLedDevices;
|
||||
for (auto dev: LedDeviceWrapper::getDeviceMap())
|
||||
{
|
||||
|
@ -235,6 +235,12 @@ void Hyperion::handleSettingsUpdate(const settings::type& type, const QJsonDocum
|
||||
{
|
||||
_ledString = hyperion::createLedString(getSetting(settings::LEDS).array(), hyperion::createColorOrder(dev));
|
||||
_imageProcessor->setLedString(_ledString);
|
||||
|
||||
_ledStringColorOrder.clear();
|
||||
for (Led& led : _ledString.leds())
|
||||
{
|
||||
_ledStringColorOrder.push_back(led.colorOrder);
|
||||
}
|
||||
}
|
||||
|
||||
// do always reinit until the led devices can handle dynamic changes
|
||||
|
Loading…
x
Reference in New Issue
Block a user