diskLayout() fix parsing linux (JSON)

This commit is contained in:
Sebastian Hildebrandt 2022-06-13 05:35:09 +02:00
parent b8b37f6f89
commit 41f8b3d6b8
5 changed files with 11 additions and 5 deletions

View File

@ -80,6 +80,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 5.11.17 | 2022-06-13 | `diskLayout()` fix parsing linux (JSON) |
| 5.11.16 | 2022-05-30 | `docs` updated, `tests` added node 18 |
| 5.11.15 | 2022-05-11 | `audio()` fix typescript typings |
| 5.11.14 | 2022-04-22 | `netforkInterfaces()` node 18 compatibility |

View File

@ -30,7 +30,7 @@
[![Sponsoring][sponsor-badge]][sponsor-url]
[![MIT license][license-img]][license-url]
This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 500 versions published, up to 4 mio downloads per month, > 75 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 500 versions published, > 4 mio downloads per month, > 90 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
## New Version 5.0

View File

@ -57,9 +57,14 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.11.17</th>
<td>2022-06-13</td>
<td><span class="code">diskLayout()</span> fix parsing linux (JSON)</td>
</tr>
<tr>
<th scope="row">5.11.16</th>
<td>2022-05-11</td>
<td>2022-05-30</td>
<td><span class="code">docs</span> updated <span class="code">tests</span> added node 18</td>
</tr>
<tr>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.11.16</span></div>
<div class="version">New Version: <span id="version">5.11.17</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">
@ -214,7 +214,7 @@
<div class="title">Downloads last month</div>
</div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">544</div>
<div class="numbers">548</div>
<div class="title">Dependents</div>
</div>
</div>

View File

@ -852,7 +852,7 @@ function diskLayout(callback) {
try {
const outJSON = JSON.parse(out);
if (outJSON && {}.hasOwnProperty.call(outJSON, 'blockdevices')) {
devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fsType === null && item.parttype === null)); });
devices = outJSON.blockdevices.filter(item => { return (item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fstype === null && item.parttype === null)); });
}
} catch (e) {
// fallback to older version of lsblk