code cleanup, refresh rate (win)
This commit is contained in:
parent
24cfe4690c
commit
c5647a66fd
@ -525,11 +525,11 @@ function getSocketTypesByName(str) {
|
||||
let result = '';
|
||||
for (const key in socketTypesByName) {
|
||||
const names = socketTypesByName[key].split(' ');
|
||||
for (let i = 0; i < names.length; i++) {
|
||||
if (str.indexOf(names[i]) >= 0) {
|
||||
names.forEach(element => {
|
||||
if (str.indexOf(element) >= 0) {
|
||||
result = key;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -458,7 +458,7 @@ function dockerContainerStats(containerIDs, callback) {
|
||||
containerIDsSanitized = '';
|
||||
const s = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerIDs, true)).trim();
|
||||
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||
if (!(s[i] === undefined)) {
|
||||
if (s[i] !== undefined) {
|
||||
s[i].__proto__.toLowerCase = util.stringToLower;
|
||||
const sl = s[i].toLowerCase();
|
||||
if (sl && sl[0] && !sl[1]) {
|
||||
|
||||
@ -864,10 +864,12 @@ function graphics(callback) {
|
||||
if (_pixelDepth) {
|
||||
result.displays[0].pixelDepth = _pixelDepth;
|
||||
}
|
||||
if (_refreshRate && !result.displays[0].currentRefreshRate) {
|
||||
result.displays[0].currentRefreshRate = _refreshRate;
|
||||
}
|
||||
}
|
||||
result.displays = result.displays.map(element => {
|
||||
if (_refreshRate && !element.currentRefreshRate) {
|
||||
element.currentRefreshRate = _refreshRate;
|
||||
}
|
||||
});
|
||||
|
||||
if (callback) {
|
||||
callback(result);
|
||||
|
||||
@ -46,7 +46,7 @@ function inetChecksite(url, callback) {
|
||||
let urlSanitized = '';
|
||||
const s = util.sanitizeShellString(url, true);
|
||||
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||
if (!(s[i] === undefined)) {
|
||||
if (!s[i] !== undefined) {
|
||||
s[i].__proto__.toLowerCase = util.stringToLower;
|
||||
const sl = s[i].toLowerCase();
|
||||
if (sl && sl[0] && !sl[1] && sl[0].length === 1) {
|
||||
|
||||
@ -305,7 +305,6 @@ function getWindowsDNSsuffixes() {
|
||||
|
||||
return dnsSuffixes;
|
||||
} catch (error) {
|
||||
// console.log('An error occurred trying to bring the Connection-specific DNS suffix', error.message);
|
||||
return {
|
||||
primaryDNS: '',
|
||||
exitCode: 0,
|
||||
|
||||
@ -47,7 +47,6 @@ function system(callback) {
|
||||
|
||||
if (_linux || _freebsd || _openbsd || _netbsd) {
|
||||
exec('export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL', function (error, stdout) {
|
||||
// if (!error) {
|
||||
let lines = stdout.toString().split('\n');
|
||||
result.manufacturer = util.getValue(lines, 'manufacturer');
|
||||
result.model = util.getValue(lines, 'product name');
|
||||
@ -55,7 +54,6 @@ function system(callback) {
|
||||
result.serial = util.getValue(lines, 'serial number');
|
||||
result.uuid = util.getValue(lines, 'uuid').toLowerCase();
|
||||
result.sku = util.getValue(lines, 'sku number');
|
||||
// }
|
||||
// Non-Root values
|
||||
const cmd = `echo -n "product_name: "; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo;
|
||||
echo -n "product_serial: "; cat /sys/devices/virtual/dmi/id/product_serial 2>/dev/null; echo;
|
||||
|
||||
@ -350,7 +350,6 @@ function parseWinUsersQuery(lines) {
|
||||
if (lines[i].trim()) {
|
||||
const user = lines[i].substring(headerDelimiter[0] + 1, headerDelimiter[1]).trim() || '';
|
||||
const tty = lines[i].substring(headerDelimiter[1] + 1, headerDelimiter[2] - 2).trim() || '';
|
||||
// const dateTime = util.parseDateTime(lines[i].substring(headerDelimiter[5] + 1, 2000).trim(), culture) || '';
|
||||
result.push({
|
||||
user: user,
|
||||
tty: tty,
|
||||
|
||||
@ -254,7 +254,6 @@ function parseHead(head, rights) {
|
||||
let result = [];
|
||||
for (let i = 0; i < head.length; i++) {
|
||||
if (count <= rights) {
|
||||
// if (head[i] === ' ' && !space) {
|
||||
if (/\s/.test(head[i]) && !space) {
|
||||
to = i - 1;
|
||||
result.push({
|
||||
|
||||
@ -68,7 +68,6 @@ function printTitle(title) {
|
||||
}
|
||||
|
||||
process.stdin.on('keypress', (key, data) => {
|
||||
// console.log(data);
|
||||
if (data.name === 'q' && !data.shift) {
|
||||
// shut down
|
||||
process.exit();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user