From 7cfcba29a6b8dac54724debbc6256722d194d2d8 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sun, 29 Jun 2025 21:55:13 +0800 Subject: [PATCH] feat: add loading state for dashboard update process --- .../src/layouts/full/vertical-header/VerticalHeader.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue index 22ac90006..1612afcb8 100644 --- a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue +++ b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue @@ -29,7 +29,7 @@ let dashboardCurrentVersion = ref(''); let version = ref(''); let releases = ref([]); let devCommits = ref([]); - +let updatingDashboardLoading = ref(false); let installLoading = ref(false); let tab = ref(0); @@ -217,6 +217,7 @@ function switchVersion(version: string) { } function updateDashboard() { + updatingDashboardLoading.value = true; updateStatus.value = t('core.header.updateDialog.status.updating'); axios.post('/api/update/dashboard') .then((res) => { @@ -230,7 +231,9 @@ function updateDashboard() { .catch((err) => { console.log(err); updateStatus.value = err - }); + }).finally(() => { + updatingDashboardLoading.value = false; + }); } function toggleDarkMode() { @@ -416,7 +419,7 @@ commonStore.getStartTime(); + :disabled="!dashboardHasNewVersion" :loading="updatingDashboardLoading"> {{ t('core.header.updateDialog.dashboardUpdate.downloadAndUpdate') }}