diff --git a/CHANGELOG.md b/CHANGELOG.md index dfc3eb0..dde4e6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.28.0 | 2020-11-04 | `graphics()` added deviceName (windows) | | 4.27.11 | 2020-10-26 | `inetChecksite()` fixed vulnerability: command injection | | 4.27.10 | 2020-10-16 | `dockerContainers()` resolved hanging issue | | 4.27.9 | 2020-10-13 | `networkInterfaces()` loopback internal detection (windows) | diff --git a/README.md b/README.md index 381f4e8..18abdb2 100644 --- a/README.md +++ b/README.md @@ -87,13 +87,13 @@ si.cpu() (last 7 major and minor version releases) +- Version 4.28.0: `graphics()` added deviceName (Windows) - Version 4.27.0: `observe()` added observe / watch function - Version 4.26.0: `diskLayout()` added full S.M.A.R.T data (Linux) - Version 4.25.0: `get()` added function to get partial system info - Version 4.24.0: `networkInterfaces()` added subnet mask ip4 and ip6 - Version 4.23.0: `versions()` added param to specify which program/lib versions to detect - Version 4.22.0: `services()` added pids (windows) -- Version 4.21.0: added npx copmpatibility - ... You can find all changes here: [detailed changelog][changelog-url] @@ -258,6 +258,7 @@ I also created a nice little command line tool called [mmon][mmon-github-url] (m | | controllers[]| X | | X | X | | graphics controllers array | | | ...[0].model | X | | X | X | | graphics controller model | | | ...[0].vendor | X | | X | X | | e.g. ATI | +| | ...[0].deviceName | | | | X | | e.g. \\\\.\\DISPLAY1 | | | ...[0].bus | X | | X | X | | on which bus (e.g. PCIe) | | | ...[0].vram | X | | X | X | | VRAM size (in MB) | | | ...[0].vramDynamic | X | | X | X | | true if dynamicly allocated ram | diff --git a/docs/graphics.html b/docs/graphics.html index 7616374..1c6f1e1 100644 --- a/docs/graphics.html +++ b/docs/graphics.html @@ -155,6 +155,16 @@ monitor/display vendor + + + ...[0].deviceName + + + + X + + e.g. \\.\DISPLAY1 + ...[0].model diff --git a/docs/history.html b/docs/history.html index da01d35..45591c7 100644 --- a/docs/history.html +++ b/docs/history.html @@ -83,6 +83,11 @@ + + 4.28.0 + 2020-11-04 + graphics() added deviceName (windows) + 4.27.11 2020-10-26 diff --git a/docs/index.html b/docs/index.html index ba2af03..ddfba26 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,7 +168,7 @@
systeminformation
-
Current Version: 4.27.11
+
Current Version: 4.28.0
diff --git a/lib/filesystem.js b/lib/filesystem.js index c5a886c..b4c538e 100755 --- a/lib/filesystem.js +++ b/lib/filesystem.js @@ -43,9 +43,10 @@ function fsSize(callback) { lines.forEach(function (line) { if (line !== '') { line = line.replace(/ +/g, ' ').split(' '); - if (line && (line[0].startsWith('/')) || (line[6] && line[6] === '/')) { + console.log(line); + if (line && ((line[0].startsWith('/')) || (line[6] && line[6] === '/') || (line[0].indexOf('/') > 0))) { const fs = line[0]; - const fstype = ((_linux || _freebsd || _openbsd || _netbsd) ? line[1] : 'HFS'); + const fstype = ((_linux || _freebsd || _openbsd || _netbsd) ? line[1] : (line[0].startsWith('/')) ? 'HFS' : 'NFS'); const size = parseInt(((_linux || _freebsd || _openbsd || _netbsd) ? line[2] : line[1])) * 1024; const used = parseInt(((_linux || _freebsd || _openbsd || _netbsd) ? line[3] : line[2])) * 1024; const use = parseFloat((100.0 * ((_linux || _freebsd || _openbsd || _netbsd) ? line[3] : line[2]) / ((_linux || _freebsd || _openbsd || _netbsd) ? line[2] : line[1])).toFixed(2)); @@ -71,7 +72,7 @@ function fsSize(callback) { let data = []; if (_linux || _freebsd || _openbsd || _netbsd || _darwin) { let cmd = ''; - if (_darwin) cmd = 'df -lkP | grep ^/'; + if (_darwin) cmd = 'df -kP'; if (_linux) cmd = 'df -lkPTx squashfs | grep ^/'; if (_freebsd || _openbsd || _netbsd) cmd = 'df -lkPT'; exec(cmd, function (error, stdout) { diff --git a/lib/graphics.js b/lib/graphics.js index 75f5941..94112d6 100644 --- a/lib/graphics.js +++ b/lib/graphics.js @@ -72,6 +72,7 @@ function graphics(callback) { let currentDisplay = { vendor: '', model: '', + deviceName: '', main: false, builtin: false, connection: '', @@ -109,6 +110,7 @@ function graphics(callback) { currentDisplay = { vendor: '', model: '', + deviceName: '', main: false, builtin: false, connection: '', @@ -304,6 +306,7 @@ function graphics(callback) { let result = { vendor: '', model: '', + deviceName: '', main: false, builtin: false, connection: '', @@ -363,6 +366,7 @@ function graphics(callback) { let currentDisplay = { vendor: '', model: '', + deviceName: '', main: false, builtin: false, connection: '', @@ -718,9 +722,14 @@ function graphics(callback) { if (ssections[i].trim() !== '') { ssections[i] = 'BitsPerPixel ' + ssections[i]; msections[i] = 'Active ' + msections[i]; - + // tsections can be empty on earlier versions of powershell (<=2.0). Tag connection type as UNKNOWN + // if this information is missing + if (tsections.length === 0) { + tsections[i] = 'Unknown'; + } let linesScreen = ssections[i].split(os.EOL); let linesMonitor = msections[i].split(os.EOL); + let linesConnection = tsections[i].split(os.EOL); const bitsPerPixel = util.getValue(linesScreen, 'BitsPerPixel'); const bounds = util.getValue(linesScreen, 'Bounds').replace('{', '').replace('}', '').split(','); @@ -729,6 +738,7 @@ function graphics(callback) { const sizey = util.getValue(linesMonitor, 'MaxVerticalImageSize'); const instanceName = util.getValue(linesMonitor, 'InstanceName').toLowerCase(); const videoOutputTechnology = util.getValue(linesConnection, 'VideoOutputTechnology'); + const deviceName = util.getValue(linesScreen, 'DeviceName'); let displayVendor = ''; let displayModel = ''; isections.forEach(element => { @@ -740,6 +750,7 @@ function graphics(callback) { displays.push({ vendor: instanceName.startsWith(deviceID) && displayVendor === '' ? vendor : displayVendor, model: instanceName.startsWith(deviceID) && displayModel === '' ? model : displayModel, + deviceName, main: primary.toLowerCase() === 'true', builtin: videoOutputTechnology === '2147483648', connection: videoOutputTechnology && videoTypes[videoOutputTechnology] ? videoTypes[videoOutputTechnology] : '', diff --git a/lib/index.d.ts b/lib/index.d.ts index 68118b3..5450881 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -252,6 +252,7 @@ export namespace Systeminformation { interface GraphicsDisplayData { vendor: string; model: string; + deviceName: string; main: boolean; builtin: boolean; connection: string;