fixes #277 - bug: memory utilization always at 99%

This commit is contained in:
Louis 2023-10-09 15:00:37 +07:00 committed by Louis
parent a369669537
commit cc2f5cbc08

View File

@ -14,7 +14,7 @@ export default function useGetSystemResources() {
SystemMonitoringService.GET_CURRENT_LOAD_INFORMATION
);
const ram =
(resourceInfor?.mem?.used ?? 0) / (resourceInfor?.mem?.total ?? 1);
(resourceInfor?.mem?.active ?? 0) / (resourceInfor?.mem?.total ?? 1);
setRam(Math.round(ram * 100));
setCPU(Math.round(currentLoadInfor?.currentLoad ?? 0));
};