From 45ab36db98dd1cdf786f81e3ea69ee5c64c17434 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sat, 25 Nov 2023 01:02:04 +0800 Subject: [PATCH] Fix: dockge cannot be self-managed (#171) --- backend/stack.ts | 14 ++++++-------- frontend/components.d.ts | 1 - 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/backend/stack.ts b/backend/stack.ts index e2873da..bf7657c 100644 --- a/backend/stack.ts +++ b/backend/stack.ts @@ -191,6 +191,7 @@ export class Stack { let stacksDir = server.stacksDir; let stackList : Map; + // Use cached stack list? if (useCacheForManaged && this.managedStackList.size > 0) { stackList = this.managedStackList; } else { @@ -220,22 +221,19 @@ export class Stack { this.managedStackList = new Map(stackList); } - // Also get the list from `docker compose ls --all --format json` + // Get status from docker compose ls let res = childProcess.execSync("docker compose ls --all --format json"); let composeList = JSON.parse(res.toString()); for (let composeStack of composeList) { - - // Skip the dockge stack - // TODO: Could be self managed? - if (composeStack.Name === "dockge") { - continue; - } - let stack = stackList.get(composeStack.Name); // This stack probably is not managed by Dockge, but we still want to show it if (!stack) { + // Skip the dockge stack if it is not managed by Dockge + if (composeStack.Name === "dockge") { + continue; + } stack = new Stack(server, composeStack.Name); stackList.set(composeStack.Name, stack); } diff --git a/frontend/components.d.ts b/frontend/components.d.ts index 783d772..708dd4e 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -12,7 +12,6 @@ declare module 'vue' { ArrayInput: typeof import('./src/components/ArrayInput.vue')['default'] ArraySelect: typeof import('./src/components/ArraySelect.vue')['default'] BDropdown: typeof import('bootstrap-vue-next')['BDropdown'] - BDropdownDivider: typeof import('bootstrap-vue-next')['BDropdownDivider'] BDropdownItem: typeof import('bootstrap-vue-next')['BDropdownItem'] BModal: typeof import('bootstrap-vue-next')['BModal'] Confirm: typeof import('./src/components/Confirm.vue')['default']