From 6fad85e957ccd2e397c5ca6c5a79bc75b80e7e0f Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 24 Jun 2024 09:13:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat=EF=BC=9A=E4=BB=AA=E8=A1=A8=E7=9B=98?= =?UTF-8?q?=E4=B8=8D=E6=B4=BB=E8=B7=83=E6=97=B6=E4=B8=8D=E5=88=B7=E6=96=B0?= =?UTF-8?q?=20&&=20=E7=BD=91=E7=9B=98=E6=95=B4=E7=90=86=E8=81=94=E5=8A=A8?= =?UTF-8?q?=E5=88=AE=E5=89=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/dialog/ReorganizeDialog.vue | 2 +- src/components/misc/DashboardElement.vue | 14 ++++++++++---- src/pages/dashboard.vue | 15 ++++++++++++++- src/views/dashboard/AnalyticsCpu.vue | 10 ++++++++++ src/views/dashboard/AnalyticsMemory.vue | 10 ++++++++++ src/views/dashboard/AnalyticsScheduler.vue | 12 ++++++++++++ src/views/dashboard/AnalyticsSpeed.vue | 13 +++++++++++++ 8 files changed, 71 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index dca5d6bb..7c86d710 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moviepilot", - "version": "1.9.8", + "version": "1.9.8-1", "private": true, "bin": "dist/service.js", "scripts": { diff --git a/src/components/dialog/ReorganizeDialog.vue b/src/components/dialog/ReorganizeDialog.vue index 3574d78b..89f17018 100644 --- a/src/components/dialog/ReorganizeDialog.vue +++ b/src/components/dialog/ReorganizeDialog.vue @@ -350,7 +350,7 @@ onMounted(() => { - + , // 刷新状态 refreshStatus: Boolean, + // 是否允许刷新数据 + allowRefresh: { + type: Boolean, + default: true, + }, }) const emit = defineEmits(['update:refreshStatus']) @@ -32,10 +38,10 @@ onUnmounted(() => { - - - - + + + + diff --git a/src/pages/dashboard.vue b/src/pages/dashboard.vue index 577c7d62..3683bd77 100644 --- a/src/pages/dashboard.vue +++ b/src/pages/dashboard.vue @@ -19,6 +19,9 @@ const superUser = store.state.auth.superUser // 是否拉升高度 const isElevated = ref(true) +// 是否发送请求的总开关 +const isRequest = ref(true) + // 计算属性,控制是否拉升高度 const elevatedConf = controlledComputed( () => isElevated.value, @@ -269,7 +272,8 @@ async function getPluginDashboard(id: string, key: string) { if ( res.attrs?.refresh && pluginDashboardRefreshStatus.value[pluginDashboardId] && - enableConfig.value[pluginDashboardId] + enableConfig.value[pluginDashboardId] && + isRequest.value ) { // 清除之前的定时器 if (refreshTimers.value[pluginDashboardId]) { @@ -298,6 +302,14 @@ onBeforeMount(async () => { await loadDashboardConfig() getPluginDashboardMeta() }) + +onActivated(async () => { + isRequest.value = true +}) + +onDeactivated(() => { + isRequest.value = false +})