dockerContainerStats() fixed parameter *
This commit is contained in:
+19
-9
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user