fix: Fix container edit task log abnormalities (#9590)

This commit is contained in:
ssongliu 2025-07-21 18:14:41 +08:00 committed by GitHub
parent 6427337728
commit 117faa952e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 10 deletions

View file

@ -677,7 +677,7 @@ func (u *ContainerService) ContainerUpdate(req dto.ContainerOperate) error {
taskItem.AddSubTask(i18n.GetWithName("ContainerCreate", req.Name), func(t *task.Task) error {
err := client.ContainerRemove(ctx, req.ContainerID, container.RemoveOptions{Force: true})
taskItem.LogWithStatus(i18n.GetMsgByKey("ContainerRemoveOld"), err)
taskItem.LogWithStatus(i18n.GetWithName("ContainerRemoveOld", req.Name), err)
if err != nil {
return err
}
@ -753,7 +753,7 @@ func (u *ContainerService) ContainerUpgrade(req dto.ContainerUpgrade) error {
}
}
err := client.ContainerRemove(ctx, req.Name, container.RemoveOptions{Force: true})
taskItem.LogWithStatus(i18n.GetMsgByKey("ContainerRemoveOld"), err)
taskItem.LogWithStatus(i18n.GetWithName("ContainerRemoveOld", req.Name), err)
if err != nil {
return err
}

View file

@ -4,14 +4,6 @@
back-name="ContainerItem"
:title="isCreate ? $t('container.create') : $t('commons.button.edit') + ' - ' + form.name"
>
<template #prompt>
<el-alert
v-if="!isCreate && isFromApp(form)"
:title="$t('container.containerFromAppHelper')"
:closable="false"
type="error"
/>
</template>
<template #main>
<el-form
ref="formRef"
@ -24,6 +16,13 @@
<el-row type="flex" justify="center" :gutter="20">
<el-col :span="20">
<el-card>
<el-alert
v-if="!isCreate && isFromApp(form)"
:title="$t('container.containerFromAppHelper')"
:closable="false"
type="error"
/>
<el-button v-if="isCreate" type="primary" icon="EditPen" plain @click="toTerminal()">
{{ $t('container.commandInput') }}
</el-button>