systeminformation 5.9.11 → 5.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/network.js +1 -2
- package/lib/users.js +24 -22
- package/package.json +1 -1
package/lib/network.js
CHANGED
|
@@ -773,7 +773,6 @@ function networkInterfaces(callback, rescan) {
|
|
|
773
773
|
let mtu = '';
|
|
774
774
|
let speed = null;
|
|
775
775
|
let carrierChanges = 0;
|
|
776
|
-
let operstate = 'down';
|
|
777
776
|
let dhcp = false;
|
|
778
777
|
let dnsSuffix = '';
|
|
779
778
|
let ieee8021xAuth = '';
|
|
@@ -852,7 +851,7 @@ function networkInterfaces(callback, rescan) {
|
|
|
852
851
|
speed = isNaN(myspeed) ? null : myspeed;
|
|
853
852
|
}
|
|
854
853
|
carrierChanges = parseInt(util.getValue(lines, 'carrier_changes'), 10);
|
|
855
|
-
operstate = util.getValue(lines, 'operstate');
|
|
854
|
+
const operstate = util.getValue(lines, 'operstate');
|
|
856
855
|
type = operstate === 'up' ? (util.getValue(lines, 'wireless').trim() ? 'wireless' : 'wired') : 'unknown';
|
|
857
856
|
if (iface === 'lo' || iface.startsWith('bond')) { type = 'virtual'; }
|
|
858
857
|
|
package/lib/users.js
CHANGED
|
@@ -297,34 +297,36 @@ function users(callback) {
|
|
|
297
297
|
util.powerShell(cmd).then(data => {
|
|
298
298
|
// controller + vram
|
|
299
299
|
// let accounts = parseWinAccounts(data[0].split(/\n\s*\n/));
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
if ({}.hasOwnProperty.call(loggedons, id)) {
|
|
306
|
-
loggedons[id].dateTime = {}.hasOwnProperty.call(sessions, id) ? sessions[id] : '';
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
users.forEach(user => {
|
|
310
|
-
let dateTime = '';
|
|
300
|
+
if (data) {
|
|
301
|
+
data = data.split('#-#-#-#');
|
|
302
|
+
let sessions = parseWinSessions(data[0].split(/\n\s*\n/));
|
|
303
|
+
let loggedons = parseWinLoggedOn(data[1].split(/\n\s*\n/));
|
|
304
|
+
let users = parseWinUsers(data[2].split(/\n\s*\n/));
|
|
311
305
|
for (let id in loggedons) {
|
|
312
306
|
if ({}.hasOwnProperty.call(loggedons, id)) {
|
|
313
|
-
|
|
314
|
-
dateTime = loggedons[id].dateTime;
|
|
315
|
-
}
|
|
307
|
+
loggedons[id].dateTime = {}.hasOwnProperty.call(sessions, id) ? sessions[id] : '';
|
|
316
308
|
}
|
|
317
309
|
}
|
|
310
|
+
users.forEach(user => {
|
|
311
|
+
let dateTime = '';
|
|
312
|
+
for (let id in loggedons) {
|
|
313
|
+
if ({}.hasOwnProperty.call(loggedons, id)) {
|
|
314
|
+
if (loggedons[id].user === user.user && (!dateTime || dateTime < loggedons[id].dateTime)) {
|
|
315
|
+
dateTime = loggedons[id].dateTime;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
318
319
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
320
|
+
result.push({
|
|
321
|
+
user: user.user,
|
|
322
|
+
tty: '',
|
|
323
|
+
date: `${dateTime.substr(0, 4)}-${dateTime.substr(4, 2)}-${dateTime.substr(6, 2)}`,
|
|
324
|
+
time: `${dateTime.substr(8, 2)}:${dateTime.substr(10, 2)}`,
|
|
325
|
+
ip: '',
|
|
326
|
+
command: ''
|
|
327
|
+
});
|
|
326
328
|
});
|
|
327
|
-
}
|
|
329
|
+
}
|
|
328
330
|
if (callback) { callback(result); }
|
|
329
331
|
resolve(result);
|
|
330
332
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.12",
|
|
4
4
|
"description": "Advanced, lightweight system and OS information library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",
|