graphics() fix after wmic refactor (win)
This commit is contained in:
parent
23650f7079
commit
0612e3aa20
@ -1,11 +1,14 @@
|
||||
body {
|
||||
font-family: 'Roboto', 'HelveticaNeue-Light','Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,sans-serif;
|
||||
font-family: "Roboto", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
background-color: rgb(14, 24, 46);
|
||||
font-weight: 300;
|
||||
min-height: 100%;
|
||||
}
|
||||
h1, h2, h3, h4 {
|
||||
font-family: 'Roboto', 'HelveticaNeue-Light','Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,sans-serif;
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4 {
|
||||
font-family: "Roboto", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-weight: 500;
|
||||
color: rgb(61, 92, 179);
|
||||
}
|
||||
@ -36,8 +39,8 @@ h1, h2, h3, h4 {
|
||||
}
|
||||
.bg-image-full {
|
||||
// background: no-repeat center center scroll;
|
||||
background-color: #1A1F30; /* For browsers that do not support gradients */
|
||||
background-image: linear-gradient(210deg, #2A2D66, #060520); /* Standard syntax (must be last) */
|
||||
background-color: #1a1f30; /* For browsers that do not support gradients */
|
||||
background-image: linear-gradient(210deg, #2a2d66, #060520); /* Standard syntax (must be last) */
|
||||
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
@ -78,13 +81,13 @@ h1, h2, h3, h4 {
|
||||
display: inline-block;
|
||||
width: 280px;
|
||||
text-align: center;
|
||||
padding: .25em 0;
|
||||
padding: 0.25em 0;
|
||||
color: white;
|
||||
transform: rotate(45deg);
|
||||
background: rgb(151, 29, 29);
|
||||
font-size: 0.9rem;
|
||||
@media only screen and (min-width: 420px) {
|
||||
font-size: 1.0rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
@media only screen and (min-width: 767px) {
|
||||
font-size: 1.1rem;
|
||||
@ -100,7 +103,7 @@ h1, h2, h3, h4 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
&:hover {
|
||||
text-decoration: none;;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
.title {
|
||||
@ -197,9 +200,9 @@ h1, h2, h3, h4 {
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
color: #fff;
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
@media only screen and (min-width: 420px) {
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
@media only screen and (min-width: 768px) {
|
||||
font-size: 1rem;
|
||||
@ -236,8 +239,8 @@ h1, h2, h3, h4 {
|
||||
// }
|
||||
.nav {
|
||||
background: no-repeat center center scroll;
|
||||
background-color: #1A1F30; /* For browsers that do not support gradients */
|
||||
background-image: linear-gradient(210deg, #2A2D66, #060520); /* Standard syntax (must be last) */
|
||||
background-color: #1a1f30; /* For browsers that do not support gradients */
|
||||
background-image: linear-gradient(210deg, #2a2d66, #060520); /* Standard syntax (must be last) */
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
background-size: cover;
|
||||
@ -261,7 +264,6 @@ h1, h2, h3, h4 {
|
||||
@media only screen and (min-width: 1024px) {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
}
|
||||
.text {
|
||||
margin-top: 18px;
|
||||
@ -269,7 +271,7 @@ h1, h2, h3, h4 {
|
||||
a {
|
||||
color: #fff;
|
||||
margin-top: 12px;
|
||||
font-size: 1.0rem;
|
||||
font-size: 1rem;
|
||||
@media only screen and (min-width: 1023px) {
|
||||
margin-top: 10px;
|
||||
font-size: 1.2rem;
|
||||
@ -369,7 +371,7 @@ h1, h2, h3, h4 {
|
||||
}
|
||||
.subtitle {
|
||||
text-align: center;
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 5px;
|
||||
@media only screen and (min-width: 420px) {
|
||||
@ -401,7 +403,11 @@ h1, h2, h3, h4 {
|
||||
}
|
||||
.index {
|
||||
margin: 0 0 10px 0;
|
||||
.text, .subtitle, .title, .title-small, .npmicons {
|
||||
.text,
|
||||
.subtitle,
|
||||
.title,
|
||||
.title-small,
|
||||
.npmicons {
|
||||
text-align: center;
|
||||
}
|
||||
.larger {
|
||||
@ -417,7 +423,10 @@ h1, h2, h3, h4 {
|
||||
}
|
||||
}
|
||||
.left {
|
||||
.text, .subtitle, .title, .title-small .npmicons {
|
||||
.text,
|
||||
.subtitle,
|
||||
.title,
|
||||
.title-small .npmicons {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
@ -538,7 +547,6 @@ pre {
|
||||
background-color: unset;
|
||||
.js {
|
||||
background-color: #f0f0f4;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -554,7 +562,7 @@ pre {
|
||||
a {
|
||||
color: #000;
|
||||
&:hover {
|
||||
text-decoration: none
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
.badge {
|
||||
|
||||
@ -1,11 +1,16 @@
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "segoe ui", Roboto, Helvetica, Arial, sans-serif, "apple color emoji", "segoe ui emoji", "segoe ui symbol";
|
||||
font-family: -apple-system, BlinkMacSystemFont, "segoe ui", Roboto, Helvetica, Arial, sans-serif, "apple color emoji",
|
||||
"segoe ui emoji", "segoe ui symbol";
|
||||
font-weight: 300;
|
||||
min-height: 100%;
|
||||
background-color: rgb(89, 53, 30);
|
||||
}
|
||||
h1, h2, h3, h4 {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "segoe ui", Roboto, Helvetica, Arial, sans-serif, "apple color emoji", "segoe ui emoji", "segoe ui symbol";
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4 {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "segoe ui", Roboto, Helvetica, Arial, sans-serif, "apple color emoji",
|
||||
"segoe ui emoji", "segoe ui symbol";
|
||||
font-weight: 300;
|
||||
}
|
||||
.center {
|
||||
@ -57,13 +62,13 @@ h1, h2, h3, h4 {
|
||||
display: inline-block;
|
||||
width: 330px;
|
||||
text-align: center;
|
||||
padding: .25em 0;
|
||||
padding: 0.25em 0;
|
||||
color: white;
|
||||
transform: rotate(45deg);
|
||||
background: rgb(151, 29, 29);
|
||||
font-size: 0.9rem;
|
||||
@media only screen and (min-width: 420px) {
|
||||
font-size: 1.0rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
@media only screen and (min-width: 768px) {
|
||||
font-size: 1.1rem;
|
||||
@ -74,7 +79,7 @@ h1, h2, h3, h4 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
&:hover {
|
||||
text-decoration: none;;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
.title {
|
||||
@ -146,9 +151,9 @@ h1, h2, h3, h4 {
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
color: #fff;
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
@media only screen and (min-width: 420px) {
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
@media only screen and (min-width: 768px) {
|
||||
font-size: 1rem;
|
||||
@ -212,7 +217,7 @@ h1, h2, h3, h4 {
|
||||
a {
|
||||
color: #fff;
|
||||
margin-top: 12px;
|
||||
font-size: 1.0rem;
|
||||
font-size: 1rem;
|
||||
@media only screen and (min-width: 1023px) {
|
||||
margin-top: 10px;
|
||||
font-size: 1.2rem;
|
||||
@ -307,7 +312,7 @@ h1, h2, h3, h4 {
|
||||
}
|
||||
.subtitle {
|
||||
text-align: center;
|
||||
font-size: .9rem;
|
||||
font-size: 0.9rem;
|
||||
@media only screen and (min-width: 420px) {
|
||||
font-size: 1rem;
|
||||
}
|
||||
@ -337,7 +342,11 @@ h1, h2, h3, h4 {
|
||||
}
|
||||
.index {
|
||||
margin: 0 0 10px 0;
|
||||
.text, .subtitle, .title, .title-small, .npmicons {
|
||||
.text,
|
||||
.subtitle,
|
||||
.title,
|
||||
.title-small,
|
||||
.npmicons {
|
||||
text-align: center;
|
||||
}
|
||||
a {
|
||||
@ -349,7 +358,10 @@ h1, h2, h3, h4 {
|
||||
}
|
||||
}
|
||||
.left {
|
||||
.text, .subtitle, .title, .title-small .npmicons {
|
||||
.text,
|
||||
.subtitle,
|
||||
.title,
|
||||
.title-small .npmicons {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
@ -463,7 +475,6 @@ pre {
|
||||
background-color: unset;
|
||||
.js {
|
||||
background-color: #f0f0f4;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
// 7. Graphics (controller, display)
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
const os = require('os');
|
||||
const fs = require('fs');
|
||||
const exec = require('child_process').exec;
|
||||
const execSync = require('child_process').execSync;
|
||||
@ -783,8 +782,8 @@ function graphics(callback) {
|
||||
workload
|
||||
).then(data => {
|
||||
// controller + vram
|
||||
let csections = data[0].split(/\n\s*\n/);
|
||||
let vsections = data[1].split(/\n\s*\n/);
|
||||
let csections = data[0].replace(/\r/g, '').split(/\n\s*\n/);
|
||||
let vsections = data[1].replace(/\r/g, '').split(/\n\s*\n/);
|
||||
result.controllers = parseLinesWindowsControllers(csections, vsections);
|
||||
result.controllers = result.controllers.map((controller) => { // match by subDeviceId
|
||||
if (controller.vendor.toLowerCase() === 'nvidia') {
|
||||
@ -810,25 +809,25 @@ function graphics(callback) {
|
||||
});
|
||||
|
||||
// displays
|
||||
let dsections = data[2].split(/\n\s*\n/);
|
||||
let dsections = data[2].replace(/\r/g, '').split(/\n\s*\n/);
|
||||
// result.displays = parseLinesWindowsDisplays(dsections);
|
||||
dsections.shift();
|
||||
dsections.pop();
|
||||
if (dsections[0].trim() === '') { dsections.shift(); }
|
||||
if (dsections.length && dsections[dsections.length - 1].trim() === '') { dsections.pop(); }
|
||||
|
||||
// monitor (powershell)
|
||||
let msections = data[3].split('Active ');
|
||||
let msections = data[3].replace(/\r/g, '').split('Active ');
|
||||
msections.shift();
|
||||
|
||||
// forms.screens (powershell)
|
||||
let ssections = data[4].split('BitsPerPixel ');
|
||||
let ssections = data[4].replace(/\r/g, '').split('BitsPerPixel ');
|
||||
ssections.shift();
|
||||
|
||||
// connection params (powershell) - video type
|
||||
let tsections = data[5].split(/\n\s*\n/);
|
||||
let tsections = data[5].replace(/\r/g, '').split(/\n\s*\n/);
|
||||
tsections.shift();
|
||||
|
||||
// monitor ID (powershell) - model / vendor
|
||||
const res = data[6].split(/\r\n/);
|
||||
const res = data[6].replace(/\r/g, '').split(/\n/);
|
||||
let isections = [];
|
||||
res.forEach(element => {
|
||||
const parts = element.split('|');
|
||||
@ -842,6 +841,7 @@ function graphics(callback) {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
result.displays = parseLinesWindowsDisplaysPowershell(ssections, msections, dsections, tsections, isections);
|
||||
|
||||
if (result.displays.length === 1) {
|
||||
@ -889,7 +889,7 @@ function graphics(callback) {
|
||||
for (const i in vections) {
|
||||
if ({}.hasOwnProperty.call(vections, i)) {
|
||||
if (vections[i].trim() !== '') {
|
||||
const lines = vections[i].trim().split(os.EOL);
|
||||
const lines = vections[i].trim().split('\n');
|
||||
const matchingDeviceId = util.getValue(lines, 'MatchingDeviceId').match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);
|
||||
if (matchingDeviceId) {
|
||||
const quadWordmemorySize = parseInt(util.getValue(lines, 'HardwareInformation.qwMemorySize'));
|
||||
@ -912,7 +912,7 @@ function graphics(callback) {
|
||||
for (let i in sections) {
|
||||
if ({}.hasOwnProperty.call(sections, i)) {
|
||||
if (sections[i].trim() !== '') {
|
||||
let lines = sections[i].trim().split('\r\n');
|
||||
let lines = sections[i].trim().split('\n');
|
||||
let pnpDeviceId = util.getValue(lines, 'PNPDeviceID', ':').match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);
|
||||
let subDeviceId = null;
|
||||
let memorySize = null;
|
||||
@ -984,7 +984,7 @@ function graphics(callback) {
|
||||
let resolutionX = 0;
|
||||
let resolutionY = 0;
|
||||
if (dsections && dsections.length) {
|
||||
let linesDisplay = dsections[0].split(os.EOL);
|
||||
let linesDisplay = dsections[0].split('\n');
|
||||
vendor = util.getValue(linesDisplay, 'MonitorManufacturer', ':');
|
||||
model = util.getValue(linesDisplay, 'Name', ':');
|
||||
deviceID = util.getValue(linesDisplay, 'PNPDeviceID', ':').replace(/&/g, '&').toLowerCase();
|
||||
@ -1000,10 +1000,10 @@ function graphics(callback) {
|
||||
if (tsections.length === 0 || tsections[i] === undefined) {
|
||||
tsections[i] = 'Unknown';
|
||||
}
|
||||
let linesScreen = ssections[i].split(os.EOL);
|
||||
let linesMonitor = msections[i].split(os.EOL);
|
||||
let linesScreen = ssections[i].split('\n');
|
||||
let linesMonitor = msections[i].split('\n');
|
||||
|
||||
let linesConnection = tsections[i].split(os.EOL);
|
||||
let linesConnection = tsections[i].split('\n');
|
||||
const bitsPerPixel = util.getValue(linesScreen, 'BitsPerPixel');
|
||||
const bounds = util.getValue(linesScreen, 'Bounds').replace('{', '').replace('}', '').split(',');
|
||||
const primary = util.getValue(linesScreen, 'Primary');
|
||||
@ -1057,7 +1057,6 @@ function graphics(callback) {
|
||||
}
|
||||
return displays;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.graphics = graphics;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user