From 0690debf6c1bab7472468c742f9b15639f904c20 Mon Sep 17 00:00:00 2001 From: "web@ppanel" Date: Mon, 29 Dec 2025 09:02:02 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Refactor=20update=20dialo?= =?UTF-8?q?g=20logic=20in=20SystemVersionCard=20for=20better=20clarity=20a?= =?UTF-8?q?nd=20handling=20of=20update=20states?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/system-version-card.tsx | 198 +++++++++--------- 1 file changed, 100 insertions(+), 98 deletions(-) diff --git a/apps/admin/src/sections/dashboard/components/system-version-card.tsx b/apps/admin/src/sections/dashboard/components/system-version-card.tsx index 4a8cfe2..0b1e527 100644 --- a/apps/admin/src/sections/dashboard/components/system-version-card.tsx +++ b/apps/admin/src/sections/dashboard/components/system-version-card.tsx @@ -80,6 +80,7 @@ export default function SystemVersionCard() { staleTime: 0, retry: 1, }); + console.log(webVersionInfo); const updateServerMutation = useMutation({ mutationFn: async (serviceName: string) => { @@ -188,52 +189,52 @@ export default function SystemVersionCard() {
V{packageJson.version} - {hasWebNewVersion && webVersionInfo && ( - - - + + + + + {t("confirmUpdate", "Confirm Update")} + + + {webVersionInfo + ? t( + "updateWebDescription", + "Are you sure you want to update the web version from V{{current}} to V{{latest}}?", + { + current: packageJson.version, + latest: webVersionInfo.latest_version, + } + ) + : t( + "updateDescription", + "Are you sure you want to update?" + )} + + + + {t("cancel", "Cancel")} + - - - - - {t("confirmUpdate", "Confirm Update")} - - - {t( - "updateWebDescription", - "Are you sure you want to update the web version from V{{current}} to V{{latest}}?", - { - current: packageJson.version, - latest: webVersionInfo.latest_version, - } - )} - - - - - {t("cancel", "Cancel")} - - - - - - )} + + +
@@ -251,62 +252,63 @@ export default function SystemVersionCard() { serverVersionInfo?.current_version || "1.0.0"} - {hasServerNewVersion && serverVersionInfo && moduleConfig && ( - - + + + + + + + + {t("confirmUpdate", "Confirm Update")} + + + {serverVersionInfo && moduleConfig + ? t( + "updateServerDescription", + "Are you sure you want to update the server version from V{{current}} to V{{latest}}?", + { + current: + moduleConfig.service_version || + serverVersionInfo.current_version, + latest: serverVersionInfo.latest_version, + } + ) + : t( + "updateDescription", + "Are you sure you want to update?" + )} + + + + {t("cancel", "Cancel")} - - - - - {t("confirmUpdate", "Confirm Update")} - - - {t( - "updateServerDescription", - "Are you sure you want to update the server version from V{{current}} to V{{latest}}?", - { - current: - moduleConfig.service_version || - serverVersionInfo.current_version, - latest: serverVersionInfo.latest_version, - } - )} - - - - - {t("cancel", "Cancel")} - - - - - - )} + + +