add linux memory (#5423)
Simon Smith committed
Oct 12, 2023 at 16:23 UTC
556d72dfad72ad80841154b7c90babe27c0c81b6
2 files changed
+46
views/default-mobile.handlebars
+23
@@ -6008,6 +6008,29 @@
6008
}
6009
}
6010
6011
+ if (hardware.linux) {
6012
+ if (hardware.linux.memory && (hardware.linux.memory.Memory_Device.length > 0)) {
6013
+ var x = '';
6014
+ // Sort Memory
6015
+ 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; });
6016
+
6017
+ x += '<table style=width:100%>';
6018
+ for (var i in hardware.linux.memory.Memory_Device) {
6019
+ var m = hardware.linux.memory.Memory_Device[i];
6020
+ if(m.Size && (m.Size == 'No Module Installed')) continue;
6021
+ x += '<tr><td><div class=style10 style=border-radius:5px;padding:8px>';
6022
+ x += '<div style=margin-bottom:3px><b>' + EscapeHtml((m.Locator ? m.Locator : 'Unknown')) + '</b></div>';
6023
+ if (m.Size && m.Speed) { x += addDetailItem("Capacity / Speed", format("{0}, {1}", m.Size, m.Speed), s); }
6024
+ else if (m.Size) { x += addDetailItem("Capacity", format("{0}", (m.Size)), s); }
6025
+ if (m.PartNumber) { x += addDetailItem("Part Number", EscapeHtml((m.Manufacturer && m.Manufacturer != 'Undefined')?(m.Manufacturer + ', '):'') + EscapeHtml(m.PartNumber), s); }
6026
+ x += '</div>';
6027
+ }
6028
+ x += '</table>';
6029
+
6030
+ if (x != '') { sections.push({ name: "Memory", html: x, img: 'ram'}); }
6031
+ }
6032
+ }
6033
+
6034
// Storage
6035
if (hardware.identifiers && ident.storage_devices) {
6036
var x = '';
views/default.handlebars
+23
@@ -11711,6 +11711,29 @@
11711
}
11712
}
11713
11714
+ if (hardware.linux) {
11715
+ if (hardware.linux.memory && (hardware.linux.memory.Memory_Device.length > 0)) {
11716
+ var x = '';
11717
+ // Sort Memory
11718
+ 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; });
11719
+
11720
+ x += '<table style=width:100%>';
11721
+ for (var i in hardware.linux.memory.Memory_Device) {
11722
+ var m = hardware.linux.memory.Memory_Device[i];
11723
+ if(m.Size && (m.Size == 'No Module Installed')) continue;
11724
+ x += '<tr><td><div class=style10 style=border-radius:5px;padding:8px>';
11725
+ x += '<div style=margin-bottom:3px><b>' + EscapeHtml((m.Locator ? m.Locator : 'Unknown')) + '</b></div>';
11726
+ if (m.Size && m.Speed) { x += addDetailItem("Capacity / Speed", format("{0}, {1}", m.Size, m.Speed), s); }
11727
+ else if (m.Size) { x += addDetailItem("Capacity", format("{0}", (m.Size)), s); }
11728
+ if (m.PartNumber) { x += addDetailItem("Part Number", EscapeHtml((m.Manufacturer && m.Manufacturer != 'Undefined')?(m.Manufacturer + ', '):'') + EscapeHtml(m.PartNumber), s); }
11729
+ x += '</div>';
11730
+ }
11731
+ x += '</table>';
11732
+
11733
+ if (x != '') { sections.push({ name: "Memory", html: x, img: 'ram64.png'}); }
11734
+ }
11735
+ }
11736
+
11737
// Storage
11738
if (hardware.identifiers && hardware.identifiers.storage_devices) {
11739
var x = '';