bugfix graphics() vendor and model parsing linux
This commit is contained in:
parent
ad28b165f6
commit
fbb614b86b
@ -98,6 +98,7 @@ Other changes
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 3.31.1 | 2017-10-16 | bugfix `graphics()` vendor and model parsing linux |
|
||||||
| 3.31.0 | 2017-10-15 | extended windows support `cpuFlags()` (partially) |
|
| 3.31.0 | 2017-10-15 | extended windows support `cpuFlags()` (partially) |
|
||||||
| 3.30.6 | 2017-10-05 | updated community profile |
|
| 3.30.6 | 2017-10-05 | updated community profile |
|
||||||
| 3.30.5 | 2017-10-05 | bugfix `users()` - parsing values on windows |
|
| 3.30.5 | 2017-10-05 | bugfix `users()` - parsing values on windows |
|
||||||
|
|||||||
@ -149,7 +149,7 @@ I also created a nice little command line tool called [mmon][mmon-github-url] (
|
|||||||
| | cache.l1i | X | X | X | L1I (instruction) size |
|
| | cache.l1i | X | X | X | L1I (instruction) size |
|
||||||
| | cache.l2 | X | X | X | L2 size |
|
| | cache.l2 | X | X | X | L2 size |
|
||||||
| | cache.l3 | X | X | X | L3 size |
|
| | cache.l3 | X | X | X | L3 size |
|
||||||
| si.cpuFlags(cb) | : string | X | X | | CPU flags|
|
| si.cpuFlags(cb) | : string | X | X | X | CPU flags|
|
||||||
| si.cpuCache(cb) | {...} | X | X | X | CPU cache sizes |
|
| si.cpuCache(cb) | {...} | X | X | X | CPU cache sizes |
|
||||||
| | l1d | X | X | X | L1D size |
|
| | l1d | X | X | X | L1D size |
|
||||||
| | l1i | X | X | X | L1I size |
|
| | l1i | X | X | X | L1I size |
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
const exec = require('child_process').exec;
|
const exec = require('child_process').exec;
|
||||||
const fs = require('fs');
|
|
||||||
const util = require('./util');
|
const util = require('./util');
|
||||||
|
|
||||||
let _platform = os.type();
|
let _platform = os.type();
|
||||||
@ -22,7 +21,6 @@ let _platform = os.type();
|
|||||||
const _linux = (_platform === 'Linux');
|
const _linux = (_platform === 'Linux');
|
||||||
const _darwin = (_platform === 'Darwin');
|
const _darwin = (_platform === 'Darwin');
|
||||||
const _windows = (_platform === 'Windows_NT');
|
const _windows = (_platform === 'Windows_NT');
|
||||||
const NOT_SUPPORTED = 'not supported';
|
|
||||||
let _resolutionx = 0;
|
let _resolutionx = 0;
|
||||||
let _resolutiony = 0;
|
let _resolutiony = 0;
|
||||||
let _pixeldepth = 0;
|
let _pixeldepth = 0;
|
||||||
@ -136,12 +134,23 @@ function graphics(callback) {
|
|||||||
let parts = lines[i].substr(vgapos, endpos - vgapos).split(':');
|
let parts = lines[i].substr(vgapos, endpos - vgapos).split(':');
|
||||||
if (parts.length > 1) {
|
if (parts.length > 1) {
|
||||||
parts[1] = parts[1].trim();
|
parts[1] = parts[1].trim();
|
||||||
if (parts[1].toLowerCase().indexOf('corporation')) {
|
if (parts[1].toLowerCase().indexOf('corporation') >= 0) {
|
||||||
currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf('corporation') + 11).trim();
|
currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf('corporation') + 11).trim();
|
||||||
currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf('corporation') + 11, 200).trim().split('(')[0];
|
currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf('corporation') + 11, 200).trim().split('(')[0];
|
||||||
currentController.bus = '';
|
currentController.bus = '';
|
||||||
currentController.vram = -1;
|
currentController.vram = -1;
|
||||||
currentController.vramDynamic = false;
|
currentController.vramDynamic = false;
|
||||||
|
} else if (parts[1].toLowerCase().indexOf(' inc.') >= 0) {
|
||||||
|
if ((parts[1].match(new RegExp("]", "g")) || []).length > 1) {
|
||||||
|
currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(']') + 1).trim();
|
||||||
|
currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(']')+1, 200).trim().split('(')[0];
|
||||||
|
} else {
|
||||||
|
currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(' inc.') + 5).trim();
|
||||||
|
currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(' inc.') + 5, 200).trim().split('(')[0];
|
||||||
|
}
|
||||||
|
currentController.bus = '';
|
||||||
|
currentController.vram = -1;
|
||||||
|
currentController.vramDynamic = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user