From 00ffac7210028b334c802b98ece7114723ad57b7 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 4 Dec 2023 22:12:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BC=93=E5=AD=98=E6=B8=85=E7=90=86?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E4=BD=8D=E7=BD=AE=E8=B0=83=E6=95=B4=20(#3172?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/routers/modules/toolbox.ts | 10 + frontend/src/views/setting/panel/index.vue | 27 -- .../panel => toolbox}/clean/index.vue | 403 ++++++++---------- frontend/src/views/toolbox/index.vue | 4 + 4 files changed, 202 insertions(+), 242 deletions(-) rename frontend/src/views/{setting/panel => toolbox}/clean/index.vue (50%) diff --git a/frontend/src/routers/modules/toolbox.ts b/frontend/src/routers/modules/toolbox.ts index 3d20830b1..25a78241f 100644 --- a/frontend/src/routers/modules/toolbox.ts +++ b/frontend/src/routers/modules/toolbox.ts @@ -47,6 +47,16 @@ const toolboxRouter = { requiresAuth: false, }, }, + { + path: 'clean', + name: 'Clean', + component: () => import('@/views/toolbox/clean/index.vue'), + hidden: true, + meta: { + activeMenu: '/toolbox', + requiresAuth: false, + }, + }, ], }, ], diff --git a/frontend/src/views/setting/panel/index.vue b/frontend/src/views/setting/panel/index.vue index 8580c1321..e9a783369 100644 --- a/frontend/src/views/setting/panel/index.vue +++ b/frontend/src/views/setting/panel/index.vue @@ -84,15 +84,6 @@ - - - - - {{ $t('commons.button.set') }} - - - - @@ -122,7 +113,6 @@ - @@ -140,7 +130,6 @@ import Timeout from '@/views/setting/panel/timeout/index.vue'; import PanelName from '@/views/setting/panel/name/index.vue'; import SystemIP from '@/views/setting/panel/systemip/index.vue'; import Network from '@/views/setting/panel/default-network/index.vue'; -import Clean from '@/views/setting/panel/clean/index.vue'; const loading = ref(false); const i18n = useI18n(); @@ -163,10 +152,6 @@ const form = reactive({ complexityVerification: '', defaultNetwork: '', defaultNetworkVal: '', - - lastCleanTime: '', - lastCleanSize: '', - lastCleanData: '', }); const show = ref(); @@ -177,7 +162,6 @@ const panelNameRef = ref(); const systemIPRef = ref(); const timeoutRef = ref(); const networkRef = ref(); -const cleanRef = ref(); const unset = ref(i18n.t('setting.unSetting')); const search = async () => { @@ -195,10 +179,6 @@ const search = async () => { form.complexityVerification = res.data.complexityVerification; form.defaultNetwork = res.data.defaultNetwork; form.defaultNetworkVal = res.data.defaultNetwork === 'all' ? i18n.t('commons.table.all') : res.data.defaultNetwork; - - form.lastCleanTime = res.data.lastCleanTime; - form.lastCleanSize = res.data.lastCleanSize; - form.lastCleanData = res.data.lastCleanData; }; const onChangePassword = () => { @@ -219,13 +199,6 @@ const onChangeSystemIP = () => { const onChangeNetwork = () => { networkRef.value.acceptParams({ defaultNetwork: form.defaultNetwork }); }; -const onClean = () => { - cleanRef.value.acceptParams({ - lastCleanTime: form.lastCleanTime, - lastCleanSize: form.lastCleanSize, - lastCleanData: form.lastCleanData, - }); -}; const onSave = async (key: string, val: any) => { loading.value = true; diff --git a/frontend/src/views/setting/panel/clean/index.vue b/frontend/src/views/toolbox/clean/index.vue similarity index 50% rename from frontend/src/views/setting/panel/clean/index.vue rename to frontend/src/views/toolbox/clean/index.vue index f4b58af90..4466ec3d6 100644 --- a/frontend/src/views/setting/panel/clean/index.vue +++ b/frontend/src/views/toolbox/clean/index.vue @@ -1,19 +1,26 @@ - - - - + + + + + + + {{ $t('clean.scan') }} + + + - - - + + + + - + {{ $t('clean.lastCleanTime', [form.lastCleanTime || '-']) }} - + {{ $t('clean.lastCleanHelper', [ form.lastCleanData || '-', @@ -22,16 +29,75 @@ }} - - - {{ $t('clean.scan') }} - + + + + + + + + + + {{ $t('clean.system') }} + + + {{ $t('clean.systemHelper') }} + + + + + + + + + + + + {{ $t('clean.upload') }} + + + {{ $t('clean.uploadHelper') }} + + + + + + + + + + + + {{ $t('clean.download') }} + + + {{ $t('clean.downloadHelper') }} + + + + + + + + + + + + {{ $t('clean.systemLog') }} + + + + {{ $t('clean.systemLogHelper') }} + + + + - {{ $t('clean.cleanSuccessful') }} + {{ $t('clean.cleanSuccessful') }} - + {{ $t('clean.currentCleanHelper', [ form.lastCleanData, @@ -40,80 +106,11 @@ }} - - - {{ $t('clean.reScan') }} - - - - - - - - - - - - - {{ $t('clean.system') }} - - - {{ $t('clean.systemHelper') }} - - - - - - - - - - - - {{ $t('clean.upload') }} - - - {{ $t('clean.uploadHelper') }} - - - - - - - - - - - - {{ $t('clean.download') }} - - - {{ $t('clean.downloadHelper') }} - - - - - - - - - - - - {{ $t('clean.systemLog') }} - - - - {{ $t('clean.systemLogHelper') }} - - - - - + {{ $t('clean.totalScan') }} {{ computeSize(totalSize) }} @@ -127,126 +124,116 @@ - - - - - - - {{ load18n(data.label) }} - - - {{ computeSize(data.size) }} - - - {{ loadTag(node, data) }} - - - - - - - - - {{ load18n(data.label) }} - - - {{ computeSize(data.size) }} - - - {{ loadTag(node, data) }} - - - - - - - - - {{ load18n(data.label) }} - - - {{ computeSize(data.size) }} - - - {{ loadTag(node, data) }} - - - - - - - - - {{ load18n(data.label) }} - - - {{ computeSize(data.size) }} - - - {{ loadTag(node, data) }} - - - - - - + + + + + + {{ load18n(data.label) }} + + + {{ computeSize(data.size) }} + + + {{ loadTag(node, data) }} + + + + + + + + + {{ load18n(data.label) }} + + + {{ computeSize(data.size) }} + + + {{ loadTag(node, data) }} + + + + + + + + + {{ load18n(data.label) }} + + + {{ computeSize(data.size) }} + + + {{ loadTag(node, data) }} + + + + + + + + + {{ load18n(data.label) }} + + + {{ computeSize(data.size) }} + + + {{ loadTag(node, data) }} + + + + + - - - - {{ $t('commons.button.cancel') }} - - + @@ -546,7 +519,7 @@ defineExpose({ transform: scale(1.2); } .e-card { - margin-top: 30px; + margin-top: 20px; cursor: pointer; border: var(--panel-border) !important; &:hover { diff --git a/frontend/src/views/toolbox/index.vue b/frontend/src/views/toolbox/index.vue index 3b6eadfb8..e4bcdb40d 100644 --- a/frontend/src/views/toolbox/index.vue +++ b/frontend/src/views/toolbox/index.vue @@ -15,6 +15,10 @@ const buttons = [ label: i18n.global.t('toolbox.device.toolbox'), path: '/toolbox/device', }, + { + label: i18n.global.t('setting.diskClean'), + path: '/toolbox/clean', + }, { label: i18n.global.t('menu.supervisor'), path: '/toolbox/supervisor',