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 authored and shamoon committed 2023-07-26 21:54:00 -07:00
1 parent 1560bb7762
commit 454d8d03c2
6 files changed
+18 -16

No files matched your search

+2 -2
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) {