From 283cb0681d760dc7a068a4b6b50c5918cb3bf27a Mon Sep 17 00:00:00 2001 From: Ben Phelps Date: Thu, 25 Aug 2022 02:02:06 +0300 Subject: [PATCH] fix resources `GB used` stat --- .../widgets/resources/resources.jsx | 45 +++++-------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/src/components/widgets/resources/resources.jsx b/src/components/widgets/resources/resources.jsx index 321f235db..5b54d7b98 100644 --- a/src/components/widgets/resources/resources.jsx +++ b/src/components/widgets/resources/resources.jsx @@ -4,12 +4,9 @@ import { FaMemory } from "react-icons/fa"; import { BiError } from "react-icons/bi"; export default function Resources({ options }) { - const { data, error } = useSWR( - `/api/widgets/resources?disk=${options.disk}`, - { - refreshInterval: 1500, - } - ); + const { data, error } = useSWR(`/api/widgets/resources?disk=${options.disk}`, { + refreshInterval: 1500, + }); if (error) { return ( @@ -30,12 +27,8 @@ export default function Resources({ options }) {
- - - GB free - - - - GB used - + - GB free + - GB used
)} @@ -44,12 +37,8 @@ export default function Resources({ options }) {
- - - Usage - - - - Load - + - Usage + - Load
)} @@ -58,12 +47,8 @@ export default function Resources({ options }) {
- - - GB Used - - - - GB Free - + - GB Used + - GB Free
)} @@ -81,12 +66,8 @@ export default function Resources({ options }) {
- - {Math.round(data.drive.freeGb)} GB free - - - {Math.round(data.drive.totalGb)} GB used - + {Math.round(data.drive.freeGb)} GB free + {Math.round(data.drive.usedGb)} GB used
)} @@ -95,9 +76,7 @@ export default function Resources({ options }) {
- - {Math.round(data.cpu.usage)}% Usage - + {Math.round(data.cpu.usage)}% Usage {Math.round(data.cpu.load * 100) / 100} Load