graphics() added deviceName (windows)

This commit is contained in:
Sebastian Hildebrandt 2020-11-04 15:44:15 +01:00
parent e85de74870
commit 4d2c684eac
8 changed files with 36 additions and 6 deletions

View File

@ -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) |

View File

@ -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 |

View File

@ -155,6 +155,16 @@
<td></td>
<td>monitor/display vendor</td>
</tr>
<tr>
<td></td>
<td>...[0].deviceName</td>
<td></td>
<td></td>
<td></td>
<td>X</td>
<td></td>
<td>e.g. \\.\DISPLAY1</td>
</tr>
<tr>
<td></td>
<td>...[0].model</td>

View File

@ -83,6 +83,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">4.28.0</th>
<td>2020-11-04</td>
<td><span class="code">graphics()</span> added deviceName (windows)</td>
</tr>
<tr>
<th scope="row">4.27.11</th>
<td>2020-10-26</td>

View File

@ -168,7 +168,7 @@
<img class="logo" src="assets/logo.png">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span></div>
<div class="version">Current Version: <span id="version">4.27.11</span></div>
<div class="version">Current Version: <span id="version">4.28.0</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div>
<div class="down">

View File

@ -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) {

View File

@ -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] : '',

1
lib/index.d.ts vendored
View File

@ -252,6 +252,7 @@ export namespace Systeminformation {
interface GraphicsDisplayData {
vendor: string;
model: string;
deviceName: string;
main: boolean;
builtin: boolean;
connection: string;