From 3e489cf178a510308b1fa344d1e10b93f193192f Mon Sep 17 00:00:00 2001 From: HynoR <20227709+HynoR@users.noreply.github.com> Date: Mon, 8 Dec 2025 13:28:17 +0800 Subject: [PATCH] fix: Update compose operation handling to ensure correct path usage and detail loading after operations --- .../src/views/container/compose/index.vue | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/container/compose/index.vue b/frontend/src/views/container/compose/index.vue index 8d768f6976db..e7c034ea5cd2 100644 --- a/frontend/src/views/container/compose/index.vue +++ b/frontend/src/views/container/compose/index.vue @@ -441,17 +441,20 @@ const handleComposeOperate = async (operation: 'up' | 'stop' | 'restart', row: a loading.value = true; const params = { name: row.name, - path: currentCompose.value.path, + path: row.path, operation: operation, withFile: false, force: false, }; await composeOperator(params) - .then(() => { + .then(async () => { MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); - search(); - if (row.name === currentCompose.value?.name) { - loadDetail(currentCompose.value, true); + await search(); + if (currentCompose.value) { + const updated = data.value.find((item) => item.name === currentCompose.value.name); + if (updated) { + await loadDetail(updated, true); + } } }) .finally(() => { @@ -480,7 +483,13 @@ const onSubmitEdit = async () => { await composeUpdate(param) .then(async () => { MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); - await loadDetail(currentCompose.value, true); + await search(); + if (currentCompose.value) { + const updated = data.value.find((item) => item.name === currentCompose.value.name); + if (updated) { + await loadDetail(updated, true); + } + } }) .finally(() => { loading.value = false;