fix: RAM always show 0% (#3287)
This commit is contained in:
parent
98abff0da3
commit
2201e6c5f8
@ -26,7 +26,6 @@ import { reduceTransparentAtom } from '@/helpers/atoms/Setting.atom'
|
|||||||
import {
|
import {
|
||||||
cpuUsageAtom,
|
cpuUsageAtom,
|
||||||
gpusAtom,
|
gpusAtom,
|
||||||
ramUtilitizedAtom,
|
|
||||||
totalRamAtom,
|
totalRamAtom,
|
||||||
usedRamAtom,
|
usedRamAtom,
|
||||||
} from '@/helpers/atoms/SystemBar.atom'
|
} from '@/helpers/atoms/SystemBar.atom'
|
||||||
@ -39,7 +38,6 @@ const SystemMonitor: React.FC = () => {
|
|||||||
const gpus = useAtomValue(gpusAtom)
|
const gpus = useAtomValue(gpusAtom)
|
||||||
|
|
||||||
const [showFullScreen, setShowFullScreen] = useState(false)
|
const [showFullScreen, setShowFullScreen] = useState(false)
|
||||||
const ramUtilitized = useAtomValue(ramUtilitizedAtom)
|
|
||||||
const [showSystemMonitorPanel, setShowSystemMonitorPanel] = useAtom(
|
const [showSystemMonitorPanel, setShowSystemMonitorPanel] = useAtom(
|
||||||
showSystemMonitorPanelAtom
|
showSystemMonitorPanelAtom
|
||||||
)
|
)
|
||||||
@ -180,7 +178,9 @@ const SystemMonitor: React.FC = () => {
|
|||||||
className="w-full"
|
className="w-full"
|
||||||
size="small"
|
size="small"
|
||||||
/>
|
/>
|
||||||
<span className="flex-shrink-0 ">{ramUtilitized}%</span>
|
<span className="flex-shrink-0 ">
|
||||||
|
{Math.round((usedRam / totalRam) * 100)}%
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ export const totalRamAtom = atom<number>(0)
|
|||||||
export const usedRamAtom = atom<number>(0)
|
export const usedRamAtom = atom<number>(0)
|
||||||
|
|
||||||
export const cpuUsageAtom = atom<number>(0)
|
export const cpuUsageAtom = atom<number>(0)
|
||||||
export const ramUtilitizedAtom = atom<number>(0)
|
|
||||||
|
|
||||||
export const gpusAtom = atom<Record<string, never>[]>([])
|
export const gpusAtom = atom<Record<string, never>[]>([])
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user