diff --git a/src/components/system-information-widget.tsx b/src/components/system-information-widget.tsx index 1e37cee7..9c10ff70 100644 --- a/src/components/system-information-widget.tsx +++ b/src/components/system-information-widget.tsx @@ -1,20 +1,62 @@ import { useShallow } from "zustand/react/shallow"; +import Card from "@/components/card"; import useGlobalCpuSelectors from "@/features/metrics/stores/global-cpu.store"; +import useMemorySelectors from "@/features/metrics/stores/memory.store"; +import useSwapSelectors from "@/features/metrics/stores/swap.store"; import useSystemStoreSelectors from "@/features/metrics/stores/system.store"; -import { Group, Title } from "@mantine/core"; +import formatBytes from "@/features/metrics/utils/format-bytes"; +import { Grid, Group, Text, Title } from "@mantine/core"; const SystemInformationWidget: React.FC = () => { const info = useSystemStoreSelectors(useShallow((state) => state.info)); const cpuBrand = useGlobalCpuSelectors(useShallow((state) => state.latest.brand)); + const memory = useMemorySelectors.use.latest().total; + const swap = useSwapSelectors.use.latest().total; + return ( - - CPU: {cpuBrand} - CPU cores: {info.coreCount} - OS: {info.os} - Kernel: {info.kernelVersion} - + + + + + CPU + + {cpuBrand} + + + + OS + + {info.os} + + + + CPU cores + + {info.coreCount} + + + + + Kernel + + {info.kernelVersion} + + + + Memory + + {formatBytes(memory)} + + + + Swap + + {formatBytes(swap)} + + + ); }; diff --git a/src/features/metrics/pages/dashboard.page.tsx b/src/features/metrics/pages/dashboard.page.tsx index bced9e32..f2029413 100644 --- a/src/features/metrics/pages/dashboard.page.tsx +++ b/src/features/metrics/pages/dashboard.page.tsx @@ -64,10 +64,10 @@ const CpuSection = () => { const NetworksSection = () => { return ( <> - + - + @@ -92,9 +92,12 @@ const DashboardPage = () => { const hostname = useSystemStoreSelectors(useShallow((state) => state.info.hostname)); const greeting = useRandomGreeting(hostname); return ( - }> + - + + + + {/* */}