mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 15:28:47 +00:00
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:
parent
1560bb7762
commit
454d8d03c2
6 changed files with 18 additions and 16 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue