mem() fixed error handling
This commit is contained in:
parent
9ada69c835
commit
2c396c0582
@ -82,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
||||
|
||||
| Version | Date | Comment |
|
||||
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
|
||||
| 5.18.13 | 2023-08-08 | `mem()` fixed error handling |
|
||||
| 5.18.12 | 2023-08-05 | `fsSize()` rw /snap/ issue fixed (linux) |
|
||||
| 5.18.11 | 2023-08-04 | `bluetooth()` improved parsing, macOS Sonoma detection |
|
||||
| 5.18.10 | 2023-07-28 | `cpu()` fixed cache sizes, extended sockets (windows) |
|
||||
|
||||
@ -57,6 +57,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">5.18.13</th>
|
||||
<td>2023-08-08</td>
|
||||
<td><span class="code">mem()</span> fixed error handling</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.18.12</th>
|
||||
<td>2023-08-05</td>
|
||||
|
||||
@ -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> </div>
|
||||
<div class="version">New Version: <span id="version">5.18.12</span></div>
|
||||
<div class="version">New Version: <span id="version">5.18.13</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">
|
||||
|
||||
@ -166,6 +166,7 @@ function mem(callback) {
|
||||
};
|
||||
|
||||
if (_linux) {
|
||||
try {
|
||||
fs.readFile('/proc/meminfo', function (error, stdout) {
|
||||
if (!error) {
|
||||
const lines = stdout.toString().split('\n');
|
||||
@ -196,8 +197,13 @@ function mem(callback) {
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
});
|
||||
} catch (e) {
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
}
|
||||
}
|
||||
if (_freebsd || _openbsd || _netbsd) {
|
||||
try {
|
||||
exec('/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size', function (error, stdout) {
|
||||
if (!error) {
|
||||
let lines = stdout.toString().split('\n');
|
||||
@ -220,6 +226,10 @@ function mem(callback) {
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
});
|
||||
} catch (e) {
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
}
|
||||
}
|
||||
if (_sunos) {
|
||||
if (callback) { callback(result); }
|
||||
@ -233,6 +243,7 @@ function mem(callback) {
|
||||
} catch (e) {
|
||||
util.noop();
|
||||
}
|
||||
try {
|
||||
exec('vm_stat 2>/dev/null | grep "Pages active"', function (error, stdout) {
|
||||
if (!error) {
|
||||
let lines = stdout.toString().split('\n');
|
||||
@ -258,6 +269,10 @@ function mem(callback) {
|
||||
resolve(result);
|
||||
});
|
||||
});
|
||||
} catch (e) {
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
}
|
||||
}
|
||||
if (_windows) {
|
||||
let swaptotal = 0;
|
||||
|
||||
@ -399,10 +399,11 @@ function bios(callback) {
|
||||
}
|
||||
if (_windows) {
|
||||
try {
|
||||
util.powerShell('Get-CimInstance Win32_bios | select Description,Version,Manufacturer,@{n="ReleaseDate";e={$_.ReleaseDate.ToString("yyyy-MM-dd")}},BuildNumber,SerialNumber | fl').then((stdout, error) => {
|
||||
util.powerShell('Get-CimInstance Win32_bios | select Description,Version,Manufacturer,@{n="ReleaseDate";e={$_.ReleaseDate.ToString("yyyy-MM-dd")}},BuildNumber,SerialNumber,SMBIOSBIOSVersion | fl').then((stdout, error) => {
|
||||
if (!error) {
|
||||
let lines = stdout.toString().split('\r\n');
|
||||
const description = util.getValue(lines, 'description', ':');
|
||||
const version = util.getValue(lines, 'SMBIOSBIOSVersion', ':');
|
||||
if (description.indexOf(' Version ') !== -1) {
|
||||
// ... Phoenix ROM BIOS PLUS Version 1.10 A04
|
||||
result.vendor = description.split(' Version ')[0].trim();
|
||||
@ -413,7 +414,7 @@ function bios(callback) {
|
||||
result.version = description.split(' Ver: ')[1].trim();
|
||||
} else {
|
||||
result.vendor = util.getValue(lines, 'manufacturer', ':');
|
||||
result.version = util.getValue(lines, 'version', ':');
|
||||
result.version = version || util.getValue(lines, 'version', ':');
|
||||
}
|
||||
result.releaseDate = util.getValue(lines, 'releasedate', ':');
|
||||
result.revision = util.getValue(lines, 'buildnumber', ':');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user