feat: Add restart support for container compose (#10129)

This commit is contained in:
ssongliu 2025-08-25 16:11:56 +08:00 committed by GitHub
parent ebdc3f05de
commit 0a5b13a418
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 6 deletions

View file

@ -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 {

View file

@ -49,11 +49,13 @@
</el-table-column>
<el-table-column :label="$t('container.composeDirectory')" min-width="80" fix>
<template #default="{ row }">
<el-button type="primary" link @click="toComposeFolder(row)">
<el-icon>
<FolderOpened />
</el-icon>
</el-button>
<el-tooltip :content="row.workdir">
<el-button type="primary" link @click="toComposeFolder(row)">
<el-icon>
<FolderOpened />
</el-icon>
</el-button>
</el-tooltip>
</template>
</el-table-column>
<el-table-column :label="$t('container.containerStatus')" min-width="80" fix>
@ -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) => {