From f78534f5292ce63cef745fac18eccf00794b5749 Mon Sep 17 00:00:00 2001 From: Akash Ramaswamy <87078332+akash-ramaswamy@users.noreply.github.com> Date: Fri, 1 Dec 2023 03:34:22 +0530 Subject: [PATCH] feat: can start and stop containers now using the drop down. This feature is not enabled by default. (#2548) --- assets/auto-imports.d.ts | 3 ++ assets/components.d.ts | 3 ++ .../LogViewer/LogActionsToolbar.vue | 44 +++++++++++++++++- assets/composable/containerActions.ts | 45 +++++++++++++++++++ assets/stores/config.ts | 1 + internal/docker/client.go | 17 +++++++ internal/web/container_actions.go | 40 +++++++++++++++++ internal/web/index.go | 1 + internal/web/routes.go | 3 ++ locales/en.yml | 3 ++ main.go | 2 + 11 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 assets/composable/containerActions.ts create mode 100644 internal/web/container_actions.go diff --git a/assets/auto-imports.d.ts b/assets/auto-imports.d.ts index a8c926c1..ae44add2 100644 --- a/assets/auto-imports.d.ts +++ b/assets/auto-imports.d.ts @@ -183,6 +183,7 @@ declare global { const useCloned: typeof import('@vueuse/core')['useCloned'] const useColorMode: typeof import('@vueuse/core')['useColorMode'] const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog'] + const useContainerActions: typeof import('./composable/containerActions')['useContainerActions'] const useContainerContext: typeof import('./composable/containerContext')['useContainerContext'] const useContainerStore: typeof import('./stores/container')['useContainerStore'] const useCounter: typeof import('@vueuse/core')['useCounter'] @@ -533,6 +534,7 @@ declare module 'vue' { readonly useCloned: UnwrapRef readonly useColorMode: UnwrapRef readonly useConfirmDialog: UnwrapRef + readonly useContainerActions: UnwrapRef readonly useContainerContext: UnwrapRef readonly useContainerStore: UnwrapRef readonly useCounter: UnwrapRef @@ -876,6 +878,7 @@ declare module '@vue/runtime-core' { readonly useCloned: UnwrapRef readonly useColorMode: UnwrapRef readonly useConfirmDialog: UnwrapRef + readonly useContainerActions: UnwrapRef readonly useContainerContext: UnwrapRef readonly useContainerStore: UnwrapRef readonly useCounter: UnwrapRef diff --git a/assets/components.d.ts b/assets/components.d.ts index e59f629b..e631d3aa 100644 --- a/assets/components.d.ts +++ b/assets/components.d.ts @@ -12,8 +12,11 @@ declare module 'vue' { 'Carbon:circleSolid': typeof import('~icons/carbon/circle-solid')['default'] 'Carbon:information': typeof import('~icons/carbon/information')['default'] 'Carbon:macShift': typeof import('~icons/carbon/mac-shift')['default'] + 'Carbon:play': typeof import('~icons/carbon/play')['default'] + 'Carbon:restart': typeof import('~icons/carbon/restart')['default'] 'Carbon:star': typeof import('~icons/carbon/star')['default'] 'Carbon:starFilled': typeof import('~icons/carbon/star-filled')['default'] + 'Carbon:stopFilledAlt': typeof import('~icons/carbon/stop-filled-alt')['default'] 'Carbon:warning': typeof import('~icons/carbon/warning')['default'] 'Cil:checkCircle': typeof import('~icons/cil/check-circle')['default'] 'Cil:circle': typeof import('~icons/cil/circle')['default'] diff --git a/assets/components/LogViewer/LogActionsToolbar.vue b/assets/components/LogViewer/LogActionsToolbar.vue index 2e845340..87194b05 100644 --- a/assets/components/LogViewer/LogActionsToolbar.vue +++ b/assets/components/LogViewer/LogActionsToolbar.vue @@ -4,7 +4,7 @@ -