fsSize() fix df parsing missing mount points (linux)

This commit is contained in:
Sebastian Hildebrandt 2026-01-02 07:13:27 +01:00
parent 85f61fa2cf
commit 1b7c8e4db2
4 changed files with 102 additions and 42 deletions

View File

@ -90,7 +90,8 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment | | Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- | | ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.28.8 | 2026-01-01 | `bluetooth()` `battery()` improved enomeration (windows) | | 5.28.0 | 2026-01-02 | `fsSize()` fix df parsing missing mount points (linux) |
| 5.28.8 | 2026-01-01 | `bluetooth()` `battery()` improved enumeration (windows) |
| 5.28.7 | 2026-12-31 | `networkInterfaces()` fix wireless speed (linux) | | 5.28.7 | 2026-12-31 | `networkInterfaces()` fix wireless speed (linux) |
| 5.28.6 | 2025-12-31 | `npx systeminformation` improved output | | 5.28.6 | 2025-12-31 | `npx systeminformation` improved output |
| 5.28.5 | 2025-12-30 | `cpuCurrentSpeed()` fix cpu loop issue | | 5.28.5 | 2025-12-30 | `cpuCurrentSpeed()` fix cpu loop issue |

View File

@ -57,10 +57,15 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<th scope="row">5.28.9</th>
<td>2026-01-02</td>
<td><span class="code">fsSize()</span> fix df parsing missing mount points (linux)</td>
</tr>
<tr> <tr>
<th scope="row">5.28.8</th> <th scope="row">5.28.8</th>
<td>2026-01-01</td> <td>2026-01-01</td>
<td><span class="code">bluetooth()</span> <span class="code">battery()</span> imprved enomeration (windows)</td> <td><span class="code">bluetooth()</span> <span class="code">battery()</span> improved enumeration (windows)</td>
</tr> </tr>
<tr> <tr>
<th scope="row">5.28.7</th> <th scope="row">5.28.7</th>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo"> <img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div> <div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div> <div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.28.8</span></div> <div class="version">New Version: <span id="version">5.28.9</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> <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>
<div class="down"> <div class="down">

View File

@ -19,32 +19,60 @@ const util = require('./util');
let _platform = process.platform; let _platform = process.platform;
const _linux = (_platform === 'linux' || _platform === 'android'); const _linux = _platform === 'linux' || _platform === 'android';
const _darwin = (_platform === 'darwin'); const _darwin = _platform === 'darwin';
const _windows = (_platform === 'win32'); const _windows = _platform === 'win32';
const _freebsd = (_platform === 'freebsd'); const _freebsd = _platform === 'freebsd';
const _openbsd = (_platform === 'openbsd'); const _openbsd = _platform === 'openbsd';
const _netbsd = (_platform === 'netbsd'); const _netbsd = _platform === 'netbsd';
const _sunos = (_platform === 'sunos'); const _sunos = _platform === 'sunos';
function parseAudioType(str, input, output) { function parseAudioType(str, input, output) {
str = str.toLowerCase(); str = str.toLowerCase();
let result = ''; let result = '';
if (str.indexOf('input') >= 0) { result = 'Microphone'; } if (str.indexOf('input') >= 0) {
if (str.indexOf('display audio') >= 0) { result = 'Speaker'; } result = 'Microphone';
if (str.indexOf('speak') >= 0) { result = 'Speaker'; } }
if (str.indexOf('laut') >= 0) { result = 'Speaker'; } if (str.indexOf('display audio') >= 0) {
if (str.indexOf('loud') >= 0) { result = 'Speaker'; } result = 'Speaker';
if (str.indexOf('head') >= 0) { result = 'Headset'; } }
if (str.indexOf('mic') >= 0) { result = 'Microphone'; } if (str.indexOf('speak') >= 0) {
if (str.indexOf('mikr') >= 0) { result = 'Microphone'; } result = 'Speaker';
if (str.indexOf('phone') >= 0) { result = 'Phone'; } }
if (str.indexOf('controll') >= 0) { result = 'Controller'; } if (str.indexOf('laut') >= 0) {
if (str.indexOf('line o') >= 0) { result = 'Line Out'; } result = 'Speaker';
if (str.indexOf('digital o') >= 0) { result = 'Digital Out'; } }
if (str.indexOf('smart sound technology') >= 0) { result = 'Digital Signal Processor'; } if (str.indexOf('loud') >= 0) {
if (str.indexOf('high definition audio') >= 0) { result = 'Sound Driver'; } result = 'Speaker';
}
if (str.indexOf('head') >= 0) {
result = 'Headset';
}
if (str.indexOf('mic') >= 0) {
result = 'Microphone';
}
if (str.indexOf('mikr') >= 0) {
result = 'Microphone';
}
if (str.indexOf('phone') >= 0) {
result = 'Phone';
}
if (str.indexOf('controll') >= 0) {
result = 'Controller';
}
if (str.indexOf('line o') >= 0) {
result = 'Line Out';
}
if (str.indexOf('digital o') >= 0) {
result = 'Digital Out';
}
if (str.indexOf('smart sound technology') >= 0) {
result = 'Digital Signal Processor';
}
if (str.indexOf('high definition audio') >= 0) {
result = 'Sound Driver';
}
if (!result && output) { if (!result && output) {
result = 'Speaker'; result = 'Speaker';
@ -54,13 +82,12 @@ function parseAudioType(str, input, output) {
return result; return result;
} }
function getLinuxAudioPci() { function getLinuxAudioPci() {
let cmd = 'lspci -v 2>/dev/null'; let cmd = 'lspci -v 2>/dev/null';
let result = []; let result = [];
try { try {
const parts = execSync(cmd, util.execOptsLinux).toString().split('\n\n'); const parts = execSync(cmd, util.execOptsLinux).toString().split('\n\n');
parts.forEach(element => { parts.forEach((element) => {
const lines = element.split('\n'); const lines = element.split('\n');
if (lines && lines.length && lines[0].toLowerCase().indexOf('audio') >= 0) { if (lines && lines.length && lines[0].toLowerCase().indexOf('audio') >= 0) {
const audio = {}; const audio = {};
@ -75,11 +102,27 @@ function getLinuxAudioPci() {
} }
} }
function parseWinAudioStatus(n) {
let status = n;
if (n === 1) {
status = 'other';
} else if (n === 2) {
status = 'unknown';
} else if (n === 3) {
status = 'enabled';
} else if (n === 4) {
status = 'disabled';
} else if (n === 5) {
status = 'not applicable';
}
return status;
}
function parseLinuxAudioPciMM(lines, audioPCI) { function parseLinuxAudioPciMM(lines, audioPCI) {
const result = {}; const result = {};
const slotId = util.getValue(lines, 'Slot'); const slotId = util.getValue(lines, 'Slot');
const pciMatch = audioPCI.filter(function (item) { return item.slotId === slotId; }); const pciMatch = audioPCI.filter((item) => item.slotId === slotId);
result.id = slotId; result.id = slotId;
result.name = util.getValue(lines, 'SDevice'); result.name = util.getValue(lines, 'SDevice');
@ -99,12 +142,24 @@ function parseLinuxAudioPciMM(lines, audioPCI) {
function parseDarwinChannel(str) { function parseDarwinChannel(str) {
let result = ''; let result = '';
if (str.indexOf('builtin') >= 0) { result = 'Built-In'; } if (str.indexOf('builtin') >= 0) {
if (str.indexOf('extern') >= 0) { result = 'Audio-Jack'; } result = 'Built-In';
if (str.indexOf('hdmi') >= 0) { result = 'HDMI'; } }
if (str.indexOf('displayport') >= 0) { result = 'Display-Port'; } if (str.indexOf('extern') >= 0) {
if (str.indexOf('usb') >= 0) { result = 'USB'; } result = 'Audio-Jack';
if (str.indexOf('pci') >= 0) { result = 'PCIe'; } }
if (str.indexOf('hdmi') >= 0) {
result = 'HDMI';
}
if (str.indexOf('displayport') >= 0) {
result = 'Display-Port';
}
if (str.indexOf('usb') >= 0) {
result = 'USB';
}
if (str.indexOf('pci') >= 0) {
result = 'PCIe';
}
return result; return result;
} }
@ -130,7 +185,7 @@ function parseDarwinAudio(audioObject, id) {
function parseWindowsAudio(lines) { function parseWindowsAudio(lines) {
const result = {}; const result = {};
const status = util.getValue(lines, 'StatusInfo', ':'); const status = parseWinAudioStatus(util.getValue(lines, 'StatusInfo', ':'));
result.id = util.getValue(lines, 'DeviceID', ':'); // PNPDeviceID?? result.id = util.getValue(lines, 'DeviceID', ':'); // PNPDeviceID??
result.name = util.getValue(lines, 'name', ':'); result.name = util.getValue(lines, 'name', ':');
@ -148,18 +203,17 @@ function parseWindowsAudio(lines) {
} }
function audio(callback) { function audio(callback) {
return new Promise((resolve) => { return new Promise((resolve) => {
process.nextTick(() => { process.nextTick(() => {
let result = []; const result = [];
if (_linux || _freebsd || _openbsd || _netbsd) { if (_linux || _freebsd || _openbsd || _netbsd) {
let cmd = 'lspci -vmm 2>/dev/null'; const cmd = 'lspci -vmm 2>/dev/null';
exec(cmd, function (error, stdout) { exec(cmd, (error, stdout) => {
// PCI // PCI
if (!error) { if (!error) {
const audioPCI = getLinuxAudioPci(); const audioPCI = getLinuxAudioPci();
const parts = stdout.toString().split('\n\n'); const parts = stdout.toString().split('\n\n');
parts.forEach(element => { parts.forEach((element) => {
const lines = element.split('\n'); const lines = element.split('\n');
if (util.getValue(lines, 'class', ':', true).toLowerCase().indexOf('audio') >= 0) { if (util.getValue(lines, 'class', ':', true).toLowerCase().indexOf('audio') >= 0) {
const audio = parseLinuxAudioPciMM(lines, audioPCI); const audio = parseLinuxAudioPciMM(lines, audioPCI);
@ -174,8 +228,8 @@ function audio(callback) {
}); });
} }
if (_darwin) { if (_darwin) {
let cmd = 'system_profiler SPAudioDataType -json'; const cmd = 'system_profiler SPAudioDataType -json';
exec(cmd, function (error, stdout) { exec(cmd, (error, stdout) => {
if (!error) { if (!error) {
try { try {
const outObj = JSON.parse(stdout.toString()); const outObj = JSON.parse(stdout.toString());
@ -199,7 +253,7 @@ function audio(callback) {
util.powerShell('Get-CimInstance Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl').then((stdout, error) => { util.powerShell('Get-CimInstance Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl').then((stdout, error) => {
if (!error) { if (!error) {
const parts = stdout.toString().split(/\n\s*\n/); const parts = stdout.toString().split(/\n\s*\n/);
parts.forEach(element => { parts.forEach((element) => {
const lines = element.split('\n'); const lines = element.split('\n');
if (util.getValue(lines, 'name', ':')) { if (util.getValue(lines, 'name', ':')) {
result.push(parseWindowsAudio(lines)); result.push(parseWindowsAudio(lines));