From fa1087132f335d8aeadd0e608c4688195cd15191 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Mon, 25 Aug 2025 14:58:40 +0800 Subject: [PATCH] fix: Add restart support for container compose --- agent/app/dto/container.go | 2 +- frontend/src/views/container/compose/index.vue | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/agent/app/dto/container.go b/agent/app/dto/container.go index e6d9f8188a5b..5f654ddb969d 100644 --- a/agent/app/dto/container.go +++ b/agent/app/dto/container.go @@ -258,7 +258,7 @@ type ComposeCreate struct { type ComposeOperation struct { Name string `json:"name" validate:"required"` Path string `json:"path"` - Operation string `json:"operation" validate:"required,oneof=up start stop down delete"` + Operation string `json:"operation" validate:"required,oneof=up start restart stop down delete"` WithFile bool `json:"withFile"` } type ComposeUpdate struct { diff --git a/frontend/src/views/container/compose/index.vue b/frontend/src/views/container/compose/index.vue index bb2479d5b75a..477865b07c8e 100644 --- a/frontend/src/views/container/compose/index.vue +++ b/frontend/src/views/container/compose/index.vue @@ -49,11 +49,13 @@ @@ -251,6 +253,12 @@ const buttons = [ onComposeOperate('stop', row); }, }, + { + label: i18n.global.t('commons.operate.restart'), + click: (row: Container.ComposeInfo) => { + onComposeOperate('restart', row); + }, + }, { label: i18n.global.t('commons.operate.delete'), click: (row: Container.ComposeInfo) => {