add linux memory (#5423)

This commit is contained in:
Simon Smith 2023-10-12 16:23:56 +01:00 committed by GitHub
parent 9884db3ce0
commit 556d72dfad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 0 deletions

View File

@ -6008,6 +6008,29 @@
}
}
if (hardware.linux) {
if (hardware.linux.memory && (hardware.linux.memory.Memory_Device.length > 0)) {
var x = '';
// Sort Memory
hardware.linux.memory.Memory_Device.sort(function(a, b) { if (a.Locator > b.Locator) return 1; if (a.Locator < b.Locator) return -1; return 0; });
x += '<table style=width:100%>';
for (var i in hardware.linux.memory.Memory_Device) {
var m = hardware.linux.memory.Memory_Device[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.Locator ? m.Locator : '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); }
if (m.PartNumber) { x += addDetailItem("Part Number", EscapeHtml((m.Manufacturer && m.Manufacturer != 'Undefined')?(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

@ -11711,6 +11711,29 @@
}
}
if (hardware.linux) {
if (hardware.linux.memory && (hardware.linux.memory.Memory_Device.length > 0)) {
var x = '';
// Sort Memory
hardware.linux.memory.Memory_Device.sort(function(a, b) { if (a.Locator > b.Locator) return 1; if (a.Locator < b.Locator) return -1; return 0; });
x += '<table style=width:100%>';
for (var i in hardware.linux.memory.Memory_Device) {
var m = hardware.linux.memory.Memory_Device[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.Locator ? m.Locator : '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); }
if (m.PartNumber) { x += addDetailItem("Part Number", EscapeHtml((m.Manufacturer && m.Manufacturer != 'Undefined')?(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 = '';