From 0b9017ff1b3ba08dfb701e68110b0e6340268e25 Mon Sep 17 00:00:00 2001 From: Net Date: Wed, 24 Jul 2024 17:27:46 +0700 Subject: [PATCH 1/6] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20=E0=B8=94?= =?UTF-8?q?=E0=B8=B6=E0=B8=87=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9?= =?UTF-8?q?=E0=B8=A5=E0=B8=8A=E0=B9=89=E0=B8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/04_system/stores/main.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/04_system/stores/main.ts b/src/modules/04_system/stores/main.ts index ff7d04b4..c1f1a083 100644 --- a/src/modules/04_system/stores/main.ts +++ b/src/modules/04_system/stores/main.ts @@ -109,8 +109,8 @@ export const useDataStore = defineStore("systemStore", () => { .then(async (res) => { backupRunTotal.value = res.data.length; - if (backupRunTotal.value === 0 && prevBackupRunTotal.value !== 0) { - cb(); + if (backupRunTotal.value === 0) { + if (prevBackupRunTotal.value !== -1) cb(); prevBackupRunTotal.value = backupRunTotal.value; return; } @@ -147,7 +147,7 @@ export const useDataStore = defineStore("systemStore", () => { .get(config.API.backup + "/restore-running-list") .then(async (res) => { restoreRunTotal.value = res.data.length; - if (restoreRunTotal.value === 0 && prevRestoreRunTotal.value !== 0) { + if (restoreRunTotal.value === 0) { cb(); prevRestoreRunTotal.value = restoreRunTotal.value; return; From f9582fa712831b1d4eeccb5a67b5e9ff8f5078ab Mon Sep 17 00:00:00 2001 From: Net Date: Wed, 24 Jul 2024 17:27:46 +0700 Subject: [PATCH 2/6] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20ui=20?= =?UTF-8?q?=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87=E0=B8=AA=E0=B8=96=E0=B8=B2?= =?UTF-8?q?=E0=B8=99=E0=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/04_system/components/cardBackupRestore.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/04_system/components/cardBackupRestore.vue b/src/modules/04_system/components/cardBackupRestore.vue index 697d5cbe..360ef576 100644 --- a/src/modules/04_system/components/cardBackupRestore.vue +++ b/src/modules/04_system/components/cardBackupRestore.vue @@ -214,9 +214,9 @@ function onRestore(name: string) { ? col.value : col.value === "สำเร็จ" ? "สำเร็จ" - : i === 2 || i === 3 - ? getSize(col.value) - : "" + : // : i === 2 || i === 3 + // ? getSize(col.value) + "" }} Date: Wed, 24 Jul 2024 17:39:10 +0700 Subject: [PATCH 3/6] =?UTF-8?q?=E0=B8=9B=E0=B8=B4=E0=B8=94=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87=E0=B8=82?= =?UTF-8?q?=E0=B8=AD=E0=B8=87=20=E0=B8=9B=E0=B9=88=E0=B8=B8=E0=B8=A1?= =?UTF-8?q?=E0=B8=95=E0=B8=AD=E0=B8=99=E0=B9=80=E0=B8=81=E0=B8=B4=E0=B8=94?= =?UTF-8?q?=E0=B8=AA=E0=B8=96=E0=B8=B2=E0=B8=99=E0=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/04_system/components/cardBackupRestore.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/04_system/components/cardBackupRestore.vue b/src/modules/04_system/components/cardBackupRestore.vue index 360ef576..af94403a 100644 --- a/src/modules/04_system/components/cardBackupRestore.vue +++ b/src/modules/04_system/components/cardBackupRestore.vue @@ -231,6 +231,7 @@ function onRestore(name: string) { Date: Wed, 24 Jul 2024 17:39:29 +0700 Subject: [PATCH 4/6] return prevBackupRunTotal prevRestoreRunTotal, --- src/modules/04_system/stores/main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/04_system/stores/main.ts b/src/modules/04_system/stores/main.ts index c1f1a083..8445e1bb 100644 --- a/src/modules/04_system/stores/main.ts +++ b/src/modules/04_system/stores/main.ts @@ -324,9 +324,13 @@ export const useDataStore = defineStore("systemStore", () => { return { dataBackUp, + backupRunTotal, restoreRunTotal, + prevBackupRunTotal, + prevRestoreRunTotal, + dataSchedule, fetchListBackup, From 4f05f1164d0b2b29ec87f968a531a5ff0378fc3a Mon Sep 17 00:00:00 2001 From: Net Date: Wed, 24 Jul 2024 17:40:00 +0700 Subject: [PATCH 5/6] =?UTF-8?q?=E0=B8=95=E0=B8=B1=E0=B9=89=E0=B8=87?= =?UTF-8?q?=E0=B8=84=E0=B9=88=E0=B8=B2=20onMounted=20=E0=B8=82=E0=B8=AD?= =?UTF-8?q?=E0=B8=87=20prevBackupRunTotal=20=E0=B9=81=E0=B8=A5=E0=B8=B0=20?= =?UTF-8?q?=20prevRestoreRunTotal=20=3D=20-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/04_system/views/MainView.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/04_system/views/MainView.vue b/src/modules/04_system/views/MainView.vue index 63f196cf..a0cfa71c 100644 --- a/src/modules/04_system/views/MainView.vue +++ b/src/modules/04_system/views/MainView.vue @@ -13,12 +13,17 @@ import Card from "@/modules/04_system/components/cardBackupRestore.vue"; import CardAutoBackup from "@/modules/04_system/components/cardAutoBackup.vue"; import { useDataStore } from "@/modules/04_system/stores/main"; +import { storeToRefs } from "pinia"; const { fetchListBackup, backupRunningList, restoreRunningList } = useDataStore(); + /** * ตัวแปร */ +const storeData = useDataStore(); +const { prevBackupRunTotal, prevRestoreRunTotal } = storeToRefs(storeData); + const tab = ref("backup"); const tabItems = ref([ { name: "backup", label: "Backup & Restore", icon: "mdi-database" }, @@ -26,6 +31,8 @@ const tabItems = ref([ ]); onMounted(async () => { + prevBackupRunTotal.value = -1; + prevRestoreRunTotal.value = -1; await fetchListBackup(); await backupRunningList(fetchListBackup); await restoreRunningList(() => {}); From 8bac673d3f5a288d36099f6cf882436b492d348f Mon Sep 17 00:00:00 2001 From: Net Date: Wed, 24 Jul 2024 18:03:13 +0700 Subject: [PATCH 6/6] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=9A=E0=B8=82=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=20=20backup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/04_system/stores/main.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/04_system/stores/main.ts b/src/modules/04_system/stores/main.ts index 8445e1bb..16fae9f2 100644 --- a/src/modules/04_system/stores/main.ts +++ b/src/modules/04_system/stores/main.ts @@ -76,7 +76,12 @@ export const useDataStore = defineStore("systemStore", () => { data: { name: filename }, }) .then(async (res) => { - await fetchListBackup(); + if (res.status < 400) { + dataBackUp.value = dataBackUp.value.filter((item) => { + if (item.name !== filename) return true; + return false; + }); + } }) .finally(() => { hideLoader();