From c2fd5bc1da257099f833dbf2e139e043ed1efb22 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 8 May 2026 12:31:55 +0200 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20Phase=205c-ii=20=E2=80=94=20l?= =?UTF-8?q?ive=20status=20cards=20on=20the=20dashboard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the CPU / memory / swap / disk dashboard cards to IndexPage, backed by a useStatus() composable that polls /panel/api/server/status every 2 s and a Status / CurTotal model ported from the legacy inline classes in index.html. - models/status.js — Status & CurTotal classes (CurTotal exposes reactive .percent and .color computed-style getters; Status maps the API payload + xray state to color/message strings) - composables/useStatus.js — 2s polling with shallowRef so each fetch swaps the whole Status object atomically. WebSocket integration intentionally deferred — the legacy panel falls back to this same 2s polling when its websocket drops, so we ship the proven path first and add WS on top in a later sub-phase. - pages/index/StatusCard.vue — four a-progress dashboard widgets in a 2x2 grid (mobile collapses to a 1x4). CPU widget exposes a history button; the modal it opens is part of 5c-iv. - IndexPage now consumes both, plus useMediaQuery so the layout responds to viewport changes. AD-Vue 4 changes: dropped in favor of explicit AreaChartOutlined / HistoryOutlined imports.