mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-15 04:21:51 +00:00
always show operating system section and LastBootUpTime fix
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
8bc760855e
commit
7172d1f701
3 changed files with 118 additions and 111 deletions
|
@ -364,7 +364,18 @@ function linux_identifiers()
|
||||||
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
|
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
|
||||||
child.stderr.on('data', function () { });
|
child.stderr.on('data', function () { });
|
||||||
child.waitExit();
|
child.waitExit();
|
||||||
|
var regex = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
|
||||||
|
if (regex.test(child.stdout.str.trim())) {
|
||||||
values.linux.LastBootUpTime = child.stdout.str.trim();
|
values.linux.LastBootUpTime = child.stdout.str.trim();
|
||||||
|
} else {
|
||||||
|
child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||||
|
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
|
||||||
|
child.stdin.write('date -d "@$(( $(date +%s) - $(awk \'{print int($1)}\' /proc/uptime) ))" "+%Y-%m-%d %H:%M:%S"\nexit\n');
|
||||||
|
child.waitExit();
|
||||||
|
if (regex.test(child.stdout.str.trim())) {
|
||||||
|
values.linux.LastBootUpTime = child.stdout.str.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
child = null;
|
child = null;
|
||||||
} catch (ex) { }
|
} catch (ex) { }
|
||||||
|
|
||||||
|
|
|
@ -6152,7 +6152,6 @@
|
||||||
var sections = [], s = {};
|
var sections = [], s = {};
|
||||||
|
|
||||||
// Operating System
|
// Operating System
|
||||||
if ((hardware.windows && hardware.windows.osinfo) || node.osdesc) {
|
|
||||||
var x = '';
|
var x = '';
|
||||||
if (node.rname) { x += addDetailItem("Name", EscapeHtml(node.rname), s); }
|
if (node.rname) { x += addDetailItem("Name", EscapeHtml(node.rname), s); }
|
||||||
if (node.osdesc) { x += addDetailItem("Version", EscapeHtml(node.osdesc), s); }
|
if (node.osdesc) { x += addDetailItem("Version", EscapeHtml(node.osdesc), s); }
|
||||||
|
@ -6236,7 +6235,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x != '') { sections.push({ name: "Operating System", html: x, img: 'software' }); }
|
if (x != '') { sections.push({ name: "Operating System", html: x, img: 'software' }); }
|
||||||
}
|
|
||||||
|
|
||||||
// MeshAgent
|
// MeshAgent
|
||||||
if (node.agent) {
|
if (node.agent) {
|
||||||
|
|
|
@ -12018,7 +12018,6 @@
|
||||||
var sections = [], s = {};
|
var sections = [], s = {};
|
||||||
|
|
||||||
// Operating System
|
// Operating System
|
||||||
if ((hardware.windows && hardware.windows.osinfo) || node.osdesc) {
|
|
||||||
var x = '';
|
var x = '';
|
||||||
if (node.rname) { x += addDetailItem("Name", EscapeHtml(node.rname), s); }
|
if (node.rname) { x += addDetailItem("Name", EscapeHtml(node.rname), s); }
|
||||||
if (node.osdesc) { x += addDetailItem("Version", EscapeHtml(node.osdesc), s); }
|
if (node.osdesc) { x += addDetailItem("Version", EscapeHtml(node.osdesc), s); }
|
||||||
|
@ -12053,7 +12052,6 @@
|
||||||
x += addDetailItem("Last Boot Up Time", date);
|
x += addDetailItem("Last Boot Up Time", date);
|
||||||
}
|
}
|
||||||
if (x != '') { sections.push({ name: "Operating System", html: x, img: 'software64.png'}); }
|
if (x != '') { sections.push({ name: "Operating System", html: x, img: 'software64.png'}); }
|
||||||
}
|
|
||||||
|
|
||||||
// MeshAgent
|
// MeshAgent
|
||||||
if (node.agent) {
|
if (node.agent) {
|
||||||
|
|
Loading…
Reference in a new issue