Skip to content

Commit

Permalink
fix: RAM always show 0% (#3287)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-menlo authored Aug 7, 2024
1 parent 98abff0 commit 2201e6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions web/containers/Layout/BottomPanel/SystemMonitor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { reduceTransparentAtom } from '@/helpers/atoms/Setting.atom'
import {
cpuUsageAtom,
gpusAtom,
ramUtilitizedAtom,
totalRamAtom,
usedRamAtom,
} from '@/helpers/atoms/SystemBar.atom'
Expand All @@ -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
)
Expand Down Expand Up @@ -180,7 +178,9 @@ const SystemMonitor: React.FC = () => {
className="w-full"
size="small"
/>
<span className="flex-shrink-0 ">{ramUtilitized}%</span>
<span className="flex-shrink-0 ">
{Math.round((usedRam / totalRam) * 100)}%
</span>
</div>
</div>

Expand Down
1 change: 0 additions & 1 deletion web/helpers/atoms/SystemBar.atom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const totalRamAtom = atom<number>(0)
export const usedRamAtom = atom<number>(0)

export const cpuUsageAtom = atom<number>(0)
export const ramUtilitizedAtom = atom<number>(0)

export const gpusAtom = atom<Record<string, never>[]>([])

Expand Down

0 comments on commit 2201e6c

Please sign in to comment.