mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-08 01:20:07 +08:00
fix: 解决容器编辑失败时未更新容器 ID 的问题 (#2522)
This commit is contained in:
parent
0252a30f05
commit
cc6873c941
@ -1,5 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-drawer v-model="drawerVisible" :destroy-on-close="true" :close-on-click-modal="false" size="50%">
|
<el-drawer
|
||||||
|
v-model="drawerVisible"
|
||||||
|
@close="handleClose"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
size="50%"
|
||||||
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<DrawerHeader
|
<DrawerHeader
|
||||||
:header="title"
|
:header="title"
|
||||||
@ -259,6 +265,7 @@ import {
|
|||||||
updateContainer,
|
updateContainer,
|
||||||
loadResourceLimit,
|
loadResourceLimit,
|
||||||
listNetwork,
|
listNetwork,
|
||||||
|
searchContainer,
|
||||||
} from '@/api/modules/container';
|
} from '@/api/modules/container';
|
||||||
import { Container } from '@/api/interface/container';
|
import { Container } from '@/api/interface/container';
|
||||||
import { MsgError, MsgSuccess } from '@/utils/message';
|
import { MsgError, MsgSuccess } from '@/utils/message';
|
||||||
@ -471,6 +478,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||||||
drawerVisible.value = false;
|
drawerVisible.value = false;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
updateContainerID();
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
@ -481,6 +489,23 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const updateContainerID = async () => {
|
||||||
|
let params = {
|
||||||
|
page: 1,
|
||||||
|
pageSize: 1,
|
||||||
|
name: dialogData.value.rowData.name,
|
||||||
|
filters: '',
|
||||||
|
orderBy: 'created_at',
|
||||||
|
order: 'null',
|
||||||
|
};
|
||||||
|
await searchContainer(params).then((res) => {
|
||||||
|
if (res.data.items?.length === 1) {
|
||||||
|
dialogData.value.rowData.containerID = res.data.items[0].containerID;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const checkPortValid = () => {
|
const checkPortValid = () => {
|
||||||
if (dialogData.value.rowData!.exposedPorts.length === 0) {
|
if (dialogData.value.rowData!.exposedPorts.length === 0) {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user