bugfix diskLayout()
This commit is contained in:
parent
88cac2d1e4
commit
12cde2f040
@ -98,7 +98,8 @@ Other changes
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
| 3.23.6 | 2017-07-11 | added cpuFlags() to getStaticData(), bug fix `graphics()` (Win) |
|
| 3.23.7 | 2017-07-11 | bug fix `diskLayout()` |
|
||||||
|
| 3.23.6 | 2017-07-11 | added `cpuFlags()` to `getStaticData()`, bug fix `graphics()` (Win) |
|
||||||
| 3.23.5 | 2017-06-29 | bug fix `inetChecksite()` |
|
| 3.23.5 | 2017-06-29 | bug fix `inetChecksite()` |
|
||||||
| 3.23.4 | 2017-06-24 | bug fix `getDynamicData(), getAllData() - mem` |
|
| 3.23.4 | 2017-06-24 | bug fix `getDynamicData(), getAllData() - mem` |
|
||||||
| 3.23.3 | 2017-06-23 | updated docs |
|
| 3.23.3 | 2017-06-23 | updated docs |
|
||||||
|
|||||||
@ -117,7 +117,7 @@ function getCpu() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (_linux) {
|
if (_linux) {
|
||||||
exec("lscpu", function (error, stdout) {
|
exec("export LC_ALL=C; lscpu; unset LC_ALL", function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
const modelline = getValue(lines, 'model name');
|
const modelline = getValue(lines, 'model name');
|
||||||
@ -135,11 +135,11 @@ function getCpu() {
|
|||||||
|
|
||||||
result = cpuBrandManufacturer(result);
|
result = cpuBrandManufacturer(result);
|
||||||
result.vendor = getValue(lines, 'vendor id');
|
result.vendor = getValue(lines, 'vendor id');
|
||||||
if (!result.vendor) { result.vendor = getValue(lines, 'anbieterkennung'); }
|
// if (!result.vendor) { result.vendor = getValue(lines, 'anbieterkennung'); }
|
||||||
result.family = getValue(lines, 'cpu family');
|
result.family = getValue(lines, 'cpu family');
|
||||||
if (!result.family) { result.family = getValue(lines, 'prozessorfamilie'); }
|
// if (!result.family) { result.family = getValue(lines, 'prozessorfamilie'); }
|
||||||
result.model = getValue(lines, 'model:');
|
result.model = getValue(lines, 'model:');
|
||||||
if (!result.model) { result.model = getValue(lines, 'modell:'); }
|
// if (!result.model) { result.model = getValue(lines, 'modell:'); }
|
||||||
result.stepping = getValue(lines, 'stepping');
|
result.stepping = getValue(lines, 'stepping');
|
||||||
result.revision = getValue(lines, 'cpu revision');
|
result.revision = getValue(lines, 'cpu revision');
|
||||||
result.cache.l1d = getValue(lines, 'l1d cache');
|
result.cache.l1d = getValue(lines, 'l1d cache');
|
||||||
|
|||||||
@ -590,14 +590,19 @@ function diskLayout(callback) {
|
|||||||
let result = [];
|
let result = [];
|
||||||
|
|
||||||
if (_linux) {
|
if (_linux) {
|
||||||
exec("lshw -class disk", function (error, stdout) {
|
exec("export LC_ALL=C; lshw -class disk; unset LC_ALL", function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let devices = stdout.toString().split('*-');
|
let devices = stdout.toString().split('*-');
|
||||||
devices.shift();
|
devices.shift();
|
||||||
devices.forEach(function (device) {
|
devices.forEach(function (device) {
|
||||||
let lines = device.split('\n');
|
let lines = device.split('\n');
|
||||||
|
let mediumType = '';
|
||||||
const logical = getValue(lines, 'logical name', ':', true).trim().replace(/\/dev\//g, '');
|
const logical = getValue(lines, 'logical name', ':', true).trim().replace(/\/dev\//g, '');
|
||||||
const mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational').toString().split('\n')[0];
|
try {
|
||||||
|
mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational').toString().split('\n')[0];
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
|
||||||
const size = getValue(lines, 'size', ':', true).trim();
|
const size = getValue(lines, 'size', ':', true).trim();
|
||||||
if (size && lines.length > 0 && lines[0].trim() === 'disk') {
|
if (size && lines.length > 0 && lines[0].trim() === 'disk') {
|
||||||
result.push({
|
result.push({
|
||||||
@ -619,7 +624,9 @@ function diskLayout(callback) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (callback) { callback(result) }
|
if (callback) {
|
||||||
|
callback(result)
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -659,7 +666,9 @@ function diskLayout(callback) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (callback) { callback(result) }
|
if (callback) {
|
||||||
|
callback(result)
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -691,7 +700,9 @@ function diskLayout(callback) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (callback) { callback(result) }
|
if (callback) {
|
||||||
|
callback(result)
|
||||||
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user