graphics() added vendor, refresh rate, current resolution

This commit is contained in:
Sebastian Hildebrandt
2019-06-03 21:52:09 +02:00
parent 83f1902a8e
commit 2f61b26f47
7 changed files with 25 additions and 17 deletions
-6
View File
@@ -193,12 +193,6 @@ function dockerContainerInspect(containerID, payload) {
_docker_socket.getInspect(containerID.trim(), data => {
try {
// console.log('========================================================')
// console.log(payload)
// console.log('---------------------------------------------')
// console.log(data)
// console.log('========================================================')
resolve({
id: payload.Id,
name: payload.Name,
+13 -5
View File
@@ -308,9 +308,11 @@ function graphics(callback) {
model_raw = model_raw.substr(0, model_raw.indexOf('0a'));
}
try {
result.model = model_raw.match(/.{1,2}/g).map(function (v) {
return String.fromCharCode(parseInt(v, 16));
}).join('');
if (model_raw.length > 2) {
result.model = model_raw.match(/.{1,2}/g).map(function (v) {
return String.fromCharCode(parseInt(v, 16));
}).join('');
}
} catch (e) {
util.noop();
}
@@ -393,8 +395,8 @@ function graphics(callback) {
const parts1 = lines[i].split('(');
if (parts1 && parts1.length > 1 && parts1[0].indexOf('x') >= 0) {
const resParts = parts1[0].trim().split('x');
currentDisplay.currentResolutionx = util.toInt(resParts[0]);
currentDisplay.currentResolutiony = util.toInt(resParts[1]);
currentDisplay.currentResX = util.toInt(resParts[0]);
currentDisplay.currentResY = util.toInt(resParts[1]);
}
is_current = true;
}
@@ -526,9 +528,15 @@ function graphics(callback) {
if (result.controllers.length === 1 && result.displays.length === 1) {
if (_resolutionx) {
result.displays[0].currentResX = _resolutionx;
if (!result.displays[0].resolutionx) {
result.displays[0].resolutionx = _resolutionx;
}
}
if (_resolutiony) {
result.displays[0].currentResY = _resolutiony;
if (result.displays[0].resolutiony === 0) {
result.displays[0].resolutiony = _resolutiony;
}
}
if (_pixeldepth) {
result.displays[0].pixeldepth = _pixeldepth;