mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 18:20:23 +00:00
New API call to get a listing of all the CPU temps on the system,
if the "coretemp" module isn't loaded, it will be loaded beforehand
REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
"action" : "cputemps"
}
REST Response:
-------------------------------
{
"args": {
"cputemps": {
"cpu0": "27.0C",
"cpu1": "34.0C",
"cpu2": "33.0C",
"cpu3": "31.0C"
}
}
}
WebSocket Request:
-------------------------------
{
"args" : {
"action" : "cputemps"
},
"id" : "fooid",
"name" : "systeminfo",
"namespace" : "sysadm"
}
WebSocket Response:
-------------------------------
{
"args": {
"cputemps": {
"cpu0": "34.0C",
"cpu1": "32.0C",
"cpu2": "34.0C",
"cpu3": "31.0C"
}
},
"id": "fooid",
"name": "response",
"namespace": "sysadm"
}
This commit is contained in:
@@ -255,14 +255,18 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmSystemInfoRequest(const QJso
|
||||
bool ok = false;
|
||||
if(keys.contains("action")){
|
||||
QString act = JsonValueToString(in_args.toObject().value("action"));
|
||||
if(act=="externalmounts"){
|
||||
ok = true;
|
||||
out->insert("externalmounts", sysadm::SysInfo::externalDevicePaths());
|
||||
}
|
||||
if(act=="batteryinfo"){
|
||||
ok = true;
|
||||
out->insert("batteryinfo", sysadm::SysInfo::batteryInfo());
|
||||
}
|
||||
if(act=="cputemps"){
|
||||
ok = true;
|
||||
out->insert("cputemps", sysadm::SysInfo::cpuTemps());
|
||||
}
|
||||
if(act=="externalmounts"){
|
||||
ok = true;
|
||||
out->insert("externalmounts", sysadm::SysInfo::externalDevicePaths());
|
||||
}
|
||||
|
||||
} //end of "action" key usage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user