fsSize() WLS fix windows
This commit is contained in:
parent
505395b522
commit
e8349c823f
@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 5.0.11 | 2020-02-07 | `fsSize()` fixed windows WSL issue |
|
||||||
| 5.0.10 | 2020-02-06 | `getDynamicData()` fixed windows WSL issue |
|
| 5.0.10 | 2020-02-06 | `getDynamicData()` fixed windows WSL issue |
|
||||||
| 5.0.9 | 2020-02-02 | `fsSize()` fixed parsing edge case issue mac OS |
|
| 5.0.9 | 2020-02-02 | `fsSize()` fixed parsing edge case issue mac OS |
|
||||||
| 5.0.8 | 2020-01-30 | typescript typings fix cpuCurrentSpeed |
|
| 5.0.8 | 2020-01-30 | typescript typings fix cpuCurrentSpeed |
|
||||||
|
|||||||
@ -56,6 +56,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">5.0.11</th>
|
||||||
|
<td>2020-02-07</td>
|
||||||
|
<td><span class="code">fsSize()</span> windows WSL fix</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">5.0.10</th>
|
<th scope="row">5.0.10</th>
|
||||||
<td>2020-02-06</td>
|
<td>2020-02-06</td>
|
||||||
|
|||||||
@ -170,7 +170,7 @@
|
|||||||
<img class="logo" src="assets/logo.png">
|
<img class="logo" src="assets/logo.png">
|
||||||
<div class="title">systeminformation</div>
|
<div class="title">systeminformation</div>
|
||||||
<div class="subtitle"><span id="typed"></span> </div>
|
<div class="subtitle"><span id="typed"></span> </div>
|
||||||
<div class="version">New Version: <span id="version">5.0.10</span></div>
|
<div class="version">New Version: <span id="version">5.0.11</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">
|
||||||
|
|||||||
@ -52,7 +52,7 @@ function fsSize(callback) {
|
|||||||
lines.forEach(function (line) {
|
lines.forEach(function (line) {
|
||||||
if (line !== '') {
|
if (line !== '') {
|
||||||
line = line.replace(/ +/g, ' ').split(' ');
|
line = line.replace(/ +/g, ' ').split(' ');
|
||||||
if (line && ((line[0].startsWith('/')) || (line[6] && line[6] === '/') || (line[0].indexOf('/') > 0))) {
|
if (line && ((line[0].startsWith('/')) || (line[6] && line[6] === '/') || (line[0].indexOf('/') > 0) || (line[0].indexOf(':') === 1))) {
|
||||||
const fs = line[0];
|
const fs = line[0];
|
||||||
const fsType = ((_linux || _freebsd || _openbsd || _netbsd) ? line[1] : getmacOsFsType(line[0]));
|
const fsType = ((_linux || _freebsd || _openbsd || _netbsd) ? line[1] : getmacOsFsType(line[0]));
|
||||||
const size = parseInt(((_linux || _freebsd || _openbsd || _netbsd) ? line[2] : line[1])) * 1024;
|
const size = parseInt(((_linux || _freebsd || _openbsd || _netbsd) ? line[2] : line[1])) * 1024;
|
||||||
@ -129,16 +129,18 @@ function fsSize(callback) {
|
|||||||
lines.forEach(function (line) {
|
lines.forEach(function (line) {
|
||||||
if (line !== '') {
|
if (line !== '') {
|
||||||
line = line.trim().split(/\s\s+/);
|
line = line.trim().split(/\s\s+/);
|
||||||
|
if (line.length >= 4 && parseInt(line[3], 10)) {
|
||||||
data.push({
|
data.push({
|
||||||
fs: line[0],
|
fs: line[0],
|
||||||
type: line[1],
|
type: line[1],
|
||||||
size: parseInt(line[3], 10),
|
size: parseInt(line[3], 10),
|
||||||
used: parseInt(line[3], 10) - parseInt(line[2], 10),
|
used: parseInt(line[3], 10) - parseInt(line[2], 10),
|
||||||
available: parseInt(line[2], 10),
|
available: parseInt(line[2], 10),
|
||||||
use: parseFloat((100.0 * (parseInt(line[3]) - parseInt(line[2]))) / parseInt(line[3])),
|
use: parseFloat(((100.0 * (parseInt(line[3]) - parseInt(line[2]))) / parseInt(line[3])).toFixed(2)),
|
||||||
mount: line[0]
|
mount: line[0]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(data);
|
callback(data);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user