mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-09 15:06:37 +08:00
feat: 移除编排删除后跳转 (#6613)
This commit is contained in:
parent
f9bdcf8938
commit
2ac9a888a8
3 changed files with 10 additions and 13 deletions
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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 () => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue