From e2177a6e9aa8588717cc9286d06cafbbdbf1addd Mon Sep 17 00:00:00 2001 From: MengMengCode <227010654+MengMengCode@users.noreply.github.com> Date: Sun, 16 Aug 2026 18:33:25 +0800 Subject: [PATCH] feat: remove legacy device stat panels from dashboard The total/online/offline/last-refresh mini panels are superseded by the new module online-rate card. Co-Authored-By: Claude Opus 4.8 (1M context) --- web/src/pages/DashboardPage.tsx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/web/src/pages/DashboardPage.tsx b/web/src/pages/DashboardPage.tsx index c492bfc..0a47a46 100644 --- a/web/src/pages/DashboardPage.tsx +++ b/web/src/pages/DashboardPage.tsx @@ -28,7 +28,6 @@ export default function DashboardPage() { const [devicesLoading, setDevicesLoading] = useState(false); const [devicesError, setDevicesError] = useState(null); const [devicesOkAt, setDevicesOkAt] = useState(null); - const [lastRefresh, setLastRefresh] = useState(null); const [host, setHost] = useState(null); const [upcomingTasks, setUpcomingTasks] = useState([]); @@ -38,9 +37,7 @@ export default function DashboardPage() { const list = await api("/dashboard/devices"); setDevices(list || []); setDevicesError(null); - const now = Date.now(); - setDevicesOkAt(now); - setLastRefresh(now); + setDevicesOkAt(Date.now()); } catch (e: any) { setDevicesError({ message: e?.message || t("加载失败"), status: e?.status }); } finally { @@ -76,7 +73,6 @@ export default function DashboardPage() { const total = devices.length; const online = devices.filter((d) => d?.healthy).length; - const offline = Math.max(0, total - online); const openDevice = (id: string) => navigate(`/devices?device=${encodeURIComponent(id)}&tab=overview`); return ( @@ -92,12 +88,6 @@ export default function DashboardPage() { -
-
{t("设备总数")}
{total}
-
{t("在线")}
{online}
-
{t("离线")}
{offline}
-
{t("最近刷新")}
{lastRefresh ? new Date(lastRefresh).toLocaleTimeString() : "--:--:--"}
-
{devicesError ? ( ) : null}