From 49cfca7b5e2ffff5c18aff02564df15532614d8d Mon Sep 17 00:00:00 2001 From: Lord-Grey Date: Sat, 23 Dec 2023 16:03:53 +0100 Subject: [PATCH] Add GUI/NonGUI mode to info page --- assets/webconfig/js/ui_utils.js | 1 + libsrc/api/JsonAPI.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/assets/webconfig/js/ui_utils.js b/assets/webconfig/js/ui_utils.js index d2a998dc..0061dde9 100644 --- a/assets/webconfig/js/ui_utils.js +++ b/assets/webconfig/js/ui_utils.js @@ -1224,6 +1224,7 @@ function getSystemInfo() { info += '- Avail Services: ' + window.serverInfo.services + '\n'; info += '- Config path: ' + shy.rootPath + '\n'; info += '- Database: ' + (shy.readOnlyMode ? "ready-only" : "read/write") + '\n'; + info += '- Mode: ' + (shy.isGuiMode ? "GUI" : "Non-GUI") + '\n'; info += '\n'; diff --git a/libsrc/api/JsonAPI.cpp b/libsrc/api/JsonAPI.cpp index 979a0bf4..6b16c4f9 100644 --- a/libsrc/api/JsonAPI.cpp +++ b/libsrc/api/JsonAPI.cpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include // hyperion includes #include @@ -389,6 +391,10 @@ void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command, hyperion["rootPath"] = _instanceManager->getRootPath(); hyperion["readOnlyMode"] = _hyperion->getReadOnlyMode(); + bool isGuiMode{ true }; + QCoreApplication* app = QCoreApplication::instance(); + hyperion["isGuiMode"] = qobject_cast(app) ? true : false; + info["hyperion"] = hyperion; // send the result