code-poltergeist-system-monitor 1.0.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of code-poltergeist-system-monitor might be problematic. Click here for more details.

Files changed (33) hide show
  1. package/index.js +74 -0
  2. package/package.json +21 -0
  3. package/te/node_modules/.package-lock.json +44 -0
  4. package/te/node_modules/code-poltergeist-system-monitor/index.js +74 -0
  5. package/te/node_modules/code-poltergeist-system-monitor/package.json +21 -0
  6. package/te/node_modules/systeminformation/LICENSE +20 -0
  7. package/te/node_modules/systeminformation/README.md +1116 -0
  8. package/te/node_modules/systeminformation/lib/audio.js +222 -0
  9. package/te/node_modules/systeminformation/lib/battery.js +311 -0
  10. package/te/node_modules/systeminformation/lib/bluetooth.js +231 -0
  11. package/te/node_modules/systeminformation/lib/cli.js +91 -0
  12. package/te/node_modules/systeminformation/lib/cpu.js +1834 -0
  13. package/te/node_modules/systeminformation/lib/docker.js +758 -0
  14. package/te/node_modules/systeminformation/lib/dockerSocket.js +327 -0
  15. package/te/node_modules/systeminformation/lib/filesystem.js +1510 -0
  16. package/te/node_modules/systeminformation/lib/graphics.js +1125 -0
  17. package/te/node_modules/systeminformation/lib/index.d.ts +1041 -0
  18. package/te/node_modules/systeminformation/lib/index.js +504 -0
  19. package/te/node_modules/systeminformation/lib/internet.js +237 -0
  20. package/te/node_modules/systeminformation/lib/memory.js +575 -0
  21. package/te/node_modules/systeminformation/lib/network.js +1783 -0
  22. package/te/node_modules/systeminformation/lib/osinfo.js +1179 -0
  23. package/te/node_modules/systeminformation/lib/printer.js +210 -0
  24. package/te/node_modules/systeminformation/lib/processes.js +1296 -0
  25. package/te/node_modules/systeminformation/lib/system.js +742 -0
  26. package/te/node_modules/systeminformation/lib/usb.js +279 -0
  27. package/te/node_modules/systeminformation/lib/users.js +363 -0
  28. package/te/node_modules/systeminformation/lib/util.js +1373 -0
  29. package/te/node_modules/systeminformation/lib/virtualbox.js +107 -0
  30. package/te/node_modules/systeminformation/lib/wifi.js +834 -0
  31. package/te/node_modules/systeminformation/package.json +99 -0
  32. package/te/package-lock.json +52 -0
  33. package/te/package.json +15 -0
@@ -0,0 +1,107 @@
1
+ 'use strict';
2
+ // @ts-check
3
+ // ==================================================================================
4
+ // virtualbox.js
5
+ // ----------------------------------------------------------------------------------
6
+ // Description: System Information - library
7
+ // for Node.js
8
+ // Copyright: (c) 2014 - 2024
9
+ // Author: Sebastian Hildebrandt
10
+ // ----------------------------------------------------------------------------------
11
+ // License: MIT
12
+ // ==================================================================================
13
+ // 14. Docker
14
+ // ----------------------------------------------------------------------------------
15
+
16
+ const os = require('os');
17
+ const exec = require('child_process').exec;
18
+ const util = require('./util');
19
+
20
+ function vboxInfo(callback) {
21
+
22
+ // fallback - if only callback is given
23
+ let result = [];
24
+ return new Promise((resolve) => {
25
+ process.nextTick(() => {
26
+ try {
27
+ exec(util.getVboxmanage() + ' list vms --long', function (error, stdout) {
28
+ let parts = (os.EOL + stdout.toString()).split(os.EOL + 'Name:');
29
+ parts.shift();
30
+ parts.forEach(part => {
31
+ const lines = ('Name:' + part).split(os.EOL);
32
+ const state = util.getValue(lines, 'State');
33
+ const running = state.startsWith('running');
34
+ const runningSinceString = running ? state.replace('running (since ', '').replace(')', '').trim() : '';
35
+ let runningSince = 0;
36
+ try {
37
+ if (running) {
38
+ const sinceDateObj = new Date(runningSinceString);
39
+ const offset = sinceDateObj.getTimezoneOffset();
40
+ runningSince = Math.round((Date.now() - Date.parse(sinceDateObj)) / 1000) + offset * 60;
41
+ }
42
+ } catch (e) {
43
+ util.noop();
44
+ }
45
+ const stoppedSinceString = !running ? state.replace('powered off (since', '').replace(')', '').trim() : '';
46
+ let stoppedSince = 0;
47
+ try {
48
+ if (!running) {
49
+ const sinceDateObj = new Date(stoppedSinceString);
50
+ const offset = sinceDateObj.getTimezoneOffset();
51
+ stoppedSince = Math.round((Date.now() - Date.parse(sinceDateObj)) / 1000) + offset * 60;
52
+ }
53
+ } catch (e) {
54
+ util.noop();
55
+ }
56
+ result.push({
57
+ id: util.getValue(lines, 'UUID'),
58
+ name: util.getValue(lines, 'Name'),
59
+ running,
60
+ started: runningSinceString,
61
+ runningSince,
62
+ stopped: stoppedSinceString,
63
+ stoppedSince,
64
+ guestOS: util.getValue(lines, 'Guest OS'),
65
+ hardwareUUID: util.getValue(lines, 'Hardware UUID'),
66
+ memory: parseInt(util.getValue(lines, 'Memory size', ' '), 10),
67
+ vram: parseInt(util.getValue(lines, 'VRAM size'), 10),
68
+ cpus: parseInt(util.getValue(lines, 'Number of CPUs'), 10),
69
+ cpuExepCap: util.getValue(lines, 'CPU exec cap'),
70
+ cpuProfile: util.getValue(lines, 'CPUProfile'),
71
+ chipset: util.getValue(lines, 'Chipset'),
72
+ firmware: util.getValue(lines, 'Firmware'),
73
+ pageFusion: util.getValue(lines, 'Page Fusion') === 'enabled',
74
+ configFile: util.getValue(lines, 'Config file'),
75
+ snapshotFolder: util.getValue(lines, 'Snapshot folder'),
76
+ logFolder: util.getValue(lines, 'Log folder'),
77
+ hpet: util.getValue(lines, 'HPET') === 'enabled',
78
+ pae: util.getValue(lines, 'PAE') === 'enabled',
79
+ longMode: util.getValue(lines, 'Long Mode') === 'enabled',
80
+ tripleFaultReset: util.getValue(lines, 'Triple Fault Reset') === 'enabled',
81
+ apic: util.getValue(lines, 'APIC') === 'enabled',
82
+ x2Apic: util.getValue(lines, 'X2APIC') === 'enabled',
83
+ acpi: util.getValue(lines, 'ACPI') === 'enabled',
84
+ ioApic: util.getValue(lines, 'IOAPIC') === 'enabled',
85
+ biosApicMode: util.getValue(lines, 'BIOS APIC mode'),
86
+ bootMenuMode: util.getValue(lines, 'Boot menu mode'),
87
+ bootDevice1: util.getValue(lines, 'Boot Device 1'),
88
+ bootDevice2: util.getValue(lines, 'Boot Device 2'),
89
+ bootDevice3: util.getValue(lines, 'Boot Device 3'),
90
+ bootDevice4: util.getValue(lines, 'Boot Device 4'),
91
+ timeOffset: util.getValue(lines, 'Time offset'),
92
+ rtc: util.getValue(lines, 'RTC'),
93
+ });
94
+ });
95
+
96
+ if (callback) { callback(result); }
97
+ resolve(result);
98
+ });
99
+ } catch (e) {
100
+ if (callback) { callback(result); }
101
+ resolve(result);
102
+ }
103
+ });
104
+ });
105
+ }
106
+
107
+ exports.vboxInfo = vboxInfo;