1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Add windows linux mac uptime (#5583)

* add linux uptime
* add mac uptime

---------

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith 2023-11-26 18:15:49 +00:00 committed by GitHub
parent 5581f3ace8
commit 7e1657d632
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 76 additions and 1 deletions

View file

@ -5858,7 +5858,33 @@
x += addDetailItem("Last Boot Up Time", date);
}
}
if(hardware.linux && hardware.linux.LastBootUpTime){
var lastBootUpTime = new Date(hardware.linux.LastBootUpTime);
var thedate = {
year: lastBootUpTime.getFullYear(),
month: lastBootUpTime.getMonth(),
day: lastBootUpTime.getDate(),
hours: lastBootUpTime.getHours(),
minutes: lastBootUpTime.getMinutes(),
seconds: lastBootUpTime.getSeconds()
};
const date = printDateTime(new Date(thedate.year, thedate.month, thedate.day, thedate.hours, thedate.minutes, thedate.seconds));
x += addDetailItem("Last Boot Up Time", date);
}
if(hardware.darwin && hardware.darwin.LastBootUpTime){
var lastBootUpTime = new Date(hardware.darwin.LastBootUpTime * 1000); // must times by 1000 even tho timestamp is correct?
var thedate = {
year: lastBootUpTime.getFullYear(),
month: lastBootUpTime.getMonth(),
day: lastBootUpTime.getDate(),
hours: lastBootUpTime.getHours(),
minutes: lastBootUpTime.getMinutes(),
seconds: lastBootUpTime.getSeconds()
};
const date = printDateTime(new Date(thedate.year, thedate.month, thedate.day, thedate.hours, thedate.minutes, thedate.seconds));
x += addDetailItem("Last Boot Up Time", date);
}
// Windows Security Central
if (node.wsc) {
var y = [];

View file

@ -11663,6 +11663,32 @@
x += addDetailItem("Last Boot Up Time", date);
}
}
if(hardware.linux && hardware.linux.LastBootUpTime){
var lastBootUpTime = new Date(hardware.linux.LastBootUpTime);
var thedate = {
year: lastBootUpTime.getFullYear(),
month: lastBootUpTime.getMonth(),
day: lastBootUpTime.getDate(),
hours: lastBootUpTime.getHours(),
minutes: lastBootUpTime.getMinutes(),
seconds: lastBootUpTime.getSeconds()
};
const date = printDateTime(new Date(thedate.year, thedate.month, thedate.day, thedate.hours, thedate.minutes, thedate.seconds));
x += addDetailItem("Last Boot Up Time", date);
}
if(hardware.darwin && hardware.darwin.LastBootUpTime){
var lastBootUpTime = new Date(hardware.darwin.LastBootUpTime * 1000); // must times by 1000 even tho timestamp is correct?
var thedate = {
year: lastBootUpTime.getFullYear(),
month: lastBootUpTime.getMonth(),
day: lastBootUpTime.getDate(),
hours: lastBootUpTime.getHours(),
minutes: lastBootUpTime.getMinutes(),
seconds: lastBootUpTime.getSeconds()
};
const date = printDateTime(new Date(thedate.year, thedate.month, thedate.day, thedate.hours, thedate.minutes, thedate.seconds));
x += addDetailItem("Last Boot Up Time", date);
}
if (x != '') { sections.push({ name: "Operating System", html: x, img: 'software64.png'}); }
}