From 1e64cf02cd19552d751f0175377c3479213b8da6 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:36:40 -0700 Subject: [PATCH] Add temp usage bar, fix disk percentage --- src/components/widgets/resources/cputemp.jsx | 3 +++ src/components/widgets/resources/disk.jsx | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/widgets/resources/cputemp.jsx b/src/components/widgets/resources/cputemp.jsx index d5cb61009..b113ede2f 100644 --- a/src/components/widgets/resources/cputemp.jsx +++ b/src/components/widgets/resources/cputemp.jsx @@ -2,6 +2,7 @@ import useSWR from "swr"; import { FaThermometerHalf } from "react-icons/fa"; import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; +import UsageBar from "./usage-bar"; export default function CpuTemp({ expanded, units }) { const { t } = useTranslation(); @@ -44,6 +45,7 @@ export default function CpuTemp({ expanded, units }) { const unit = units === "imperial" ? "fahrenheit" : "celsius"; const mainTemp = (unit === "celsius") ? data.cputemp.main : data.cputemp.main * 5/9 + 32; const maxTemp = (unit === "celsius") ? data.cputemp.max : data.cputemp.max * 5/9 + 32; + const percent = Math.round((mainTemp / maxTemp) * 100); return (