diff --git a/Data/Engine/web-interface/src/Devices/Device_List.jsx b/Data/Engine/web-interface/src/Devices/Device_List.jsx index bf37f27c..c0423888 100644 --- a/Data/Engine/web-interface/src/Devices/Device_List.jsx +++ b/Data/Engine/web-interface/src/Devices/Device_List.jsx @@ -13,6 +13,7 @@ import { TextField, Tooltip, Checkbox, + Stack, } from "@mui/material"; import MoreVertIcon from "@mui/icons-material/MoreVert"; import ViewColumnIcon from "@mui/icons-material/ViewColumn"; @@ -67,50 +68,6 @@ const MAGIC_UI = { const PAGE_ICON = DevicesOtherIcon; -const StatTile = React.memo(function StatTile({ label, value, meta, gradient }) { - return ( - - - {label} - - - {value} - - {meta ? ( - {meta} - ) : null} - - ); -}); - -const HERO_BADGE_SX = { - px: 1.5, - py: 0.4, - borderRadius: 999, - border: "1px solid rgba(255,255,255,0.18)", - background: "rgba(12,18,35,0.85)", - fontSize: "0.72rem", - letterSpacing: 0.35, - textTransform: "uppercase", - color: MAGIC_UI.textBright, - display: "inline-flex", - alignItems: "center", - gap: 0.5, -}; - const RAINBOW_BUTTON_SX = { borderRadius: 999, textTransform: "none", @@ -642,49 +599,6 @@ export default function DeviceList({ }; }, [rows, repoHash, computeAgentVersion]); - const shortRepoSha = useMemo(() => (repoHash || "").slice(0, 7), [repoHash]); - - const statTiles = useMemo(() => { - const total = heroStats.total || 1; - const onlinePct = Math.round((heroStats.online / total) * 100); - return [ - { - key: "online", - label: "Online", - value: heroStats.online, - meta: `${onlinePct}% live`, - gradient: "linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(34, 197, 94, 0.45))", - }, - { - key: "stale", - label: "Stale (>1h)", - value: heroStats.stale, - meta: heroStats.stale ? "Needs attention" : "All synced", - gradient: "linear-gradient(135deg, rgba(249, 115, 22, 0.55), rgba(239, 68, 68, 0.55))", - }, - { - key: "updates", - label: "Needs Agent Update", - value: heroStats.needsUpdate, - meta: repoHash ? `Repo Hash: ${shortRepoSha}` : "Syncing repo…", - gradient: "linear-gradient(135deg, rgba(192, 132, 252, 0.4), rgba(14, 165, 233, 0.35))", - }, - { - key: "sites", - label: "Sites", - value: heroStats.sites, - meta: heroStats.sites === 1 ? "Single site" : "Multi-site", - gradient: "linear-gradient(135deg, rgba(125, 183, 255, 0.45), rgba(148, 163, 184, 0.35))", - }, - ]; - }, [heroStats, repoHash, shortRepoSha]); - - const activeFilterCount = useMemo( - () => Object.keys(filters || {}).length, - [filters] - ); - const hasActiveFilters = activeFilterCount > 0; - const heroSubtitle = useMemo(() => { if (!heroStats.total) { return "Connect your first device to start streaming telemetry into Borealis."; @@ -1598,50 +1512,103 @@ export default function DeviceList({ }} elevation={0} > - - - - {hasActiveFilters ? ( - - Filters - - {activeFilterCount} - - - ) : null} - {selectedIds.size > 0 ? ( - - Selected - - {selectedIds.size} - - - ) : null} - - - - {statTiles.map(({ key, ...tileProps }) => ( - - ))} - - - + + + + + + + + + + + + {derivedShowAddButton && ( + + )} + - + Custom View @@ -1724,75 +1691,11 @@ export default function DeviceList({ width: 36, background: "rgba(12,18,35,0.8)", "&:hover": { borderColor: MAGIC_UI.accentA }, - }} - > - - - - - - - - fetchDevices({ refreshRepo: true })} - sx={{ color: MAGIC_UI.textBright, border: "1px solid rgba(148,163,184,0.35)", borderRadius: 2 }} - > - - - - - - setColChooserAnchor(e.currentTarget)} - sx={{ color: MAGIC_UI.textBright, border: "1px solid rgba(148,163,184,0.35)", borderRadius: 2 }} - > - - - - {derivedShowAddButton && ( - - )} - + + +