From 2201e6c5f87538b953503937fe6b135fe1aa2d94 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 7 Aug 2024 13:20:09 +0700 Subject: [PATCH] fix: RAM always show 0% (#3287) --- web/containers/Layout/BottomPanel/SystemMonitor/index.tsx | 6 +++--- web/helpers/atoms/SystemBar.atom.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx b/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx index 46632d9fd..d05686285 100644 --- a/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx +++ b/web/containers/Layout/BottomPanel/SystemMonitor/index.tsx @@ -26,7 +26,6 @@ import { reduceTransparentAtom } from '@/helpers/atoms/Setting.atom' import { cpuUsageAtom, gpusAtom, - ramUtilitizedAtom, totalRamAtom, usedRamAtom, } from '@/helpers/atoms/SystemBar.atom' @@ -39,7 +38,6 @@ const SystemMonitor: React.FC = () => { const gpus = useAtomValue(gpusAtom) const [showFullScreen, setShowFullScreen] = useState(false) - const ramUtilitized = useAtomValue(ramUtilitizedAtom) const [showSystemMonitorPanel, setShowSystemMonitorPanel] = useAtom( showSystemMonitorPanelAtom ) @@ -180,7 +178,9 @@ const SystemMonitor: React.FC = () => { className="w-full" size="small" /> - {ramUtilitized}% + + {Math.round((usedRam / totalRam) * 100)}% + diff --git a/web/helpers/atoms/SystemBar.atom.ts b/web/helpers/atoms/SystemBar.atom.ts index ba91364ba..f8de0688c 100644 --- a/web/helpers/atoms/SystemBar.atom.ts +++ b/web/helpers/atoms/SystemBar.atom.ts @@ -4,7 +4,6 @@ export const totalRamAtom = atom(0) export const usedRamAtom = atom(0) export const cpuUsageAtom = atom(0) -export const ramUtilitizedAtom = atom(0) export const gpusAtom = atom[]>([])