disklayout() fix catch error macOS

This commit is contained in:
Sebastian Hildebrandt 2025-08-25 18:15:34 +02:00
parent 941ca85cf8
commit 9e5779ae3d
5 changed files with 14 additions and 15 deletions

View File

@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.27.8 | 2025-08-25 | `disklayout()` fixed catch error (macOS) |
| 5.27.7 | 2025-06-28 | `time()` fixed Intl issue |
| 5.27.6 | 2025-06-20 | `system()` added model (freebsd) |
| 5.27.5 | 2025-06-19 | `system()` added serial, uuid, virtual (freebsd) |

View File

@ -57,6 +57,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.27.8</th>
<td>2025-08-25</td>
<td><span class="code">disklayout()</span> fixed catch error (macOS)</td>
</tr>
<tr>
<th scope="row">5.27.7</th>
<td>2025-06-28</td>

View File

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

View File

@ -755,6 +755,9 @@ function getCpu() {
modelline = util.cleanString(modelline);
const modellineParts = modelline.split('@');
result.brand = modellineParts[0].trim();
if (result.brand.indexOf('Unknown') >= 0) {
result.brand = result.brand.split('Unknown')[0].trim();
}
result.speed = modellineParts[1] ? parseFloat(modellineParts[1].trim()) : 0;
if (result.speed === 0 && (result.brand.indexOf('AMD') > -1 || result.brand.toLowerCase().indexOf('ryzen') > -1)) {
result.speed = getAMDSpeed(result.brand);

View File

@ -1416,23 +1416,13 @@ function diskLayout(callback) {
}
}
});
for (let i = 0; i < result.length; i++) {
delete result[i].BSDName;
}
if (callback) {
callback(result);
}
resolve(result);
commitResult(result);
});
} else {
for (let i = 0; i < result.length; i++) {
delete result[i].BSDName;
}
if (callback) {
callback(result);
}
resolve(result);
commitResult(result);
}
} else {
commitResult(result);
}
});
}