chassis(): new chassis detection (macOS)
This commit is contained in:
parent
30b13d74b1
commit
823503d876
@ -688,13 +688,13 @@ function chassis(callback) {
|
||||
exec('ioreg -c IOPlatformExpertDevice -d 2', function (error, stdout) {
|
||||
if (!error) {
|
||||
let lines = stdout.toString().replace(/[<>"]/g, '').split('\n');
|
||||
const model = util.getValue(lines, 'model', '=', true);
|
||||
const modelParts = util.splitByNumber(model);
|
||||
const version = util.getValue(lines, 'version', '=', true);
|
||||
const model = util.getAppleModel(util.getValue(lines, 'model', '=', true));
|
||||
// const modelParts = util.splitByNumber(model);
|
||||
// const version = util.getValue(lines, 'version', '=', true);
|
||||
result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);
|
||||
result.model = version ? util.getValue(lines, 'model', '=', true) : modelParts[0];
|
||||
result.type = macOsChassisType(result.model);
|
||||
result.version = version || model;
|
||||
result.model = model.model;
|
||||
result.type = macOsChassisType(model.model);
|
||||
result.version = model.version;
|
||||
result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);
|
||||
result.assetTag = util.getValue(lines, 'board-id', '=', true) || util.getValue(lines, 'target-type', '=', true);
|
||||
result.sku = util.getValue(lines, 'target-sub-type', '=', true);
|
||||
|
||||
1161
lib/util.js
1161
lib/util.js
File diff suppressed because it is too large
Load Diff
@ -700,7 +700,7 @@ function wifiConnections(callback) {
|
||||
const model = lines[1].indexOf(':') >= 0 ? lines[1].split(':')[1].trim() : '';
|
||||
const id = lines[2].indexOf(':') >= 0 ? lines[2].split(':')[1].trim() : '';
|
||||
const ssid = util.getValue(lines, 'SSID', ':', true);
|
||||
const bssid = util.getValue(lines, 'BSSID', ':', true) || util.getValue(lines, 'AP BSSID', ':', true);;
|
||||
const bssid = util.getValue(lines, 'BSSID', ':', true) || util.getValue(lines, 'AP BSSID', ':', true);
|
||||
const quality = util.getValue(lines, 'Signal', ':', true);
|
||||
const signalLevel = wifiDBFromQuality(quality);
|
||||
const type = util.getValue(lines, 'Radio type', ':', true) || util.getValue(lines, 'Type de radio', ':', true) || util.getValue(lines, 'Funktyp', ':', true) || null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user