MCPcopy
hub / github.com/louislam/dockge / getStatusList

Method getStatusList

backend/stack.ts:338–356  ·  view source on GitHub ↗

* Get the status list, it will be used to update the status of the stacks * Not all status will be returned, only the stack that is deployed or created to `docker compose` will be returned

()

Source from the content-addressed store, hash-verified

336 * Not all status will be returned, only the stack that is deployed or created to `docker compose` will be returned
337 */
338 static async getStatusList() : Promise<Map<string, number>> {
339 let statusList = new Map<string, number>();
340
341 let res = await childProcessAsync.spawn("docker", [ "compose", "ls", "--all", "--format", "json" ], {
342 encoding: "utf-8",
343 });
344
345 if (!res.stdout) {
346 return statusList;
347 }
348
349 let composeList = JSON.parse(res.stdout.toString());
350
351 for (let composeStack of composeList) {
352 statusList.set(composeStack.Name, this.statusConvert(composeStack.Status));
353 }
354
355 return statusList;
356 }
357
358 /**
359 * Convert the status string from `docker compose ls` to the status number

Callers 1

updateStatusMethod · 0.80

Calls 2

statusConvertMethod · 0.95
setMethod · 0.80

Tested by

no test coverage detected