fixed parsing issues (windows)
This commit is contained in:
parent
b22befe18e
commit
018d5f26aa
@ -80,6 +80,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
||||
|
||||
| Version | Date | Comment |
|
||||
| -------------- | -------------- | -------- |
|
||||
| 5.11.5 | 2022-02-26 | fixed parsing issues (windows) |
|
||||
| 5.11.4 | 2022-02-20 | `powerShell` execution policy fix (windows) |
|
||||
| 5.11.3 | 2022-02-14 | updated docs |
|
||||
| 5.11.2 | 2022-02-05 | `powerShell` speed improvements (windows) |
|
||||
|
||||
@ -57,6 +57,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">5.11.5</th>
|
||||
<td>2022-02-26</td>
|
||||
<td>fixed parsing issues (windows)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.11.4</th>
|
||||
<td>2022-02-20</td>
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
<img class="logo" src="assets/logo.png">
|
||||
<div class="title">systeminformation</div>
|
||||
<div class="subtitle"><span id="typed"></span> </div>
|
||||
<div class="version">New Version: <span id="version">5.11.4</span></div>
|
||||
<div class="version">New Version: <span id="version">5.11.5</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">
|
||||
@ -206,7 +206,7 @@
|
||||
</div>
|
||||
<div class="row number-section">
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
<div class="numbers">15,194</div>
|
||||
<div class="numbers">15,199</div>
|
||||
<div class="title">Lines of code</div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
@ -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">517</div>
|
||||
<div class="numbers">523</div>
|
||||
<div class="title">Dependents</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1239,20 +1239,26 @@ function diskLayout(callback) {
|
||||
// S.M.A.R.T
|
||||
data.results.shift();
|
||||
data.results.shift();
|
||||
data.results.forEach((smartStr) => {
|
||||
const smartData = JSON.parse(smartStr);
|
||||
if (smartData.serial_number) {
|
||||
const serialNum = smartData.serial_number;
|
||||
let i = util.findObjectByKey(result, 'serialNum', serialNum);
|
||||
if (i != -1) {
|
||||
result[i].smartStatus = (smartData.smart_status.passed ? 'Ok' : (smartData.smart_status.passed === false ? 'Predicted Failure' : 'unknown'));
|
||||
if (smartData.temperature && smartData.temperature.current) {
|
||||
result[i].temperature = smartData.temperature.current;
|
||||
if (data.results.length) {
|
||||
data.results.forEach((smartStr) => {
|
||||
try {
|
||||
const smartData = JSON.parse(smartStr);
|
||||
if (smartData.serial_number) {
|
||||
const serialNum = smartData.serial_number;
|
||||
let i = util.findObjectByKey(result, 'serialNum', serialNum);
|
||||
if (i != -1) {
|
||||
result[i].smartStatus = (smartData.smart_status.passed ? 'Ok' : (smartData.smart_status.passed === false ? 'Predicted Failure' : 'unknown'));
|
||||
if (smartData.temperature && smartData.temperature.current) {
|
||||
result[i].temperature = smartData.temperature.current;
|
||||
}
|
||||
result[i].smartData = smartData;
|
||||
}
|
||||
}
|
||||
result[i].smartData = smartData;
|
||||
} catch (e) {
|
||||
util.noop();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if (callback) {
|
||||
callback(result);
|
||||
}
|
||||
|
||||
@ -254,8 +254,8 @@ function getWindowsNics() {
|
||||
try {
|
||||
util.powerShell(cmd).then(data => {
|
||||
data = data.split('#-#-#-#');
|
||||
const nsections = data[0].split(/\n\s*\n/);
|
||||
const nconfigsections = data[1].split(/\n\s*\n/);
|
||||
const nsections = (data[0] || '').split(/\n\s*\n/);
|
||||
const nconfigsections = (data[1] || '').split(/\n\s*\n/);
|
||||
resolve(parseLinesWindowsNics(nsections, nconfigsections));
|
||||
});
|
||||
} catch (e) {
|
||||
|
||||
@ -262,10 +262,10 @@ function users(callback) {
|
||||
// let accounts = parseWinAccounts(data[0].split(/\n\s*\n/));
|
||||
if (data) {
|
||||
data = data.split('#-#-#-#');
|
||||
let sessions = parseWinSessions(data[0].split(/\n\s*\n/));
|
||||
let loggedons = parseWinLoggedOn(data[1].split(/\n\s*\n/));
|
||||
let queryUser = parseWinUsersQuery(data[3].split('\r\n'));
|
||||
let users = parseWinUsers(data[2].split(/\n\s*\n/), queryUser);
|
||||
let sessions = parseWinSessions((data[0] || '').split(/\n\s*\n/));
|
||||
let loggedons = parseWinLoggedOn((data[1] || '').split(/\n\s*\n/));
|
||||
let queryUser = parseWinUsersQuery((data[3] || '').split('\r\n'));
|
||||
let users = parseWinUsers((data[2] || '').split(/\n\s*\n/), queryUser);
|
||||
for (let id in loggedons) {
|
||||
if ({}.hasOwnProperty.call(loggedons, id)) {
|
||||
loggedons[id].dateTime = {}.hasOwnProperty.call(sessions, id) ? sessions[id] : '';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user