Refactor config API

This commit is contained in:
LordGrey
2024-08-01 23:07:18 +02:00
parent 4a5b0b6bf2
commit c86af5ce79
42 changed files with 1605 additions and 889 deletions

View File

@@ -245,12 +245,6 @@ protected:
///
bool saveSettings(const QJsonObject &data);
///
/// @brief Restore settings object. Requires ADMIN ACCESS
/// @param data The data object
///
bool restoreSettings(const QJsonObject &data);
///
/// @brief Set the authorizationn state
/// @param authorized True, if authorized

View File

@@ -186,7 +186,7 @@ private:
///
void handleSourceSelectCommand(const QJsonObject &message, const JsonApiCommand& cmd);
/// Handle an incoming JSON GetConfig message and check subcommand
/// Handle an incoming JSON Config message and check subcommand
///
/// @param message the incoming message
///
@@ -204,6 +204,12 @@ private:
///
void handleConfigSetCommand(const QJsonObject &message, const JsonApiCommand& cmd);
/// Handle an incoming JSON GetConfig message from handleConfigCommand()
///
/// @param message the incoming message
///
void handleConfigGetCommand(const QJsonObject &message, const JsonApiCommand& cmd);
/// Handle an incoming JSON RestoreConfig message from handleConfigCommand()
///
/// @param message the incoming message

View File

@@ -84,6 +84,7 @@ public:
DeleteToken,
Discover,
GetConfig,
GetConfigOld,
GetInfo,
GetPendingTokenRequests,
GetProperties,
@@ -134,6 +135,7 @@ public:
case DeleteToken: return "deleteToken";
case Discover: return "discover";
case GetConfig: return "getconfig";
case GetConfigOld: return "getconfig-old";
case GetInfo: return "getInfo";
case GetPendingTokenRequests: return "getPendingTokenRequests";
case GetProperties: return "getProperties";
@@ -274,6 +276,7 @@ public:
{ {"color", ""}, { Command::Color, SubCommand::Empty, Authorization::Yes, InstanceCmd::Multi, NoListenerCmd::Yes} },
{ {"componentstate", ""}, { Command::ComponentState, SubCommand::Empty, Authorization::Yes, InstanceCmd::Multi, NoListenerCmd::Yes} },
{ {"config", "getconfig"}, { Command::Config, SubCommand::GetConfig, Authorization::Admin, InstanceCmd::Yes, NoListenerCmd::Yes} },
{ {"config", "getconfig-old"}, { Command::Config, SubCommand::GetConfigOld, Authorization::Admin, InstanceCmd::Yes, NoListenerCmd::Yes} },
{ {"config", "getschema"}, { Command::Config, SubCommand::GetSchema, Authorization::Admin, InstanceCmd::Yes, NoListenerCmd::Yes} },
{ {"config", "reload"}, { Command::Config, SubCommand::Reload, Authorization::Admin, InstanceCmd::Yes, NoListenerCmd::Yes} },
{ {"config", "restoreconfig"}, { Command::Config, SubCommand::RestoreConfig, Authorization::Admin, InstanceCmd::Yes, NoListenerCmd::Yes} },

View File

@@ -31,6 +31,8 @@ public:
static QJsonObject getSystemInfo(const Hyperion* hyperion);
QJsonObject discoverSources (const QString& sourceType, const QJsonObject& params);
static QJsonObject getConfiguration(const QList<quint8>& instances = {}, bool addGlobalConfig = true, const QStringList& instanceFilteredTypes = {}, const QStringList& globalFilterTypes = {} );
private:
template<typename GrabberType>