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

add mac memory/storage (#5869)

* add mac memory

* add macos storage

---------

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith 2024-02-28 15:19:14 +00:00 committed by GitHub
parent 269ec02dc0
commit 1b60e4dbfb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 130 additions and 1 deletions

View file

@ -6109,6 +6109,26 @@
}
}
if (hardware.darwin) {
if (hardware.darwin.memory && (hardware.darwin.memory.length > 0)) {
var x = '';
x += '<table style=width:100%>';
for (var i in hardware.darwin.memory) {
var m = hardware.darwin.memory[i];
if(m.Size && (m.Size == 'No Module Installed')) continue;
x += '<tr><td><div class=style10 style=border-radius:5px;padding:8px>';
x += '<div style=margin-bottom:3px><b>' + EscapeHtml((m.DeviceLocator ? m.DeviceLocator : 'Unknown')) + '</b></div>';
if (m.Size && m.Speed) { x += addDetailItem("Capacity / Speed", format("{0}, {1}", m.Size, m.Speed), s); }
else if (m.Size) { x += addDetailItem("Capacity", format("{0}", (m.Size)), s); }
console.log(m.Manufacturer);
if (m.PartNumber) { x += addDetailItem("Part Number", EscapeHtml((m.Manufacturer && m.Manufacturer != '')?(m.Manufacturer + ', '):'') + EscapeHtml(m.PartNumber), s); }
x += '</div>';
}
x += '</table>';
if (x != '') { sections.push({ name: "Memory", html: x, img: 'ram'}); }
}
}
// Storage
if (hardware.identifiers && ident.storage_devices) {
var x = '';

View file

@ -12091,6 +12091,26 @@
}
}
if (hardware.darwin) {
if (hardware.darwin.memory && (hardware.darwin.memory.length > 0)) {
var x = '';
x += '<table style=width:100%>';
for (var i in hardware.darwin.memory) {
var m = hardware.darwin.memory[i];
if(m.Size && (m.Size == 'No Module Installed')) continue;
x += '<tr><td><div class=style10 style=border-radius:5px;padding:8px>';
x += '<div style=margin-bottom:3px><b>' + EscapeHtml((m.DeviceLocator ? m.DeviceLocator : 'Unknown')) + '</b></div>';
if (m.Size && m.Speed) { x += addDetailItem("Capacity / Speed", format("{0}, {1}", m.Size, m.Speed), s); }
else if (m.Size) { x += addDetailItem("Capacity", format("{0}", (m.Size)), s); }
console.log(m.Manufacturer);
if (m.PartNumber) { x += addDetailItem("Part Number", EscapeHtml((m.Manufacturer && m.Manufacturer != '')?(m.Manufacturer + ', '):'') + EscapeHtml(m.PartNumber), s); }
x += '</div>';
}
x += '</table>';
if (x != '') { sections.push({ name: "Memory", html: x, img: 'ram64.png'}); }
}
}
// Storage
if (hardware.identifiers && hardware.identifiers.storage_devices) {
var x = '';