systeminformation 6.0.0-beta.24 → 6.0.0-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -6
- package/dist/bsd/index.d.ts +3 -0
- package/dist/bsd/index.js +7 -1
- package/dist/common/darwin.d.ts +1 -0
- package/dist/common/darwin.js +15 -3
- package/dist/common/defaults.js +15 -4
- package/dist/common/disk-speed.d.ts +20 -0
- package/dist/common/disk-speed.js +142 -0
- package/dist/common/filesys.d.ts +1 -1
- package/dist/common/filesys.js +24 -4
- package/dist/common/mappings.d.ts +1 -1
- package/dist/common/mappings.js +14 -4
- package/dist/common/types.d.ts +41 -0
- package/dist/common/windows.d.ts +1 -0
- package/dist/common/windows.js +19 -5
- package/dist/cpu-current-load.js +45 -0
- package/dist/cpu-current-speed.js +6 -0
- package/dist/darwin/bluetooth.d.ts +1 -1
- package/dist/darwin/bluetooth.js +2 -2
- package/dist/darwin/cpu-current-speed.d.ts +2 -0
- package/dist/darwin/cpu-current-speed.js +30 -0
- package/dist/darwin/cpu-temperature.js +7 -13
- package/dist/darwin/disk-speed.d.ts +2 -0
- package/dist/darwin/disk-speed.js +18 -0
- package/dist/darwin/disks-io.js +3 -1
- package/dist/darwin/fans.js +11 -13
- package/dist/darwin/gpu.d.ts +1 -1
- package/dist/darwin/gpu.js +4 -4
- package/dist/darwin/index.d.ts +3 -0
- package/dist/darwin/index.js +8 -2
- package/dist/darwin/network-interfaces.js +14 -4
- package/dist/darwin/network-routes.d.ts +3 -0
- package/dist/darwin/network-routes.js +74 -0
- package/dist/darwin/wifi-connections.js +3 -2
- package/dist/disk-speed.d.ts +1 -0
- package/dist/disk-speed.js +17 -0
- package/dist/get.js +5 -5
- package/dist/index.d.ts +12 -8
- package/dist/index.js +30 -21
- package/dist/inet-speed.d.ts +11 -0
- package/dist/inet-speed.js +152 -0
- package/dist/linux/block-devices.d.ts +1 -1
- package/dist/linux/block-devices.js +21 -5
- package/dist/linux/cpu-topology.d.ts +2 -0
- package/dist/linux/cpu-topology.js +15 -0
- package/dist/linux/disk-speed.d.ts +2 -0
- package/dist/linux/disk-speed.js +16 -0
- package/dist/linux/disks-io.d.ts +1 -1
- package/dist/linux/disks-io.js +18 -7
- package/dist/linux/index.d.ts +3 -0
- package/dist/linux/index.js +8 -2
- package/dist/linux/mem.js +20 -1
- package/dist/linux/network-interfaces.js +18 -7
- package/dist/linux/network-routes.d.ts +4 -0
- package/dist/linux/network-routes.js +69 -0
- package/dist/linux/os-info.js +32 -4
- package/dist/linux/pci.d.ts +1 -1
- package/dist/linux/pci.js +4 -3
- package/dist/linux/wifi-connections.d.ts +4 -0
- package/dist/linux/wifi-connections.js +20 -2
- package/dist/network-routes.d.ts +1 -0
- package/dist/network-routes.js +17 -0
- package/dist/powershell.d.ts +2 -0
- package/dist/powershell.js +15 -0
- package/dist/sun/index.d.ts +1 -0
- package/dist/sun/index.js +3 -1
- package/dist/windows/block-devices.js +6 -1
- package/dist/windows/cpu-topology.d.ts +3 -0
- package/dist/windows/cpu-topology.js +90 -0
- package/dist/windows/disk-speed.d.ts +6 -0
- package/dist/windows/disk-speed.js +73 -0
- package/dist/windows/disks-io.js +3 -1
- package/dist/windows/index.d.ts +3 -0
- package/dist/windows/index.js +8 -2
- package/dist/windows/network-interfaces.js +6 -3
- package/dist/windows/network-routes.d.ts +3 -0
- package/dist/windows/network-routes.js +41 -0
- package/dist/windows/wifi-connections.d.ts +1 -0
- package/dist/windows/wifi-connections.js +10 -3
- package/package.json +1 -1
package/dist/common/mappings.js
CHANGED
|
@@ -294,8 +294,6 @@ const getLogoFile = (distro = '') => {
|
|
|
294
294
|
return 'windows';
|
|
295
295
|
case distro.indexOf('mac os') !== -1 || distro.indexOf('macos') !== -1:
|
|
296
296
|
return 'apple';
|
|
297
|
-
case distro.indexOf('arch') !== -1:
|
|
298
|
-
return 'arch';
|
|
299
297
|
case distro.indexOf('cachy') !== -1:
|
|
300
298
|
return 'cachy';
|
|
301
299
|
case distro.indexOf('centos') !== -1:
|
|
@@ -334,10 +332,20 @@ const getLogoFile = (distro = '') => {
|
|
|
334
332
|
return 'pclinuxos';
|
|
335
333
|
case distro.indexOf('puppy') !== -1:
|
|
336
334
|
return 'puppy';
|
|
337
|
-
case distro.indexOf('popos') !== -1:
|
|
335
|
+
case distro.indexOf('popos') !== -1 || distro.indexOf('pop!_os') !== -1:
|
|
338
336
|
return 'popos';
|
|
339
|
-
case distro.indexOf('raspbian') !== -1:
|
|
337
|
+
case distro.indexOf('raspbian') !== -1 || distro.indexOf('raspberry') !== -1:
|
|
340
338
|
return 'raspbian';
|
|
339
|
+
case distro.indexOf('nixos') !== -1:
|
|
340
|
+
return 'nixos';
|
|
341
|
+
case distro.indexOf('zorin') !== -1:
|
|
342
|
+
return 'zorin';
|
|
343
|
+
case distro.indexOf('garuda') !== -1:
|
|
344
|
+
return 'garuda';
|
|
345
|
+
case distro.indexOf('nobara') !== -1:
|
|
346
|
+
return 'nobara';
|
|
347
|
+
case distro.indexOf('bazzite') !== -1:
|
|
348
|
+
return 'bazzite';
|
|
341
349
|
case distro.indexOf('reactos') !== -1:
|
|
342
350
|
return 'reactos';
|
|
343
351
|
case distro.indexOf('redhat') !== -1:
|
|
@@ -366,6 +374,8 @@ const getLogoFile = (distro = '') => {
|
|
|
366
374
|
return 'ferenos';
|
|
367
375
|
case distro.indexOf('robolinux') !== -1:
|
|
368
376
|
return 'robolinux';
|
|
377
|
+
case distro.indexOf('arch') !== -1:
|
|
378
|
+
return 'arch';
|
|
369
379
|
default:
|
|
370
380
|
return const_1.PLATFORM;
|
|
371
381
|
}
|
package/dist/common/types.d.ts
CHANGED
|
@@ -376,6 +376,12 @@ export type CurrentLoadCpuData = {
|
|
|
376
376
|
rawLoadIdle: number;
|
|
377
377
|
rawLoadIowait: number;
|
|
378
378
|
rawLoadIrq: number;
|
|
379
|
+
coreId: number | null;
|
|
380
|
+
socketId: number | null;
|
|
381
|
+
};
|
|
382
|
+
export type CpuTopologyData = {
|
|
383
|
+
coreId: number | null;
|
|
384
|
+
socketId: number | null;
|
|
379
385
|
};
|
|
380
386
|
export type WifiNetworkData = {
|
|
381
387
|
ssid: string;
|
|
@@ -409,6 +415,7 @@ export type WifiConnectionData = {
|
|
|
409
415
|
signalLevel: number | null;
|
|
410
416
|
quality: number | null;
|
|
411
417
|
txRate: number | null;
|
|
418
|
+
rxRate: number | null;
|
|
412
419
|
};
|
|
413
420
|
export type InetChecksiteData = {
|
|
414
421
|
url: string;
|
|
@@ -448,6 +455,8 @@ export type MemData = {
|
|
|
448
455
|
swapfree: number;
|
|
449
456
|
writeback: number;
|
|
450
457
|
dirty: number;
|
|
458
|
+
swapin_sec: number | null;
|
|
459
|
+
swapout_sec: number | null;
|
|
451
460
|
};
|
|
452
461
|
export type MemLayoutData = {
|
|
453
462
|
size: number;
|
|
@@ -495,6 +504,14 @@ export type OsData = {
|
|
|
495
504
|
remoteSession?: boolean;
|
|
496
505
|
hypervisor?: boolean;
|
|
497
506
|
};
|
|
507
|
+
export type InetSpeedData = {
|
|
508
|
+
server: string;
|
|
509
|
+
downloadSpeed: number | null;
|
|
510
|
+
uploadSpeed: number | null;
|
|
511
|
+
downloadMB: number;
|
|
512
|
+
uploadMB: number;
|
|
513
|
+
ms: number;
|
|
514
|
+
};
|
|
498
515
|
export type InetPublicIpData = {
|
|
499
516
|
ip4: string;
|
|
500
517
|
ip6: string;
|
|
@@ -641,6 +658,19 @@ export type FsBlockDevicesData = {
|
|
|
641
658
|
protocol: string;
|
|
642
659
|
group: string;
|
|
643
660
|
device: string;
|
|
661
|
+
partUuid: string;
|
|
662
|
+
partLabel: string;
|
|
663
|
+
partType: string;
|
|
664
|
+
partFlags: string;
|
|
665
|
+
partStart: number | null;
|
|
666
|
+
};
|
|
667
|
+
export type DiskSpeedData = {
|
|
668
|
+
path: string;
|
|
669
|
+
fs: string;
|
|
670
|
+
sizeMB: number;
|
|
671
|
+
writeSpeed: number | null;
|
|
672
|
+
readSpeed: number | null;
|
|
673
|
+
ms: number;
|
|
644
674
|
};
|
|
645
675
|
export type FsStatsData = {
|
|
646
676
|
rx: number;
|
|
@@ -664,6 +694,8 @@ export type DisksIoData = {
|
|
|
664
694
|
rWaitPercent: number | null;
|
|
665
695
|
wWaitPercent: number | null;
|
|
666
696
|
tWaitPercent: number | null;
|
|
697
|
+
busyPercent: number | null;
|
|
698
|
+
idlePercent: number | null;
|
|
667
699
|
ms: number;
|
|
668
700
|
};
|
|
669
701
|
export type SmartData = {
|
|
@@ -979,6 +1011,14 @@ export type NetworkInterfacesData = {
|
|
|
979
1011
|
ieee8021xAuth: string;
|
|
980
1012
|
ieee8021xState: string;
|
|
981
1013
|
carrierChanges: number;
|
|
1014
|
+
bridgeMembers: string[];
|
|
1015
|
+
};
|
|
1016
|
+
export type NetworkRouteData = {
|
|
1017
|
+
destination: string;
|
|
1018
|
+
gateway: string;
|
|
1019
|
+
iface: string;
|
|
1020
|
+
metric: number | null;
|
|
1021
|
+
family: string;
|
|
982
1022
|
};
|
|
983
1023
|
export type NetworkStatsData = {
|
|
984
1024
|
iface: string;
|
|
@@ -1053,6 +1093,7 @@ export type PciData = {
|
|
|
1053
1093
|
subDeviceId: string;
|
|
1054
1094
|
revision: string;
|
|
1055
1095
|
driver: string;
|
|
1096
|
+
iommuGroup: string;
|
|
1056
1097
|
};
|
|
1057
1098
|
export type NpuData = {
|
|
1058
1099
|
vendor: string;
|
package/dist/common/windows.d.ts
CHANGED
package/dist/common/windows.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.windowsPciBusAddresses = exports.matchPnpLocation = exports.parseWindowsPnpLocations = exports.parseWindowsLocationInfo = exports.ps = exports.psArray = void 0;
|
|
4
4
|
const node_child_process_1 = require("node:child_process");
|
|
5
|
-
const exec_1 = require("./exec");
|
|
6
5
|
const files_1 = require("../common/files");
|
|
7
6
|
const const_1 = require("./const");
|
|
7
|
+
const exec_1 = require("./exec");
|
|
8
8
|
const JOB_TIMEOUT_MS = 60000;
|
|
9
9
|
let _powerShell = '';
|
|
10
10
|
const pickPowerShellExecutable = async () => {
|
|
@@ -243,6 +243,7 @@ class PowerShellPool {
|
|
|
243
243
|
workers;
|
|
244
244
|
_rr;
|
|
245
245
|
_started;
|
|
246
|
+
_generation;
|
|
246
247
|
constructor({ size = 2, env = { LANG: 'en_US.UTF-8' } } = {}) {
|
|
247
248
|
this.size = Math.max(1, Math.trunc(size));
|
|
248
249
|
this.env = env;
|
|
@@ -250,18 +251,24 @@ class PowerShellPool {
|
|
|
250
251
|
this._rr = 0;
|
|
251
252
|
this.exe = '';
|
|
252
253
|
this._started = null;
|
|
254
|
+
this._generation = 0;
|
|
253
255
|
}
|
|
254
256
|
start() {
|
|
255
257
|
if (!this._started) {
|
|
258
|
+
const generation = ++this._generation;
|
|
256
259
|
this._started = (async () => {
|
|
257
|
-
|
|
260
|
+
const exe = await pickPowerShellExecutable();
|
|
261
|
+
if (generation !== this._generation)
|
|
262
|
+
return;
|
|
263
|
+
this.exe = exe;
|
|
258
264
|
for (let i = 0; i < this.size; i++) {
|
|
259
265
|
const w = new PowerShellWorker({ exe: this.exe, env: this.env });
|
|
260
266
|
w.start();
|
|
261
267
|
this.workers.push(w);
|
|
262
268
|
}
|
|
263
269
|
})().catch((err) => {
|
|
264
|
-
this.
|
|
270
|
+
if (generation === this._generation)
|
|
271
|
+
this._started = null;
|
|
265
272
|
throw err;
|
|
266
273
|
});
|
|
267
274
|
}
|
|
@@ -269,6 +276,10 @@ class PowerShellPool {
|
|
|
269
276
|
}
|
|
270
277
|
async exec(script) {
|
|
271
278
|
await this.start();
|
|
279
|
+
if (!this.workers.length)
|
|
280
|
+
await this.start();
|
|
281
|
+
if (!this.workers.length)
|
|
282
|
+
throw new Error('PowerShell pool not available');
|
|
272
283
|
const idx = this._rr++ % this.workers.length;
|
|
273
284
|
let w = this.workers[idx];
|
|
274
285
|
if (w.dead) {
|
|
@@ -279,6 +290,7 @@ class PowerShellPool {
|
|
|
279
290
|
return w.exec(script);
|
|
280
291
|
}
|
|
281
292
|
async stop() {
|
|
293
|
+
this._generation++;
|
|
282
294
|
for (const w of this.workers)
|
|
283
295
|
w.stop();
|
|
284
296
|
this.workers = [];
|
|
@@ -323,7 +335,9 @@ const parseWindowsPnpLocations = (stdout) => {
|
|
|
323
335
|
};
|
|
324
336
|
exports.parseWindowsPnpLocations = parseWindowsPnpLocations;
|
|
325
337
|
const matchPnpLocation = (deviceId, locations) => {
|
|
326
|
-
const id = String(deviceId ?? '')
|
|
338
|
+
const id = String(deviceId ?? '')
|
|
339
|
+
.trim()
|
|
340
|
+
.toLowerCase();
|
|
327
341
|
if (!id) {
|
|
328
342
|
return '';
|
|
329
343
|
}
|
|
@@ -336,7 +350,7 @@ const matchPnpLocation = (deviceId, locations) => {
|
|
|
336
350
|
};
|
|
337
351
|
exports.matchPnpLocation = matchPnpLocation;
|
|
338
352
|
const PS_PNP_DISPLAY_LOCATIONS = 'Get-PnpDevice -Class Display -PresentOnly -ErrorAction SilentlyContinue | ForEach-Object { ' +
|
|
339
|
-
|
|
353
|
+
'$l = ($_ | Get-PnpDeviceProperty -KeyName DEVPKEY_Device_LocationInfo -ErrorAction SilentlyContinue).Data; "$($_.InstanceId)|$l" }';
|
|
340
354
|
const windowsPciBusAddresses = async () => {
|
|
341
355
|
try {
|
|
342
356
|
return (0, exports.parseWindowsPnpLocations)(await (0, exec_1.shareInflight)('pnpDisplayLocations', () => exports.ps.exec(PS_PNP_DISPLAY_LOCATIONS)));
|
package/dist/cpu-current-load.js
CHANGED
|
@@ -53,6 +53,46 @@ const avgLoadEwma = (previous, busyCores, seconds) => {
|
|
|
53
53
|
};
|
|
54
54
|
exports.avgLoadEwma = avgLoadEwma;
|
|
55
55
|
const avgLoadFromEwma = (cores) => (cores ? parseFloat((Math.max(..._avgLoadEwma) / cores).toFixed(2)) : 0);
|
|
56
|
+
const TOPOLOGY_TRIES = 3;
|
|
57
|
+
let _topology = [];
|
|
58
|
+
let _topologyRead = null;
|
|
59
|
+
let _topologyTries = 0;
|
|
60
|
+
let _topologyTriesCount = -1;
|
|
61
|
+
const readCpuTopology = async () => {
|
|
62
|
+
switch (true) {
|
|
63
|
+
case const_1.LINUX:
|
|
64
|
+
return (await import('./linux/cpu-topology.js')).cpuTopology();
|
|
65
|
+
case const_1.WINDOWS:
|
|
66
|
+
return (await import('./windows/cpu-topology.js')).cpuTopology();
|
|
67
|
+
case const_1.DARWIN:
|
|
68
|
+
return (0, node_os_1.arch)() === 'arm64' ? (0, node_os_1.cpus)().map((_, i) => ({ coreId: i, socketId: 0 })) : [];
|
|
69
|
+
default:
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const cpuTopology = async (count) => {
|
|
74
|
+
if (_topology.length !== count) {
|
|
75
|
+
if (_topologyTriesCount !== count) {
|
|
76
|
+
_topologyTriesCount = count;
|
|
77
|
+
_topologyTries = 0;
|
|
78
|
+
}
|
|
79
|
+
if (_topologyTries < TOPOLOGY_TRIES || _topologyRead) {
|
|
80
|
+
if (!_topologyRead) {
|
|
81
|
+
_topologyTries++;
|
|
82
|
+
_topologyRead = readCpuTopology()
|
|
83
|
+
.catch(() => [])
|
|
84
|
+
.finally(() => {
|
|
85
|
+
_topologyRead = null;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const topology = await _topologyRead;
|
|
89
|
+
if (topology.length === count) {
|
|
90
|
+
_topology = topology;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return _topology.length === count ? _topology : [];
|
|
95
|
+
};
|
|
56
96
|
const currentLoad = async () => {
|
|
57
97
|
await (0, common_1.nextTick)();
|
|
58
98
|
const loads = (0, node_os_1.loadavg)().map((x) => x / (0, node_os_1.cpus)().length);
|
|
@@ -290,6 +330,11 @@ const currentLoad = async () => {
|
|
|
290
330
|
cpus: cores
|
|
291
331
|
};
|
|
292
332
|
}
|
|
333
|
+
const topology = await cpuTopology(result.cpus.length);
|
|
334
|
+
result.cpus.forEach((core, i) => {
|
|
335
|
+
core.coreId = topology[i]?.coreId ?? null;
|
|
336
|
+
core.socketId = topology[i]?.socketId ?? null;
|
|
337
|
+
});
|
|
293
338
|
return result;
|
|
294
339
|
};
|
|
295
340
|
exports.currentLoad = currentLoad;
|
|
@@ -71,6 +71,12 @@ const getCpuCurrentSpeed = async () => {
|
|
|
71
71
|
exports.getCpuCurrentSpeed = getCpuCurrentSpeed;
|
|
72
72
|
const cpuCurrentSpeed = async () => {
|
|
73
73
|
await (0, common_1.nextTick)();
|
|
74
|
+
if (const_1.DARWIN && (0, node_os_1.arch)() === 'arm64') {
|
|
75
|
+
const appleSilicon = await (await import('./darwin/cpu-current-speed.js')).appleSiliconSpeed();
|
|
76
|
+
if (appleSilicon) {
|
|
77
|
+
return appleSilicon;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
74
80
|
let result = await (0, exports.getCpuCurrentSpeed)();
|
|
75
81
|
if (result.avg === 0 && (0, cpu_1.getCpuSpeed)() !== 0) {
|
|
76
82
|
const currCpuSpeed = (0, cpu_1.getCpuSpeed)();
|
package/dist/darwin/bluetooth.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.bluetoothDevices = exports.parseBluetooth = void 0;
|
|
4
|
-
const darwin_1 = require("./../common/darwin");
|
|
5
4
|
const common_1 = require("../common");
|
|
5
|
+
const darwin_1 = require("./../common/darwin");
|
|
6
6
|
const exec_1 = require("../common/exec");
|
|
7
7
|
const mappings_1 = require("../common/mappings");
|
|
8
8
|
const deviceId = (id) => {
|
|
9
|
-
return id.split('
|
|
9
|
+
return id.split(' < ')[0];
|
|
10
10
|
};
|
|
11
11
|
const parseBluetoothObjects = (bluetoothObject, macAddr2) => {
|
|
12
12
|
const typeStr = ((bluetoothObject.device_minorClassOfDevice_string || bluetoothObject.device_majorClassOfDevice_string || bluetoothObject.device_minorType || '') + (bluetoothObject.device_name || '')).toLowerCase();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.appleSiliconSpeed = void 0;
|
|
4
|
+
const round2 = (value) => Math.round(value * 100) / 100;
|
|
5
|
+
const appleSiliconSpeed = async () => {
|
|
6
|
+
try {
|
|
7
|
+
const smc = require('macos-smc');
|
|
8
|
+
if (typeof smc.frequencies !== 'function') {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const res = await smc.frequencies();
|
|
12
|
+
const cores = (res?.cpu?.cores || [])
|
|
13
|
+
.map((core) => (typeof core?.mhz === 'number' ? core.mhz : core?.minMhz))
|
|
14
|
+
.filter((mhz) => typeof mhz === 'number' && mhz > 0)
|
|
15
|
+
.map((mhz) => round2(mhz / 1000));
|
|
16
|
+
if (!cores.length) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
min: Math.min(...cores),
|
|
21
|
+
max: Math.max(...cores),
|
|
22
|
+
avg: round2(cores.reduce((sum, speed) => sum + speed, 0) / cores.length),
|
|
23
|
+
cores
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.appleSiliconSpeed = appleSiliconSpeed;
|
|
@@ -23,19 +23,13 @@ const cpuTemperature = async () => {
|
|
|
23
23
|
}
|
|
24
24
|
catch { }
|
|
25
25
|
try {
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
result.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
result.chipset = Math.round(res.soc * 100) / 100;
|
|
34
|
-
}
|
|
35
|
-
if (res && res.cpuDieTemps && res.cpuDieTemps.length) {
|
|
36
|
-
for (const temp of res.cpuDieTemps) {
|
|
37
|
-
result.cores.push(Math.round(temp * 100) / 100);
|
|
38
|
-
}
|
|
26
|
+
const smc = require('macos-smc');
|
|
27
|
+
const cpu = smc.temperatures()?.cpu;
|
|
28
|
+
if (typeof cpu?.max === 'number') {
|
|
29
|
+
const round2 = (value) => Math.round(value * 100) / 100;
|
|
30
|
+
result.main = round2(typeof cpu.avg === 'number' ? cpu.avg : cpu.max);
|
|
31
|
+
result.max = round2(cpu.max);
|
|
32
|
+
result.cores = (cpu.sensors || []).map((sensor) => round2(sensor.value));
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
35
|
catch { }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.diskSpeed = void 0;
|
|
4
|
+
const disk_speed_1 = require("../common/disk-speed");
|
|
5
|
+
const noCache = (fd) => {
|
|
6
|
+
try {
|
|
7
|
+
const smc = require('macos-smc');
|
|
8
|
+
return typeof smc.noCache === 'function' && smc.noCache(fd) === true;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const diskSpeed = (path, sizeMB) => (0, disk_speed_1.runDiskSpeed)(path, sizeMB, {
|
|
15
|
+
prepareWrite: noCache,
|
|
16
|
+
readUncached: (file, bytes) => (0, disk_speed_1.readFileTimed)(file, bytes, noCache)
|
|
17
|
+
});
|
|
18
|
+
exports.diskSpeed = diskSpeed;
|
package/dist/darwin/disks-io.js
CHANGED
|
@@ -49,7 +49,9 @@ const disksIO = async () => {
|
|
|
49
49
|
tWaitTime: filesys_1._disk_io.tWaitTimeDelta,
|
|
50
50
|
rWaitPercent: filesys_1._disk_io.rWaitPercent,
|
|
51
51
|
wWaitPercent: filesys_1._disk_io.wWaitPercent,
|
|
52
|
-
tWaitPercent: filesys_1._disk_io.tWaitPercent
|
|
52
|
+
tWaitPercent: filesys_1._disk_io.tWaitPercent,
|
|
53
|
+
busyPercent: filesys_1._disk_io.busyPercent,
|
|
54
|
+
idlePercent: filesys_1._disk_io.idlePercent
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
};
|
package/dist/darwin/fans.js
CHANGED
|
@@ -6,20 +6,18 @@ const fans = async () => {
|
|
|
6
6
|
await (0, common_1.nextTick)();
|
|
7
7
|
const result = [];
|
|
8
8
|
try {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
source: 'SMC'
|
|
20
|
-
});
|
|
9
|
+
const smc = require('macos-smc');
|
|
10
|
+
const res = smc.fans();
|
|
11
|
+
if (Array.isArray(res)) {
|
|
12
|
+
res.forEach((fan, index) => {
|
|
13
|
+
result.push({
|
|
14
|
+
id: `fan${typeof fan?.id === 'number' ? fan.id : index}`,
|
|
15
|
+
label: null,
|
|
16
|
+
rpm: typeof fan?.rpm === 'number' ? Math.round(fan.rpm) : null,
|
|
17
|
+
pwm: typeof fan?.percent === 'number' ? Math.round(fan.percent) : null,
|
|
18
|
+
source: 'SMC'
|
|
21
19
|
});
|
|
22
|
-
}
|
|
20
|
+
});
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
23
|
catch { }
|
package/dist/darwin/gpu.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GpuData } from '../common/types';
|
|
1
|
+
import type { GpuData } from '../common/types';
|
|
2
2
|
export declare const gpu: () => Promise<GpuData[]>;
|
package/dist/darwin/gpu.js
CHANGED
|
@@ -37,12 +37,12 @@ const gpu = async () => {
|
|
|
37
37
|
const { stdout } = await (0, exec_1.shareInflight)('SPDisplaysDataType', () => (0, exec_1.exec)('system_profiler -xml -detailLevel full SPDisplaysDataType'));
|
|
38
38
|
result = parseControllersDarwin((0, darwin_1.plistParser)(stdout));
|
|
39
39
|
try {
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
40
|
+
const smc = require('macos-smc');
|
|
41
|
+
const gpuMax = smc.temperatures()?.gpu?.max;
|
|
42
|
+
if (typeof gpuMax === 'number') {
|
|
43
43
|
for (const controller of result) {
|
|
44
44
|
if (controller.bus === 'Built-In') {
|
|
45
|
-
controller.temperatureGpu = Math.round(
|
|
45
|
+
controller.temperatureGpu = Math.round(gpuMax * 100) / 100;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
package/dist/darwin/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { cpuTemperature } from './cpu-temperature';
|
|
|
14
14
|
export { fans } from './fans';
|
|
15
15
|
export { currentLoad } from '../cpu-current-load';
|
|
16
16
|
export { diskLayout } from './disk-layout';
|
|
17
|
+
export { diskSpeed } from './disk-speed';
|
|
17
18
|
export { disksIO } from './disks-io';
|
|
18
19
|
export { displays } from './displays';
|
|
19
20
|
export { dockerInfo, dockerImages, dockerContainers, dockerContainerStats, dockerContainerProcesses, dockerVolumes, dockerAll } from '../docker';
|
|
@@ -23,6 +24,7 @@ export { fsStats } from './fs-stats';
|
|
|
23
24
|
export { fullLoad } from '../cpu-full-load';
|
|
24
25
|
export { gpu } from './gpu';
|
|
25
26
|
export { inetChecksite } from '../inet-checksite';
|
|
27
|
+
export { inetSpeed } from '../inet-speed';
|
|
26
28
|
export { inetLatency } from '../linux/inet-latency';
|
|
27
29
|
export { keyboard } from './keyboard';
|
|
28
30
|
export { mem } from './mem';
|
|
@@ -32,6 +34,7 @@ export { networkConnections } from './network-connections';
|
|
|
32
34
|
export { networkGatewayDefault } from './network-gateway-default';
|
|
33
35
|
export { networkInterfaceDefault } from './network-interface-default';
|
|
34
36
|
export { networkInterfaces } from './network-interfaces';
|
|
37
|
+
export { networkRoutes } from './network-routes';
|
|
35
38
|
export { networkStats } from './network-stats';
|
|
36
39
|
export { npm } from './npm';
|
|
37
40
|
export { npu } from './npu';
|
package/dist/darwin/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.wifiNetworks = exports.wifiInterfaces = exports.wifiConnections = exports.versions = exports.version = exports.vboxInfo = exports.uuid = exports.users = exports.usb = exports.serialPorts = exports.time = exports.thunderbolt = exports.system = exports.software = exports.shell = void 0;
|
|
3
|
+
exports.processes = exports.printer = exports.pci = exports.osInfo = exports.npu = exports.npm = exports.networkStats = exports.networkRoutes = exports.networkInterfaces = exports.networkInterfaceDefault = exports.networkGatewayDefault = exports.networkConnections = exports.mouse = exports.memLayout = exports.mem = exports.keyboard = exports.inetLatency = exports.inetSpeed = exports.inetChecksite = exports.gpu = exports.fullLoad = exports.fsStats = exports.fsSize = exports.fsOpenFiles = exports.dockerAll = exports.dockerVolumes = exports.dockerContainerProcesses = exports.dockerContainerStats = exports.dockerContainers = exports.dockerImages = exports.dockerInfo = exports.displays = exports.disksIO = exports.diskSpeed = exports.diskLayout = exports.currentLoad = exports.fans = exports.cpuTemperature = exports.cpuFlags = exports.cpuCurrentSpeed = exports.cpuCache = exports.cpu = exports.chassis = exports.camera = exports.bluetoothDevices = exports.blockDevices = exports.bios = exports.battery = exports.baseboard = exports.audio = void 0;
|
|
4
|
+
exports.wifiNetworks = exports.wifiInterfaces = exports.wifiConnections = exports.versions = exports.version = exports.vboxInfo = exports.uuid = exports.users = exports.usb = exports.serialPorts = exports.time = exports.thunderbolt = exports.system = exports.software = exports.shell = exports.services = exports.processFocused = exports.processLoad = void 0;
|
|
5
5
|
var audio_1 = require("./audio");
|
|
6
6
|
Object.defineProperty(exports, "audio", { enumerable: true, get: function () { return audio_1.audio; } });
|
|
7
7
|
var baseboard_1 = require("./baseboard");
|
|
@@ -34,6 +34,8 @@ var cpu_current_load_1 = require("../cpu-current-load");
|
|
|
34
34
|
Object.defineProperty(exports, "currentLoad", { enumerable: true, get: function () { return cpu_current_load_1.currentLoad; } });
|
|
35
35
|
var disk_layout_1 = require("./disk-layout");
|
|
36
36
|
Object.defineProperty(exports, "diskLayout", { enumerable: true, get: function () { return disk_layout_1.diskLayout; } });
|
|
37
|
+
var disk_speed_1 = require("./disk-speed");
|
|
38
|
+
Object.defineProperty(exports, "diskSpeed", { enumerable: true, get: function () { return disk_speed_1.diskSpeed; } });
|
|
37
39
|
var disks_io_1 = require("./disks-io");
|
|
38
40
|
Object.defineProperty(exports, "disksIO", { enumerable: true, get: function () { return disks_io_1.disksIO; } });
|
|
39
41
|
var displays_1 = require("./displays");
|
|
@@ -58,6 +60,8 @@ var gpu_1 = require("./gpu");
|
|
|
58
60
|
Object.defineProperty(exports, "gpu", { enumerable: true, get: function () { return gpu_1.gpu; } });
|
|
59
61
|
var inet_checksite_1 = require("../inet-checksite");
|
|
60
62
|
Object.defineProperty(exports, "inetChecksite", { enumerable: true, get: function () { return inet_checksite_1.inetChecksite; } });
|
|
63
|
+
var inet_speed_1 = require("../inet-speed");
|
|
64
|
+
Object.defineProperty(exports, "inetSpeed", { enumerable: true, get: function () { return inet_speed_1.inetSpeed; } });
|
|
61
65
|
var inet_latency_1 = require("../linux/inet-latency");
|
|
62
66
|
Object.defineProperty(exports, "inetLatency", { enumerable: true, get: function () { return inet_latency_1.inetLatency; } });
|
|
63
67
|
var keyboard_1 = require("./keyboard");
|
|
@@ -76,6 +80,8 @@ var network_interface_default_1 = require("./network-interface-default");
|
|
|
76
80
|
Object.defineProperty(exports, "networkInterfaceDefault", { enumerable: true, get: function () { return network_interface_default_1.networkInterfaceDefault; } });
|
|
77
81
|
var network_interfaces_1 = require("./network-interfaces");
|
|
78
82
|
Object.defineProperty(exports, "networkInterfaces", { enumerable: true, get: function () { return network_interfaces_1.networkInterfaces; } });
|
|
83
|
+
var network_routes_1 = require("./network-routes");
|
|
84
|
+
Object.defineProperty(exports, "networkRoutes", { enumerable: true, get: function () { return network_routes_1.networkRoutes; } });
|
|
79
85
|
var network_stats_1 = require("./network-stats");
|
|
80
86
|
Object.defineProperty(exports, "networkStats", { enumerable: true, get: function () { return network_stats_1.networkStats; } });
|
|
81
87
|
var npm_1 = require("./npm");
|
|
@@ -41,7 +41,8 @@ const parseLinesDarwinNics = (sections) => {
|
|
|
41
41
|
type: '',
|
|
42
42
|
operstate: '',
|
|
43
43
|
duplex: '',
|
|
44
|
-
internal: false
|
|
44
|
+
internal: false,
|
|
45
|
+
bridgeMembers: []
|
|
45
46
|
};
|
|
46
47
|
const first = section[0];
|
|
47
48
|
nic.iface = first.split(':')[0].trim();
|
|
@@ -61,6 +62,9 @@ const parseLinesDarwinNics = (sections) => {
|
|
|
61
62
|
if (line.trim().startsWith('inet ') && !nic.ip4) {
|
|
62
63
|
nic.ip4 = line.split('inet ')[1].toLowerCase().split(' ')[0];
|
|
63
64
|
}
|
|
65
|
+
if (line.trim().startsWith('member: ')) {
|
|
66
|
+
nic.bridgeMembers.push(line.trim().split(/\s+/)[1]);
|
|
67
|
+
}
|
|
64
68
|
});
|
|
65
69
|
let speed = (0, common_1.getValue)(section, 'link rate');
|
|
66
70
|
nic.speed = speed ? parseFloat(speed) : null;
|
|
@@ -109,7 +113,12 @@ const parseBsdGateways = (stdout) => {
|
|
|
109
113
|
if (parts[0] !== 'default' || parts.length < 3 || !parts[1].includes('.')) {
|
|
110
114
|
continue;
|
|
111
115
|
}
|
|
112
|
-
const iface = ifaceColumn > 0
|
|
116
|
+
const iface = ifaceColumn > 0
|
|
117
|
+
? parts[ifaceColumn]
|
|
118
|
+
: parts
|
|
119
|
+
.slice(2)
|
|
120
|
+
.reverse()
|
|
121
|
+
.find((part) => /^[a-z][a-z0-9]*\d$/.test(part));
|
|
113
122
|
if (iface && !result[iface]) {
|
|
114
123
|
result[iface] = parts[1];
|
|
115
124
|
}
|
|
@@ -189,7 +198,7 @@ const networkInterfaces = async (defaultString = '', rescan = true) => {
|
|
|
189
198
|
return (0, network_1.filterDefaultInterface)(_networkInterfaces, defaultString);
|
|
190
199
|
}
|
|
191
200
|
_interfaces = (0, index_1.cloneObj)(interfaces);
|
|
192
|
-
|
|
201
|
+
const result = [];
|
|
193
202
|
try {
|
|
194
203
|
const [nics, defaultInterface, gateways, vendors] = await Promise.all([getBsdNics(), (0, network_interface_default_1.networkInterfaceDefault)(), getBsdGateways(), getBsdNicVendors()]);
|
|
195
204
|
for (const nic of nics) {
|
|
@@ -260,7 +269,8 @@ const networkInterfaces = async (defaultString = '', rescan = true) => {
|
|
|
260
269
|
dnsSuffix: '',
|
|
261
270
|
ieee8021xAuth: '',
|
|
262
271
|
ieee8021xState: '',
|
|
263
|
-
carrierChanges: 0
|
|
272
|
+
carrierChanges: 0,
|
|
273
|
+
bridgeMembers: nic.bridgeMembers
|
|
264
274
|
});
|
|
265
275
|
}
|
|
266
276
|
_networkInterfaces = result;
|