baseboard() added memMax, memSlots
This commit is contained in:
parent
c21a6e1f4f
commit
f207b4a38f
@ -328,13 +328,13 @@ function osInfo(callback) {
|
|||||||
util.promiseAll(
|
util.promiseAll(
|
||||||
workload
|
workload
|
||||||
).then(data => {
|
).then(data => {
|
||||||
let lines = data.results[0].toString().split('\r\n');
|
let lines = data.results[0] ? data.results[0].toString().split('\r\n') : [''];
|
||||||
result.distro = util.getValue(lines, 'Caption', '=').trim();
|
result.distro = util.getValue(lines, 'Caption', '=').trim();
|
||||||
result.serial = util.getValue(lines, 'SerialNumber', '=').trim();
|
result.serial = util.getValue(lines, 'SerialNumber', '=').trim();
|
||||||
result.build = util.getValue(lines, 'BuildNumber', '=').trim();
|
result.build = util.getValue(lines, 'BuildNumber', '=').trim();
|
||||||
result.servicepack = util.getValue(lines, 'ServicePackMajorVersion', '=').trim() + '.' + util.getValue(lines, 'ServicePackMinorVersion', '=').trim();
|
result.servicepack = util.getValue(lines, 'ServicePackMajorVersion', '=').trim() + '.' + util.getValue(lines, 'ServicePackMinorVersion', '=').trim();
|
||||||
result.codepage = util.getCodepage();
|
result.codepage = util.getCodepage();
|
||||||
const systeminfo = data.results[1].stdout.toString();
|
const systeminfo = data.results[1] ? data.results[1].stdout.toString() : '';
|
||||||
result.hypervisor = (systeminfo.indexOf('hypervisor has been detected') !== -1) || (systeminfo.indexOf('Es wurde ein Hypervisor erkannt') !== -1) || (systeminfo.indexOf('Un hyperviseur a ') !== -1);
|
result.hypervisor = (systeminfo.indexOf('hypervisor has been detected') !== -1) || (systeminfo.indexOf('Es wurde ein Hypervisor erkannt') !== -1) || (systeminfo.indexOf('Un hyperviseur a ') !== -1);
|
||||||
isUefiWindows().then(uefi => {
|
isUefiWindows().then(uefi => {
|
||||||
result.uefi = uefi;
|
result.uefi = uefi;
|
||||||
|
|||||||
@ -585,7 +585,7 @@ function baseboard(callback) {
|
|||||||
util.promiseAll(
|
util.promiseAll(
|
||||||
workload
|
workload
|
||||||
).then(data => {
|
).then(data => {
|
||||||
let lines = data.results[0].stdout.toString().split('\n');
|
let lines = data.results[0] ? data.results[0].stdout.toString().split('\n') : [''];
|
||||||
result.manufacturer = util.getValue(lines, 'Manufacturer');
|
result.manufacturer = util.getValue(lines, 'Manufacturer');
|
||||||
result.model = util.getValue(lines, 'Product Name');
|
result.model = util.getValue(lines, 'Product Name');
|
||||||
result.version = util.getValue(lines, 'Version');
|
result.version = util.getValue(lines, 'Version');
|
||||||
@ -611,7 +611,7 @@ function baseboard(callback) {
|
|||||||
if (result.assetTag.toLowerCase().indexOf('o.e.m.') !== -1) { result.assetTag = '-'; }
|
if (result.assetTag.toLowerCase().indexOf('o.e.m.') !== -1) { result.assetTag = '-'; }
|
||||||
|
|
||||||
// mem
|
// mem
|
||||||
lines = data.results[1].stdout.toString().split('\n');
|
lines = data.results[1] ? data.results[1].stdout.toString().split('\n') : [''];
|
||||||
result.memMax = util.toInt(util.getValue(lines, 'Maximum Capacity')) * 1024 * 1024 * 1024 || null;
|
result.memMax = util.toInt(util.getValue(lines, 'Maximum Capacity')) * 1024 * 1024 * 1024 || null;
|
||||||
result.memSlots = util.toInt(util.getValue(lines, 'Number Of Devices')) || null;
|
result.memSlots = util.toInt(util.getValue(lines, 'Number Of Devices')) || null;
|
||||||
|
|
||||||
@ -639,7 +639,7 @@ function baseboard(callback) {
|
|||||||
util.promiseAll(
|
util.promiseAll(
|
||||||
workload
|
workload
|
||||||
).then(data => {
|
).then(data => {
|
||||||
let lines = data.results[0].stdout.toString().replace(/[<>"]/g, '').split('\n');
|
let lines = data.results[0] ? data.results[0].stdout.toString().replace(/[<>"]/g, '').split('\n') : [''];
|
||||||
result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);
|
result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);
|
||||||
result.model = util.getValue(lines, 'model', '=', true);
|
result.model = util.getValue(lines, 'model', '=', true);
|
||||||
result.version = util.getValue(lines, 'version', '=', true);
|
result.version = util.getValue(lines, 'version', '=', true);
|
||||||
@ -647,9 +647,9 @@ function baseboard(callback) {
|
|||||||
result.assetTag = util.getValue(lines, 'board-id', '=', true);
|
result.assetTag = util.getValue(lines, 'board-id', '=', true);
|
||||||
|
|
||||||
// mem
|
// mem
|
||||||
let devices = data.results[1].stdout.toString().split(' BANK ');
|
let devices = data.results[1] ? data.results[1].stdout.toString().split(' BANK ') : [''];
|
||||||
if (devices.length === 1) {
|
if (devices.length === 1) {
|
||||||
devices = data.results[1].stdout.toString().split(' DIMM');
|
devices = data.results[1] ? data.results[1].stdout.toString().split(' DIMM') : [''];
|
||||||
}
|
}
|
||||||
devices.shift();
|
devices.shift();
|
||||||
result.memSlots = devices.length;
|
result.memSlots = devices.length;
|
||||||
@ -675,7 +675,7 @@ function baseboard(callback) {
|
|||||||
util.promiseAll(
|
util.promiseAll(
|
||||||
workload
|
workload
|
||||||
).then(data => {
|
).then(data => {
|
||||||
let lines = data.results[0].toString().split('\r\n');
|
let lines = data.results[0] ? data.results[0].toString().split('\r\n') : [''];
|
||||||
|
|
||||||
result.manufacturer = util.getValue(lines, 'manufacturer', '=');
|
result.manufacturer = util.getValue(lines, 'manufacturer', '=');
|
||||||
result.model = util.getValue(lines, 'model', '=');
|
result.model = util.getValue(lines, 'model', '=');
|
||||||
@ -690,7 +690,7 @@ function baseboard(callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// memphysical
|
// memphysical
|
||||||
lines = data.results[1].toString().split('\r\n');
|
lines = data.results[1] ? data.results[1].toString().split('\r\n') : [''];
|
||||||
result.memMax = util.toInt(util.getValue(lines, 'MaxCapacity', '=')) || null;
|
result.memMax = util.toInt(util.getValue(lines, 'MaxCapacity', '=')) || null;
|
||||||
result.memSlots = util.toInt(util.getValue(lines, 'MemoryDevices', '=')) || null;
|
result.memSlots = util.toInt(util.getValue(lines, 'MemoryDevices', '=')) || null;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user