| 4.34.12 |
2020-02-15 |
diff --git a/docs/v4/index.html b/docs/v4/index.html
index 6423484..a7fe94a 100644
--- a/docs/v4/index.html
+++ b/docs/v4/index.html
@@ -170,7 +170,7 @@
systeminformation
Version 4 documentation
- Current Version: 4.34.12
+ Current Version: 4.34.15
diff --git a/lib/docker.js b/lib/docker.js
index 1c2854e..68f235a 100644
--- a/lib/docker.js
+++ b/lib/docker.js
@@ -350,13 +350,18 @@ function dockerContainerStats(containerIDs, callback) {
containerIDsSanitized.__proto__.replace = util.stringReplace;
containerIDsSanitized.__proto__.trim = util.stringTrim;
- const s = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerIDs, true)).trim();
- for (let i = 0; i <= 2000; i++) {
- if (!(s[i] === undefined)) {
- s[i].__proto__.toLowerCase = util.stringToLower;
- const sl = s[i].toLowerCase();
- if (sl && sl[0] && !sl[1]) {
- containerIDsSanitized = containerIDsSanitized + sl[0];
+ containerIDsSanitized = containerIDs;
+ containerIDsSanitized = containerIDsSanitized.trim();
+ if (containerIDsSanitized !== '*') {
+ containerIDsSanitized = '';
+ const s = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerIDs, true)).trim();
+ for (let i = 0; i <= 2000; i++) {
+ if (!(s[i] === undefined)) {
+ s[i].__proto__.toLowerCase = util.stringToLower;
+ const sl = s[i].toLowerCase();
+ if (sl && sl[0] && !sl[1]) {
+ containerIDsSanitized = containerIDsSanitized + sl[0];
+ }
}
}
}
@@ -374,10 +379,15 @@ function dockerContainerStats(containerIDs, callback) {
for (let container of allContainers) {
containerArray.push(container.id);
}
- dockerContainerStats(containerArray.join(',')).then(result => {
+ if (containerArray.length) {
+ dockerContainerStats(containerArray.join(',')).then(result => {
+ if (callback) { callback(result); }
+ resolve(result);
+ });
+ } else {
if (callback) { callback(result); }
resolve(result);
- });
+ }
});
} else {
for (let containerID of containerArray) {
diff --git a/test/si.js b/test/si.js
index c1e85fe..e8f8375 100644
--- a/test/si.js
+++ b/test/si.js
@@ -50,8 +50,8 @@ function test(f) {
else if (f === '5') { si.networkConnections().then(data => { if (data !== null) { resolve({ data, title: 'NET Connections' }); } else { resolve('not_supported'); } }); }
else if (f === '6') { si.dockerInfo().then(data => { if (data !== null) { resolve({ data, title: 'Docker Info' }); } else { resolve('not_supported'); } }); }
else if (f === '7') { si.dockerContainers(true).then(data => { if (data !== null) { resolve({ data, title: 'Docker Containers' }); } else { resolve('not_supported'); } }); }
- else if (f === '8') { si.dockerContainerStats('1').then(data => { if (data !== null) { resolve({ data, title: 'Docker Cont Stats' }); } else { resolve('not_supported'); } }); }
- else if (f === '9') { si.dockerContainerProcesses('1').then(data => { if (data !== null) { resolve({ data, title: 'Docker Cont Processes' }); } else { resolve('not_supported'); } }); }
+ else if (f === '8') { si.dockerContainerStats('*').then(data => { if (data !== null) { resolve({ data, title: 'Docker Cont Stats' }); } else { resolve('not_supported'); } }); }
+ else if (f === '9') { si.dockerContainerProcesses('*').then(data => { if (data !== null) { resolve({ data, title: 'Docker Cont Processes' }); } else { resolve('not_supported'); } }); }
else if (f === '0') { si.dockerAll().then(data => { if (data !== null) { resolve({ data, title: 'Docker All' }); } else { resolve('not_supported'); } }); }
else if (f === ',') { si.getStaticData().then(data => { if (data !== null) { resolve({ data, title: 'All Static Data' }); } else { resolve('not_supported'); } }); }
else if (f === '.') { si.getDynamicData('apache2, postgres, wsearch').then(data => { if (data !== null) { resolve({ data, title: 'All Dynamic Data' }); } else { resolve('not_supported'); } }); }