Skip to content

Commit 6f4d58c

Browse files
authored
Fixing configuration migration issues (#1855)
* Show effectsconfigurator menu entry, only if effectengine is available * Update schemas to accept empty arrays * Correct JSON processing * JSON getconfig API - allow filter to exclude all elements via "null" value * JSON API getconfig, exclude global and instances on higher level too * Stop WebServer before JSON API to avoid blocking calls by UI * Correct command scope
1 parent 0103540 commit 6f4d58c

File tree

21 files changed

+329
-259
lines changed

21 files changed

+329
-259
lines changed

assets/webconfig/js/ui_utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,12 @@ function updateUiOnInstance(inst) {
255255

256256
// Show menue items according to instance's running state
257257
if (isInstanceRunning(window.currentHyperionInstance)) {
258-
$("#MenuItemRemoteControl, #MenuItemEffectsConfig, #NavMenuWizards, #btn_open_ledsim").show();
258+
$("#MenuItemRemoteControl, #NavMenuWizards, #btn_open_ledsim").show();
259+
260+
//Show effectsconfigurator menu entry, only if effectengine is available
261+
if (jQuery.inArray("effectengine", window.serverInfo.services) !== -1) {
262+
$("#MenuItemEffectsConfig").show();
263+
}
259264

260265
const isMediaStreamingSupported = getStorage('mediaStreamingSupported');
261266
if (isMediaStreamingSupported) {

doc/development/JSON-API _Commands_Overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ _http/s Support_
4545
| clear | | Yes | Multi | Yes | Yes |
4646
| clearall | | Yes | Multi | Yes | Yes |
4747
| color | | Yes | Multi | Yes | Yes |
48-
| componentstate | | Yes | Multi | Yes | Yes |
48+
| componentstate | | Yes | No or Multi | Yes | Yes |
4949
| config | getconfig | Admin | No | No | Yes |
5050
| config | getschema | Admin | No | No | Yes |
5151
| config | reload | Admin | No | No | Yes |

include/api/JsonApiCommand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class ApiCommandRegister {
309309
{ {"clear", ""}, { Command::Clear, SubCommand::Empty, Authorization::Yes, InstanceCmd::Multi, InstanceCmd::MustRun_Yes, NoListenerCmd::Yes } },
310310
{ {"clearall", ""}, { Command::ClearAll, SubCommand::Empty, Authorization::Yes, InstanceCmd::Multi, InstanceCmd::MustRun_Yes, NoListenerCmd::Yes } },
311311
{ {"color", ""}, { Command::Color, SubCommand::Empty, Authorization::Yes, InstanceCmd::Multi, InstanceCmd::MustRun_Yes, NoListenerCmd::Yes } },
312-
{ {"componentstate", ""}, { Command::ComponentState, SubCommand::Empty, Authorization::Yes, InstanceCmd::Multi, InstanceCmd::MustRun_Yes, NoListenerCmd::Yes } },
312+
{ {"componentstate", ""}, { Command::ComponentState, SubCommand::Empty, Authorization::Yes, InstanceCmd::No_or_Multi, InstanceCmd::MustRun_Yes, NoListenerCmd::Yes } },
313313
{ {"config", "getconfig"}, { Command::Config, SubCommand::GetConfig, Authorization::Admin, InstanceCmd::No, InstanceCmd::MustRun_No, NoListenerCmd::Yes } },
314314
{ {"config", "getschema"}, { Command::Config, SubCommand::GetSchema, Authorization::Admin, InstanceCmd::No, InstanceCmd::MustRun_No, NoListenerCmd::Yes } },
315315
{ {"config", "reload"}, { Command::Config, SubCommand::Reload, Authorization::Admin, InstanceCmd::No, InstanceCmd::MustRun_No, NoListenerCmd::Yes } },

include/db/SettingsTable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include <QJsonDocument>
1414

15-
const int GLOABL_INSTANCE_ID = std::numeric_limits<quint8>::max();;
15+
const int NO_INSTANCE_ID = std::numeric_limits<quint8>::max();;
1616
const char DEFAULT_CONFIG_VERSION[] = "2.0.0-alpha.8";
1717

1818
///
@@ -23,7 +23,7 @@ class SettingsTable : public DBManager
2323

2424
public:
2525
/// construct wrapper with settings table
26-
SettingsTable(quint8 instance = GLOABL_INSTANCE_ID, QObject* parent = nullptr);
26+
SettingsTable(quint8 instance = NO_INSTANCE_ID, QObject* parent = nullptr);
2727

2828
///
2929
/// @brief Create or update a settings record

include/hyperion/SettingsManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class SettingsManager : public QObject
2323
/// @params instance Instance index of HyperionInstanceManager
2424
/// @params parent The parent hyperion instance
2525
///
26-
SettingsManager(quint8 instance = GLOABL_INSTANCE_ID, QObject* parent = nullptr);
26+
SettingsManager(quint8 instance = NO_INSTANCE_ID, QObject* parent = nullptr);
2727

2828
///
2929
/// @brief Save a complete JSON configuration

0 commit comments

Comments
 (0)