users() fix windows (time), added @ts-check
This commit is contained in:
parent
2794d4342b
commit
d1b05fa691
@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
|
||||
|
||||
| Version | Date | Comment |
|
||||
| -------------- | -------------- | -------- |
|
||||
| 4.0.11 | 2019-02-23 | `users()` fix windows (time), added @ts-check |
|
||||
| 4.0.10 | 2019-02-10 | `networkInterfaceDefault()` fix windows |
|
||||
| 4.0.9 | 2019-02-08 | `cpu()` fix, code cleanup |
|
||||
| 4.0.8 | 2019-02-05 | `inetLatency()` Windows fix parse chinese output |
|
||||
|
||||
@ -80,6 +80,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">4.0.11</th>
|
||||
<td>2019-02-23</td>
|
||||
<td><span class="code">users()</span> fix windows (time), added @ts-check</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">4.0.10</th>
|
||||
<td>2019-02-10</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">Current Version: <span id="version">4.0.10</span></div>
|
||||
<div class="version">Current Version: <span id="version">4.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>
|
||||
</div>
|
||||
<div class="down">
|
||||
@ -193,7 +193,7 @@
|
||||
</div>
|
||||
<div class="row number-section">
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
<div class="numbers">8,137</div>
|
||||
<div class="numbers">8,112</div>
|
||||
<div class="title">Lines of code</div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check;
|
||||
// ==================================================================================
|
||||
// battery.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// cpu.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
@ -582,7 +583,7 @@ function cpuCurrentspeed(callback) {
|
||||
max: currCpuSpeed,
|
||||
avg: currCpuSpeed,
|
||||
cores: []
|
||||
}
|
||||
};
|
||||
}
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// docker.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// dockerSockets.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// filesystem.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// graphics.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// index.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// internet.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// memory.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// network.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// osinfo.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// processes.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// system.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// users.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
14
lib/util.js
14
lib/util.js
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
// @ts-check
|
||||
// ==================================================================================
|
||||
// utils.js
|
||||
// ----------------------------------------------------------------------------------
|
||||
@ -107,6 +108,16 @@ function decodeEscapeSequence(str, base) {
|
||||
});
|
||||
}
|
||||
|
||||
function parseTime(t) {
|
||||
t = t.toUpperCase();
|
||||
const parts = t.split(':');
|
||||
let isPM = (parts[1] && parts[1].indexOf('PM') > -1);
|
||||
let hour = parseInt(parts[0], 10);
|
||||
const min = parseInt(parts[1], 10);
|
||||
hour = isPM && hour < 12 ? hour + 12 : hour;
|
||||
return ('0' + hour).substr(-2) + ':' + ('0' + min).substr(-2);
|
||||
}
|
||||
|
||||
function parseDateTime(dt) {
|
||||
const result = {
|
||||
date: '',
|
||||
@ -137,7 +148,8 @@ function parseDateTime(dt) {
|
||||
}
|
||||
}
|
||||
if (parts[1]) {
|
||||
result.time = parts[1];
|
||||
let time = parts[1] + (parts[2] ? parts[2] : '');
|
||||
result.time = parseTime(time);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user