Merge branch 'master' into master

This commit is contained in:
Sebastian Hildebrandt 2021-06-09 21:43:37 +02:00 committed by GitHub
commit 2619f42a19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 36 additions and 12 deletions

View File

@ -53,8 +53,8 @@ We had to make **several interface changes** to keep systeminformation as consis
- `getData()`: support for passing parameters and filters (see section General / getData)
- `graphics()`: extended nvidia-smi parsing
- `networkInterfaces()`: type detection improved (win - wireless)
- `memoryLayout()`: extended manufacturer list (decoding)
- `memoryLayout()`: added ECC flag
- `memLayout()`: extended manufacturer list (decoding)
- `memLayout()`: added ECC flag
- `osInfo()`: better fqdn (win)
- `osinfo()`: added hypervizor if hyper-v is enabled (win only)
- `osInfo()`: added remoteSession (win only)
@ -77,6 +77,8 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 5.7.6 | 2021-06-09 | `battery()` improved detection (additional batteries windows) |
| 5.7.5 | 2021-06-08 | `memLayout()` improved clock speed detection (windows) |
| 5.7.4 | 2021-05-27 | `osInfo()`, `cpu()` improved hypervisor, virtualization detection (windows) |
| 5.7.3 | 2021-05-26 | `osInfo()` improved UEFI detection (windows) |
| 5.7.2 | 2021-05-24 | `system()` virtual detection improvement |

View File

@ -226,6 +226,16 @@
<td></td>
<td>battery serial</td>
</tr>
<tr>
<td></td>
<td>additionalBatteries[]</td>
<td></td>
<td></td>
<td></td>
<td>X</td>
<td></td>
<td>array of additional batteries</td>
</tr>
<tr class="example">
<td></td>
<td colspan="7">

View File

@ -179,8 +179,8 @@
<li><span class="code">getData()</span>: support for passing parameters and filters (see <a href="general.html">section General / getData</a>)</li>
<li><span class="code">graphics()</span>: extended nvidia-smi parsing</li>
<li><span class="code">networkInterfaces()</span>: type detection improved (win - wireless)</li>
<li><span class="code">memoryLayout()</span>: extended manufacturer list (decoding)</li>
<li><span class="code">memoryLayout()</span>: added ECC flag</li>
<li><span class="code">memLayout()</span>: extended manufacturer list (decoding)</li>
<li><span class="code">memLayout()</span>: added ECC flag</li>
<li><span class="code">osInfo()</span>: better fqdn (win)</li>
<li><span class="code">osinfo()</span>: added <span class="code">hypervizor</span> if hyper-v is enabled (win only)</li>
<li><span class="code">system()</span>: better Raspberry PI detection</li>

View File

@ -56,6 +56,16 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.7.6</th>
<td>2021-06-09</td>
<td><span class="code">battery()</span> improved detection (additional batteries windows)</td>
</tr>
<tr>
<th scope="row">5.7.5</th>
<td>2021-06-08</td>
<td><span class="code">memLayout()</span> improved clock speed detection (windows)</td>
</tr>
<tr>
<th scope="row">5.7.4</th>
<td>2021-05-27</td>
@ -329,7 +339,7 @@
<tr>
<th scope="row">5.0.4</th>
<td>2021-01-27</td>
<td><span class="code">memoryLayout()</span> improved manufacturer decoding (linux)</td>
<td><span class="code">memLayout()</span> improved manufacturer decoding (linux)</td>
</tr>
<tr>
<th scope="row">5.0.3</th>

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.7.4</span></div>
<div class="version">New Version: <span id="version">5.7.6</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">
@ -211,7 +211,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">414</div>
<div class="numbers">420</div>
<div class="title">Dependents</div>
</div>
</div>

View File

@ -217,12 +217,13 @@ module.exports = function (callback) {
workload
).then(data => {
if (data) {
let parts = data.results[0].split('\r\n')
// let parts = data.results[0].split(/\n\s*\n/);
let parts = data.results[0].split('\r\n');
let batteries = [];
for (let i = 0; i < parts.length; i++) {
const hasValue = value => /\S/.test(value);
if (hasValue(parts[i]) && (!batteries.length || !hasValue(parts[i - 1]))) {
batteries.push([])
batteries.push([]);
}
if (hasValue(parts[i])) {
batteries[batteries.length - 1].push(parts[i]);
@ -234,7 +235,7 @@ module.exports = function (callback) {
let first = false;
let additionalBatteries = [];
for (let i = 0; i < batteries.length; i++) {
let lines = batteries[i]
let lines = batteries[i];
const designCapacity = designCapacities && designCapacities.length >= (i + 1) && designCapacities[i] ? util.toInt(designCapacities[i]) : 0;
const fullChargeCapacity = fullChargeCapacities && fullChargeCapacities.length >= (i + 1) && fullChargeCapacities[i] ? util.toInt(fullChargeCapacities[i]) : 0;
const parsed = parseWinBatteryPart(lines, designCapacity, fullChargeCapacity);

1
lib/index.d.ts vendored
View File

@ -284,6 +284,7 @@ export namespace Systeminformation {
model: string;
manufacturer: string;
serial: string;
additionalBatteries?: BatteryData[];
}
interface GraphicsData {

View File

@ -510,7 +510,7 @@ function memLayout(callback) {
bank: util.getValue(lines, 'abel', '='), // BankLabel
type: memoryTypes[parseInt(util.getValue(lines, 'MemoryType', '='), 10)],
ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
clockSpeed: parseInt(util.getValue(lines, 'ConfiguredClockSpeed', '='), 10) || 0,
clockSpeed: parseInt(util.getValue(lines, 'ConfiguredClockSpeed', '='), 10) || parseInt(util.getValue(lines, 'Speed', '='), 10) || 0,
formFactor: FormFactors[parseInt(util.getValue(lines, 'FormFactor', '='), 10) || 0],
manufacturer: util.getValue(lines, 'Manufacturer', '='),
partNum: util.getValue(lines, 'PartNumber', '='),

View File

@ -1,6 +1,6 @@
{
"name": "systeminformation",
"version": "5.7.4",
"version": "5.7.6",
"description": "Simple system and OS information library",
"license": "MIT",
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",