feat: 移除编排删除后跳转 (#6613)
Some checks failed
Build Test / build-linux-binary (push) Failing after -9m35s
Build / SonarCloud (push) Failing after -9m38s
sync2gitee / repo-sync (push) Failing after -9m39s

This commit is contained in:
ssongliu 2024-09-29 10:15:45 +08:00 committed by GitHub
parent f9bdcf8938
commit 2ac9a888a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 13 deletions

View file

@ -268,8 +268,14 @@ func (u *ContainerService) ComposeOperation(req dto.ComposeOperation) error {
_ = composeRepo.DeleteRecord(commonRepo.WithByName(req.Name)) _ = composeRepo.DeleteRecord(commonRepo.WithByName(req.Name))
return nil return nil
} }
if stdout, err := compose.Operate(req.Path, req.Operation); err != nil { if req.Operation == "up" {
return errors.New(string(stdout)) if stdout, err := compose.Up(req.Path); err != nil {
return errors.New(string(stdout))
}
} else {
if stdout, err := compose.Operate(req.Path, req.Operation); err != nil {
return errors.New(string(stdout))
}
} }
global.LOG.Infof("docker-compose %s %s successful", req.Operation, req.Name) global.LOG.Infof("docker-compose %s %s successful", req.Operation, req.Name)
return nil return nil

View file

@ -143,7 +143,6 @@ const dialogContainerLogRef = ref();
const opRef = ref(); const opRef = ref();
const emit = defineEmits<{ (e: 'back'): void }>();
interface DialogProps { interface DialogProps {
createdBy: string; createdBy: string;
name: string; name: string;
@ -283,11 +282,7 @@ const onComposeOperate = async (operation: string) => {
.then(() => { .then(() => {
loading.value = false; loading.value = false;
MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
if (operation === 'down') { search();
emit('back');
} else {
search();
}
}) })
.catch(() => { .catch(() => {
loading.value = false; loading.value = false;

View file

@ -1,7 +1,7 @@
<template> <template>
<div v-loading="loading"> <div v-loading="loading">
<div v-show="isOnDetail"> <div v-show="isOnDetail">
<ComposeDetail @back="backList" ref="composeDetailRef" /> <ComposeDetail ref="composeDetailRef" />
</div> </div>
<el-card v-if="dockerStatus != 'Running'" class="mask-prompt"> <el-card v-if="dockerStatus != 'Running'" class="mask-prompt">
<span>{{ $t('container.serviceUnavailable') }}</span> <span>{{ $t('container.serviceUnavailable') }}</span>
@ -181,10 +181,6 @@ const getContainerStatus = (containers) => {
return i18n.global.t('container.running') + ` (${runningCount}/${totalCount})`; return i18n.global.t('container.running') + ` (${runningCount}/${totalCount})`;
} }
}; };
const backList = async () => {
isOnDetail.value = false;
search();
};
const dialogRef = ref(); const dialogRef = ref();
const onOpenDialog = async () => { const onOpenDialog = async () => {