fix os max mamory (win), typings, graphics parse nvidia-smi
This commit is contained in:
parent
f7022c92f0
commit
43a673c331
@ -429,7 +429,7 @@ function graphics(callback) {
|
||||
}
|
||||
|
||||
const gpus = stdout.split('\n').filter(Boolean);
|
||||
const results = gpus.map(gpu => {
|
||||
let results = gpus.map(gpu => {
|
||||
const splittedData = gpu.split(', ').map(value => value.includes('N/A') ? undefined : value);
|
||||
if (splittedData.length === 16) {
|
||||
return {
|
||||
@ -450,9 +450,13 @@ function graphics(callback) {
|
||||
clockCore: safeParseNumber(splittedData[14]),
|
||||
clockMemory: safeParseNumber(splittedData[15]),
|
||||
};
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
});
|
||||
|
||||
results = results.filter((item) => {
|
||||
return ('pciBus' in item);
|
||||
});
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
4
lib/index.d.ts
vendored
4
lib/index.d.ts
vendored
@ -7,8 +7,8 @@ export namespace Systeminformation {
|
||||
// 1. General
|
||||
|
||||
interface TimeData {
|
||||
current: string;
|
||||
uptime: string;
|
||||
current: number;
|
||||
uptime: number;
|
||||
timezone: string;
|
||||
timezoneName: string;
|
||||
}
|
||||
|
||||
@ -307,6 +307,7 @@ function osInfo(callback) {
|
||||
result.codename = (result.release.indexOf('10.15') > -1 ? 'macOS Catalina' : result.codename);
|
||||
result.codename = (result.release.startsWith('11.') ? 'macOS Big Sur' : result.codename);
|
||||
result.codename = (result.release.startsWith('12.') ? 'macOS Monterey' : result.codename);
|
||||
result.codename = (result.release.startsWith('13.') ? 'macOS Ventura' : result.codename);
|
||||
result.uefi = true;
|
||||
result.codepage = util.getCodepage();
|
||||
if (callback) {
|
||||
|
||||
@ -662,8 +662,10 @@ function baseboard(callback) {
|
||||
if (_windows) {
|
||||
try {
|
||||
const workload = [];
|
||||
const win10plus = parseInt(os.release()) >= 10;
|
||||
const maxCapacityAttribute = win10plus ? 'MaxCapacityEx' : 'MaxCapacity';
|
||||
workload.push(util.powerShell('Get-WmiObject Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl'));
|
||||
workload.push(util.powerShell('Get-WmiObject Win32_physicalmemoryarray | select MaxCapacity, MemoryDevices | fl'));
|
||||
workload.push(util.powerShell(`Get-WmiObject Win32_physicalmemoryarray | select ${maxCapacityAttribute}, MemoryDevices | fl`));
|
||||
util.promiseAll(
|
||||
workload
|
||||
).then(data => {
|
||||
@ -683,7 +685,7 @@ function baseboard(callback) {
|
||||
|
||||
// memphysical
|
||||
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, maxCapacityAttribute, ':')) * (win10plus ? 1024 : 1) || null;
|
||||
result.memSlots = util.toInt(util.getValue(lines, 'MemoryDevices', ':')) || null;
|
||||
|
||||
if (callback) { callback(result); }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user