From 278a574b4fbd219ed63ce0355a5767825ca2cd0c Mon Sep 17 00:00:00 2001 From: Julian Freeman Date: Tue, 3 Mar 2026 23:05:17 -0400 Subject: [PATCH] adjust ui --- src/App.vue | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/App.vue b/src/App.vue index a47910d..af59bb3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -43,6 +43,7 @@ const fastState = ref({ const memoryState = ref({ stats: null as MemoryStats | null, isCleaning: false, + cleaningType: null as 'fast' | 'deep' | null, lastFreed: "", isDone: false, }); @@ -377,18 +378,20 @@ async function getMemoryStats() { async function startMemoryClean(deep = false) { if (memoryState.value.isCleaning) return; memoryState.value.isCleaning = true; - memoryState.value.isDone = false; + memoryState.value.cleaningType = deep ? 'deep' : 'fast'; try { const cmd = deep ? "run_deep_memory_clean" : "run_memory_clean"; const freedBytes = await invoke(cmd); memoryState.value.lastFreed = formatItemSize(freedBytes); - memoryState.value.isDone = true; + // 使用弹窗显示结果 + showAlert("优化完成", `已为您释放 ${memoryState.value.lastFreed} 内存空间`, 'success'); await getMemoryStats(); } catch (err) { showAlert("清理失败", String(err), 'error'); } finally { memoryState.value.isCleaning = false; + memoryState.value.cleaningType = null; } } @@ -720,7 +723,7 @@ watch(activeTab, (newTab) => {
- 🌐 + 🌍

扫描完成

@@ -782,7 +785,7 @@ watch(activeTab, (newTab) => {
- 🌐 + 🌍

扫描完成

@@ -978,7 +981,7 @@ watch(activeTab, (newTab) => {

压缩所有进程的内存工作集,释放物理内存,不影响程序运行。

@@ -988,16 +991,11 @@ watch(activeTab, (newTab) => {

强制清空系统备用列表(待机列表),释放更多被缓存的物理空间。

- -
- - 优化完成!已为您释放 {{ memoryState.lastFreed }} 内存空间 -