* 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
()
| 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 |
no test coverage detected