mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Add GUI/NonGUI mode to info page
This commit is contained in:
@@ -1224,6 +1224,7 @@ function getSystemInfo() {
|
|||||||
info += '- Avail Services: ' + window.serverInfo.services + '\n';
|
info += '- Avail Services: ' + window.serverInfo.services + '\n';
|
||||||
info += '- Config path: ' + shy.rootPath + '\n';
|
info += '- Config path: ' + shy.rootPath + '\n';
|
||||||
info += '- Database: ' + (shy.readOnlyMode ? "ready-only" : "read/write") + '\n';
|
info += '- Database: ' + (shy.readOnlyMode ? "ready-only" : "read/write") + '\n';
|
||||||
|
info += '- Mode: ' + (shy.isGuiMode ? "GUI" : "Non-GUI") + '\n';
|
||||||
|
|
||||||
info += '\n';
|
info += '\n';
|
||||||
|
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QHostInfo>
|
#include <QHostInfo>
|
||||||
#include <QMultiMap>
|
#include <QMultiMap>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QApplication>
|
||||||
|
|
||||||
// hyperion includes
|
// hyperion includes
|
||||||
#include <leddevice/LedDeviceWrapper.h>
|
#include <leddevice/LedDeviceWrapper.h>
|
||||||
@@ -389,6 +391,10 @@ void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command,
|
|||||||
hyperion["rootPath"] = _instanceManager->getRootPath();
|
hyperion["rootPath"] = _instanceManager->getRootPath();
|
||||||
hyperion["readOnlyMode"] = _hyperion->getReadOnlyMode();
|
hyperion["readOnlyMode"] = _hyperion->getReadOnlyMode();
|
||||||
|
|
||||||
|
bool isGuiMode{ true };
|
||||||
|
QCoreApplication* app = QCoreApplication::instance();
|
||||||
|
hyperion["isGuiMode"] = qobject_cast<QApplication*>(app) ? true : false;
|
||||||
|
|
||||||
info["hyperion"] = hyperion;
|
info["hyperion"] = hyperion;
|
||||||
|
|
||||||
// send the result
|
// send the result
|
||||||
|
Reference in New Issue
Block a user