fix: Fix refresh issue during compose creation (#11482)

Refs #11463
This commit is contained in:
ssongliu 2025-12-26 21:55:03 +08:00 committed by GitHub
parent ffadc6721b
commit e8059d3676
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 6 deletions

View file

@ -16,7 +16,7 @@
<template #rightToolBar>
<TableSearch @search="search()" v-model:searchName="searchName" />
<TableRefresh @search="search()" />
<TableSetting title="container-refresh" @search="search()" />
<TableSetting title="container-refresh" @search="refresh()" />
</template>
<template #main>
<el-row v-if="data.length > 0 || isOnCreate" :gutter="20" class="row-box">
@ -475,6 +475,20 @@ const loadTableHeight = () => {
}
};
const refresh = async () => {
if (!isActive.value || !isExist.value) {
return;
}
let params = {
info: searchName.value,
page: 1,
pageSize: 100,
};
await searchCompose(params).then((res) => {
data.value = res.data.items || [];
});
};
const search = async (withRefreshDetail?: boolean) => {
if (!isActive.value || !isExist.value) {
return;
@ -484,7 +498,6 @@ const search = async (withRefreshDetail?: boolean) => {
page: 1,
pageSize: 100,
};
isOnCreate.value = false;
loading.value = true;
await searchCompose(params)
.then((res) => {

View file

@ -649,7 +649,7 @@ const onTerminal = (row: any) => {
};
const onInspect = async (row: any) => {
const res = await inspect({ id: row.containerID, type: 'container' });
const res = await inspect({ id: row.containerID, type: 'container', detail: '' });
containerInspectRef.value!.acceptParams({ data: res.data, ports: row.ports });
};

View file

@ -252,7 +252,7 @@ const changePinned = (row: any, isPinned: boolean) => {
};
const onInspect = async (id: string) => {
const res = await inspect({ id: id, type: 'image' });
const res = await inspect({ id: id, type: 'image', detail: '' });
let detailInfo = JSON.stringify(JSON.parse(res.data), null, 2);
let param = {
header: i18n.global.t('commons.button.view'),

View file

@ -215,7 +215,7 @@ const batchDelete = async (row: Container.NetworkInfo | null) => {
};
const onInspect = async (id: string) => {
const res = await inspect({ id: id, type: 'network' });
const res = await inspect({ id: id, type: 'network', detail: '' });
let networkData = JSON.parse(res.data);
detailDrawerRef.value!.acceptParams({ data: networkData });
};

View file

@ -190,7 +190,7 @@ const search = async () => {
};
const onInspect = async (id: string) => {
const res = await inspect({ id: id, type: 'volume' });
const res = await inspect({ id: id, type: 'volume', detail: '' });
let detailInfo = JSON.stringify(JSON.parse(res.data), null, 2);
let param = {
header: i18n.global.t('commons.button.view'),