mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-04-23 03:45:45 -04:00
Completed CPU/Mem live graph.
This commit is contained in:
parent
5c9ac190b5
commit
25168e29c2
2
public/scripts/amt-wsman-0.2.0-min.js
vendored
2
public/scripts/amt-wsman-0.2.0-min.js
vendored
File diff suppressed because one or more lines are too long
@ -2175,7 +2175,6 @@
|
|||||||
var now = (Date.now() / 1000), cpu = 0, memory = 0;
|
var now = (Date.now() / 1000), cpu = 0, memory = 0;
|
||||||
if (typeof message.cpu.total == 'number') { cpu = message.cpu.total; }
|
if (typeof message.cpu.total == 'number') { cpu = message.cpu.total; }
|
||||||
if (typeof message.memory.percentConsumed == 'number') { memory = message.memory.percentConsumed; }
|
if (typeof message.memory.percentConsumed == 'number') { memory = message.memory.percentConsumed; }
|
||||||
console.log(message.cpu);
|
|
||||||
deviceDetailsStatsData.push([now, cpu, memory]);
|
deviceDetailsStatsData.push([now, cpu, memory]);
|
||||||
deviceDetailsStatsDraw();
|
deviceDetailsStatsDraw();
|
||||||
} else if (message.type == 'console') { p15consoleReceive(nodes[index], message.value, message.source); } // This is a console message.
|
} else if (message.type == 'console') { p15consoleReceive(nodes[index], message.value, message.source); } // This is a console message.
|
||||||
@ -8667,6 +8666,7 @@
|
|||||||
if (window.deviceDetailsStatsChart != null) { delete window.deviceDetailsStatsChart; }
|
if (window.deviceDetailsStatsChart != null) { delete window.deviceDetailsStatsChart; }
|
||||||
if (deviceDetailsStatsTimer != null) { clearInterval(deviceDetailsStatsTimer); deviceDetailsStatsTimer = null; }
|
if (deviceDetailsStatsTimer != null) { clearInterval(deviceDetailsStatsTimer); deviceDetailsStatsTimer = null; }
|
||||||
deviceDetailsStatsData = [];
|
deviceDetailsStatsData = [];
|
||||||
|
deviceDetailsStatsDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
function deviceDetailsStatsTimerFunc() {
|
function deviceDetailsStatsTimerFunc() {
|
||||||
@ -8675,7 +8675,7 @@
|
|||||||
|
|
||||||
function deviceDetailsStatsDraw() {
|
function deviceDetailsStatsDraw() {
|
||||||
var now = Date.now() / 1000, oldLimit = (now - 100);
|
var now = Date.now() / 1000, oldLimit = (now - 100);
|
||||||
while (deviceDetailsStatsData[0][0] < (oldLimit - 5)) { deviceDetailsStatsData.shift(); }
|
while ((deviceDetailsStatsData.length > 0) && (deviceDetailsStatsData[0][0] < (oldLimit - 5))) { deviceDetailsStatsData.shift(); }
|
||||||
|
|
||||||
var cpu = [], memory = [];
|
var cpu = [], memory = [];
|
||||||
for (var i in deviceDetailsStatsData) {
|
for (var i in deviceDetailsStatsData) {
|
||||||
@ -8686,7 +8686,7 @@
|
|||||||
|
|
||||||
deviceDetailsConfig.data.datasets[0].data = cpu;
|
deviceDetailsConfig.data.datasets[0].data = cpu;
|
||||||
deviceDetailsConfig.data.datasets[1].data = memory;
|
deviceDetailsConfig.data.datasets[1].data = memory;
|
||||||
window.deviceDetailsStatsChart.update();
|
if (window.deviceDetailsStatsChart) { window.deviceDetailsStatsChart.update(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
var DeviceDetailsHardware = null;
|
var DeviceDetailsHardware = null;
|
||||||
@ -13452,6 +13452,9 @@
|
|||||||
// If we are trying to go to "My Users" and we are not a user manager, move to recordings
|
// If we are trying to go to "My Users" and we are not a user manager, move to recordings
|
||||||
if (((x == 4) && ((userinfo.siteadmin & 2) == 0)) || ((features & 4) != 0)) { x = 52; }
|
if (((x == 4) && ((userinfo.siteadmin & 2) == 0)) || ((features & 4) != 0)) { x = 52; }
|
||||||
|
|
||||||
|
// Stop the list graph if active
|
||||||
|
if (xxcurrentView == 17) deviceDetailsStatsClear();
|
||||||
|
|
||||||
// Edit this line when adding a new screen
|
// Edit this line when adding a new screen
|
||||||
for (var i = 0; i < 53; i++) { QV('p' + i, i == x); }
|
for (var i = 0; i < 53; i++) { QV('p' + i, i == x); }
|
||||||
xxcurrentView = x;
|
xxcurrentView = x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user