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:
1 parent
1560bb7762
commit
454d8d03c2
6 files changed
+18
-16
No files matched your search
@@ -5,11 +5,11 @@ import { useTranslation } from "next-i18next";
|
||||
import Resource from "../widget/resource";
|
||||
import Error from "../widget/error";
|
||||
|
||||
export default function Cpu({ expanded }) {
|
||||
export default function Cpu({ expanded, refresh = 1500 }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(`/api/widgets/resources?type=cpu`, {
|
||||
refreshInterval: 1500,
|
||||
refreshInterval: refresh,
|
||||
});
|
||||
|
||||
if (error || data?.error) {
|
||||
|
||||
Reference in new issue
Block a user