Add custom refresh rate setting to resources

Simplify resources refresh variable, enforce minimum

Add custom refresh rate to uptime

Add custom refresh rate to memory

Add custom refresh rate to disk

Add custom refresh rate to cputemp

Add custom refresh rate to CPU
This commit is contained in:
Mega-Volti 2023-07-27 01:35:48 +02:00 committed by shamoon
parent 1560bb7762
commit 454d8d03c2
6 changed files with 18 additions and 16 deletions

View file

@ -5,11 +5,11 @@ import { useTranslation } from "next-i18next";
import Resource from "../widget/resource";
import Error from "../widget/error";
export default function Disk({ options, expanded }) {
export default function Disk({ options, expanded, refresh = 1500 }) {
const { t } = useTranslation();
const { data, error } = useSWR(`/api/widgets/resources?type=disk&target=${options.disk}`, {
refreshInterval: 1500,
refreshInterval: refresh,
});
if (error || data?.error) {