code cleanup, updated docs
This commit is contained in:
parent
013959ce95
commit
601bc680d0
@ -30,7 +30,7 @@
|
||||
[![Sponsoring][sponsor-badge]][sponsor-url]
|
||||
[![MIT license][license-img]][license-url]
|
||||
|
||||
This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 500 versions published, > 4 mio downloads per month, > 90 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
|
||||
This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 500 versions published, up to 5 mio downloads per month, > 100 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
|
||||
|
||||
## New Version 5.0
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<body>
|
||||
<nav class="nav">
|
||||
<div class="container">
|
||||
<a href="."><img class="logo float-left" src="assets/logo.png">
|
||||
<a href="."><img class="logo float-left" src="assets/logo.png" alt="logo">
|
||||
<div class="title float-left">systeminformation</div>
|
||||
</a>
|
||||
<div class="text float-right github"><a href="https://github.com/sebhildebrandt/systeminformation">View on Github <i class="fab fa-github"></i></a></div>
|
||||
|
||||
@ -167,7 +167,7 @@
|
||||
<header class="bg-image-full">
|
||||
<div class="top-container">
|
||||
<a href="security.html" class="recommendation">Security advisory:<br>Update to v5.6.13</a>
|
||||
<img class="logo" src="assets/logo.png">
|
||||
<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.12.6</span></div>
|
||||
@ -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">558</div>
|
||||
<div class="numbers">583</div>
|
||||
<div class="title">Dependents</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -108,7 +108,6 @@ function getDefaultNetworkInterface() {
|
||||
if (_linux) { cmd = 'ip route 2> /dev/null | grep default | awk \'{print $5}\''; }
|
||||
if (_darwin) { cmd = 'route -n get default 2>/dev/null | grep interface: | awk \'{print $2}\''; }
|
||||
if (_freebsd || _openbsd || _netbsd || _sunos) { cmd = 'route get 0.0.0.0 | grep interface:'; }
|
||||
// console.log('SYNC - default darwin 3');
|
||||
let result = execSync(cmd);
|
||||
ifacename = result.toString().split('\n')[0];
|
||||
if (ifacename.indexOf(':') > -1) {
|
||||
@ -173,7 +172,6 @@ function getMacAddresses() {
|
||||
if (_darwin) {
|
||||
try {
|
||||
const cmd = '/sbin/ifconfig';
|
||||
// console.log('SYNC - macAde darwin 6');
|
||||
let res = execSync(cmd);
|
||||
const lines = res.toString().split('\n');
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
@ -247,8 +245,6 @@ function parseLinesWindowsNics(sections, nconfigsections) {
|
||||
}
|
||||
|
||||
function getWindowsNics() {
|
||||
// const cmd = util.getWmic() + ' nic get /value';
|
||||
// const cmdnicconfig = util.getWmic() + ' nicconfig get dhcpEnabled /value';
|
||||
return new Promise((resolve) => {
|
||||
process.nextTick(() => {
|
||||
let cmd = 'Get-WmiObject Win32_NetworkAdapter | fl *' + '; echo \'#-#-#-#\';';
|
||||
@ -394,7 +390,6 @@ function getWindowsIEEE8021x(connectionType, iface, ifaces) {
|
||||
i8021x.state = 'Enabled';
|
||||
}
|
||||
} catch (error) {
|
||||
// console.log('Error getting wired information:', error);
|
||||
return i8021x;
|
||||
}
|
||||
} else if (connectionType == 'wireless') {
|
||||
@ -416,7 +411,6 @@ function getWindowsIEEE8021x(connectionType, iface, ifaces) {
|
||||
i8021x.protocol = i8021xProtocol.split(':').pop();
|
||||
}
|
||||
} catch (error) {
|
||||
// console.log('Error getting wireless information:', error);
|
||||
if (error.status === 1 && error.stdout.includes('AutoConfig')) {
|
||||
i8021x.state = 'Disabled';
|
||||
i8021x.protocol = 'Not defined';
|
||||
@ -1409,7 +1403,6 @@ function networkConnections(callback) {
|
||||
peerip = peeraddress.join(':');
|
||||
}
|
||||
let connstate = line[5];
|
||||
// if (connstate === 'VERBUNDEN') connstate = 'ESTABLISHED';
|
||||
let proc = line[6].split('/');
|
||||
|
||||
if (connstate) {
|
||||
|
||||
@ -18,7 +18,6 @@ const fs = require('fs');
|
||||
const util = require('./util');
|
||||
const exec = require('child_process').exec;
|
||||
const execSync = require('child_process').execSync;
|
||||
// const execPromise = util.promisify(require('child_process').exec);
|
||||
|
||||
let _platform = process.platform;
|
||||
|
||||
@ -1090,7 +1089,6 @@ function uuid(callback) {
|
||||
const jsonObj = JSON.parse(stdout.toString());
|
||||
if (jsonObj.SPHardwareDataType && jsonObj.SPHardwareDataType.length > 0) {
|
||||
const spHardware = jsonObj.SPHardwareDataType[0];
|
||||
// result.os = parts.length > 1 ? parts[1].trim().toLowerCase() : '';
|
||||
result.os = spHardware.platform_UUID.toLowerCase();
|
||||
result.hardware = spHardware.serial_number;
|
||||
}
|
||||
|
||||
@ -14,9 +14,7 @@
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
const exec = require('child_process').exec;
|
||||
// const execSync = require('child_process').execSync;
|
||||
const util = require('./util');
|
||||
// const fs = require('fs');
|
||||
|
||||
let _platform = process.platform;
|
||||
|
||||
|
||||
@ -150,7 +150,6 @@ function services(srv, callback) {
|
||||
let srvs = srvString.split('|');
|
||||
let result = [];
|
||||
let dataSrv = [];
|
||||
// let allSrv = [];
|
||||
|
||||
if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {
|
||||
if ((_linux || _freebsd || _openbsd || _netbsd) && srvString === '*') {
|
||||
@ -1166,18 +1165,13 @@ function processLoad(proc, callback) {
|
||||
listPos = j;
|
||||
}
|
||||
}
|
||||
// console.log(listPos);
|
||||
processes.forEach(function (proc) {
|
||||
// console.log(proc)
|
||||
// console.log(item)
|
||||
// inList = inList || item.name.toLowerCase() === proc.toLowerCase();
|
||||
|
||||
if (item.name.toLowerCase().indexOf(proc.toLowerCase()) >= 0 && !inList) {
|
||||
inList = true;
|
||||
name = proc;
|
||||
}
|
||||
});
|
||||
// console.log(item);
|
||||
// console.log(listPos);
|
||||
if ((processesString === '*') || inList) {
|
||||
if (listPos < 0) {
|
||||
result.push({
|
||||
@ -1265,10 +1259,8 @@ function processLoad(proc, callback) {
|
||||
});
|
||||
|
||||
_process_cpu.all = all;
|
||||
// _process_cpu.list = list_new;
|
||||
_process_cpu.list = Object.assign({}, list_new);
|
||||
_process_cpu.ms = Date.now() - _process_cpu.ms;
|
||||
// _process_cpu.result = result;
|
||||
_process_cpu.result = Object.assign({}, result);
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user