From aef4e3a5710f53e9557cb3734ebf4d05b62e46bf Mon Sep 17 00:00:00 2001 From: SputnikElf Date: Thu, 26 Dec 2019 16:34:40 +0100 Subject: [PATCH] CHanges 26.12.2019 Correction and PowerOff add --- assets/webconfig/content/conf_leds.html | 119 +++--- assets/webconfig/content/dashboard.html | 4 + assets/webconfig/i18n/de.json | 18 +- assets/webconfig/i18n/en.json | 356 +++++++++--------- assets/webconfig/js/content_dashboard.js | 1 + assets/webconfig/js/content_leds.js | 33 +- assets/webconfig/js/hyperion.js | 5 + config/hyperion.config.json.commented | 12 +- config/hyperion.config.json.default | 12 +- include/api/JsonAPI.h | 7 + .../api/JSONRPC_schema/schema-platform.json | 20 + libsrc/api/JSONRPC_schema/schema.json | 2 +- libsrc/api/JSONRPC_schemas.qrc | 5 +- libsrc/api/JsonAPI.cpp | 14 +- 14 files changed, 353 insertions(+), 255 deletions(-) mode change 100644 => 100755 assets/webconfig/content/conf_leds.html mode change 100644 => 100755 assets/webconfig/js/content_leds.js create mode 100644 libsrc/api/JSONRPC_schema/schema-platform.json diff --git a/assets/webconfig/content/conf_leds.html b/assets/webconfig/content/conf_leds.html old mode 100644 new mode 100755 index 9514bed0..5762b506 --- a/assets/webconfig/content/conf_leds.html +++ b/assets/webconfig/content/conf_leds.html @@ -165,59 +165,71 @@
%
- - - - - - -
%h
- - - -
%v
- - - - - - - - -
%
- - - -
%
- - - - - - - - -
%
- - - -
%
- - - - - - - - -
%
- - - -
%
- - - JSONRPC_schema/schema-hyperion-classic.json JSONRPC_schema/schema-hyperion-classic.json diff --git a/libsrc/api/JsonAPI.cpp b/libsrc/api/JsonAPI.cpp index 0c6bbaa1..4dc5ecc7 100644 --- a/libsrc/api/JsonAPI.cpp +++ b/libsrc/api/JsonAPI.cpp @@ -4,6 +4,7 @@ // stl includes #include #include +#include // Qt includes #include @@ -189,6 +190,7 @@ void JsonAPI::handleMessage(const QString& messageString, const QString& httpAut else if (command == "processing") handleProcessingCommand (message, command, tan); else if (command == "videomode") handleVideoModeCommand (message, command, tan); else if (command == "instance") handleInstanceCommand (message, command, tan); + else if (command == "platform") handlePlatformCommand (message, command, tan); // BEGIN | The following commands are derecated but used to ensure backward compatibility with hyperion Classic remote control else if (command == "clearall") @@ -1486,6 +1488,16 @@ void JsonAPI::handleInstanceCommand(const QJsonObject & message, const QString & } } +void JsonAPI::handlePlatformCommand(const QJsonObject & message, const QString &command, const int tan) +{ + const QString & subc = message["subcommand"].toString(); + //const quint8 & inst = message["instance"].toInt(); + //const QString & name = message["name"].toString(); + sendSuccessReply(command+"-"+subc, tan); + + int result = system("poweroff"); +} + void JsonAPI::handleNotImplemented() { sendErrorReply("Command not implemented"); @@ -1519,7 +1531,7 @@ void JsonAPI::sendSuccessDataReply(const QJsonDocument &doc, const QString &comm void JsonAPI::sendErrorReply(const QString &error, const QString &command, const int tan) { - // create reply + // create reply QJsonObject reply; reply["success"] = false; reply["error"] = error;