From f37d14b8c4c761ea26487ff886ef4e0b4c01091c Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Thu, 22 Jun 2023 21:27:44 +0200 Subject: [PATCH] graphics() fixed parsing (mac OS) --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 2 +- lib/docker.js | 4 ++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c943ce..9cce88c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | ------- | ---------- | --------------------------------------------------------------------------------------------------- | +| 5.18.4 | 2023-06-22 | `graphics()` fixed parsing (mac OS) | | 5.18.3 | 2023-06-09 | `tests` improved key handling, updated docs | | 5.18.2 | 2023-06-08 | `fsSize()` improved error handling (linux alpine) | | 5.18.1 | 2023-06-07 | `networkInterfaces()` cleaned up testVirtualNic | diff --git a/docs/history.html b/docs/history.html index 4405cd0..3f0c5dd 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + 5.18.4 + 2023-06-22 + graphics() fixed parsing (mac OS) + 5.18.3 2023-06-09 diff --git a/docs/index.html b/docs/index.html index e7cf644..02660d9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.18.3
+
New Version: 5.18.4
diff --git a/lib/docker.js b/lib/docker.js index 805ee9f..c7b4efc 100644 --- a/lib/docker.js +++ b/lib/docker.js @@ -484,7 +484,7 @@ function dockerContainerStats(containerIDs, callback) { containerArray = []; dockerContainers().then(allContainers => { for (let container of allContainers) { - containerArray.push(container.id); + containerArray.push(container.id.substring(0, 12)); } if (containerArray.length) { dockerContainerStats(containerArray.join(',')).then(result => { @@ -555,8 +555,8 @@ function dockerContainerStatsSingle(containerID) { _docker_socket.getStats(containerID, data => { try { let stats = data; - if (!stats.message) { + if (data.id) { result.id = data.id; } result.memUsage = (stats.memory_stats && stats.memory_stats.usage ? stats.memory_stats.usage : 0); result.memLimit = (stats.memory_stats && stats.memory_stats.limit ? stats.memory_stats.limit : 0); result.memPercent = (stats.memory_stats && stats.memory_stats.usage && stats.memory_stats.limit ? stats.memory_stats.usage / stats.memory_stats.limit * 100.0 : 0);