diff --git a/src/pages/OverviewPage.tsx b/src/pages/OverviewPage.tsx index e2bebb5..88af33c 100644 --- a/src/pages/OverviewPage.tsx +++ b/src/pages/OverviewPage.tsx @@ -104,11 +104,13 @@ export function OverviewPage({ : 0), 0, ); - // 智能扫描 lives on the 空间清理 page now; the workspaces are app-level so - // kicking both stages from here simply continues on that page. It uses the - // default deep-scan settings — tweak them there and re-scan if needed. + // 智能扫描 is an entry point, not a resident process: the moment it is + // pressed we hand the page over to 空间清理 and launch both scan stages + // there (SpacePage owns the settings — age threshold, auto-discovery). + // A finished scan keeps the button as a shortcut back to the results. const smartScan = () => { - if (!scanned) { + onNavigate("space"); + if (!scanned && !scanning) { void cleanup.runScan().then(() => purge.runScan({ // Empty = engine auto-discovery of project containers. @@ -118,7 +120,6 @@ export function OverviewPage({ }), ); } - onNavigate("space"); }; const hardware = bootstrap.hardwareInfo; @@ -174,19 +175,6 @@ export function OverviewPage({ "One safe scan for clutter, storage and everyday performance.", "一次安全扫描,整理垃圾、空间与日常性能。", )} - actions={ - - } />
@@ -315,65 +303,70 @@ export function OverviewPage({
) : null} + {/* 指标行 30% / 42% / 28%:处理器+内存共用一框上下分布;存储每盘 + 一行;日常维护三入口竖排放右列,与左两卡等高。独立的「日常维护」 + 区块随此改版取消。 */}
-
-
- - - -
- {t("Processor", "处理器")} - - {snapshot - ? `${snapshot.cpu.physical_cores} ${t("cores", "核")} / ${snapshot.cpu.logical_cores} ${t("threads", "线程")}` - : t("Sampling…", "正在采样…")} +
+
+
+ + +
+ {t("Processor", "处理器")} + + {snapshot + ? `${snapshot.cpu.physical_cores} ${t("cores", "核")} / ${snapshot.cpu.logical_cores} ${t("threads", "线程")}` + : t("Sampling…", "正在采样…")} + +
+ {Math.round(snapshot?.cpu.total ?? 0)}%
- {Math.round(snapshot?.cpu.total ?? 0)}% + + + {snapshot?.cpu.brand || t("Processor details unavailable", "暂无处理器信息")} +
- - - {snapshot?.cpu.brand || t("Processor details unavailable", "暂无处理器信息")} - -
-
-
- - - -
- {t("Memory", "内存")} - - {snapshot - ? `${formatMemory(snapshot.memory.used)} / ${formatMemory(memoryInstalled)}` - : t("Sampling…", "正在采样…")} +
+
+ + +
+ {t("Memory", "内存")} + + {snapshot + ? `${formatMemory(snapshot.memory.used)} / ${formatMemory(memoryInstalled)}` + : t("Sampling…", "正在采样…")} + +
+ + {Math.round( + snapshot ? percent(snapshot.memory.used, snapshot.memory.total) : 0, + )} + % +
- - {Math.round( - snapshot ? percent(snapshot.memory.used, snapshot.memory.total) : 0, - )} - % - -
- - - {memoryReserved > 0 - ? t( - `Hardware reserved (integrated graphics): ${formatMemory(memoryReserved)}`, - `硬件保留(含核显):${formatMemory(memoryReserved)}`, - ) - : snapshot + + + {memoryReserved > 0 ? t( - `${formatCount(snapshot.processes)} processes running`, - `${formatCount(snapshot.processes)} 个进程正在运行`, + `Hardware reserved (integrated graphics): ${formatMemory(memoryReserved)}`, + `硬件保留(含核显):${formatMemory(memoryReserved)}`, ) - : t("Reading activity", "正在读取活动")} - + : snapshot + ? t( + `${formatCount(snapshot.processes)} processes running`, + `${formatCount(snapshot.processes)} 个进程正在运行`, + ) + : t("Reading activity", "正在读取活动")} + +
@@ -397,39 +390,29 @@ export function OverviewPage({ const usedPercent = percent(volume.total - volume.free, volume.total); return (
-
- - {driveLabel(volume)} - {volume.name && volume.name !== driveLabel(volume) - ? ` · ${volume.name}` - : ""} - - - {Math.round(usedPercent)}% - {t( - `total ${formatBytes(volume.total)} · ${formatBytes(volume.free)} free`, - `总 ${formatBytes(volume.total)} · 可用 ${formatBytes(volume.free)}`, - )} - -
- 85 ? "red" : "green"} - /> + + {driveLabel(volume)} + + + 85 ? "red" : "green"} + /> + + + {Math.round(usedPercent)}% + {t( + `total ${formatBytes(volume.total)} · ${formatBytes(volume.free)} free`, + `总 ${formatBytes(volume.total)} · 可用 ${formatBytes(volume.free)}`, + )} +
); })}
-
- -
- -
+
-