mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
migrate std::string to qstring + add sysinfo via json (#412)
* std::string -> qstring part 1 * more string migration * more string migration ... * ... * more qstring mogrations add sysinfo via json * remove unneccessary includes * integrate sysinfo into webui
This commit is contained in:
@@ -256,6 +256,33 @@ QString JsonConnection::getServerInfo()
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString JsonConnection::getSysInfo()
|
||||
{
|
||||
qDebug() << "Get system info";
|
||||
|
||||
// create command
|
||||
QJsonObject command;
|
||||
command["command"] = QString("sysinfo");
|
||||
|
||||
// send command message
|
||||
QJsonObject reply = sendMessage(command);
|
||||
|
||||
// parse reply message
|
||||
if (parseReply(reply))
|
||||
{
|
||||
if (!reply.contains("info") || !reply["info"].isObject())
|
||||
{
|
||||
throw std::runtime_error("No info available in result");
|
||||
}
|
||||
|
||||
QJsonDocument doc(reply["info"].toObject());
|
||||
QString info(doc.toJson(QJsonDocument::Indented));
|
||||
return info;
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
void JsonConnection::clear(int priority)
|
||||
{
|
||||
qDebug() << "Clear priority channel " << priority;
|
||||
|
||||
Reference in New Issue
Block a user