mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 21:59:50 +01: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:
@@ -5,11 +5,11 @@ import { useTranslation } from "next-i18next";
|
||||
import Resource from "../widget/resource";
|
||||
import Error from "../widget/error";
|
||||
|
||||
export default function Memory({ expanded }) {
|
||||
export default function Memory({ expanded, refresh = 1500 }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(`/api/widgets/resources?type=memory`, {
|
||||
refreshInterval: 1500,
|
||||
refreshInterval: refresh,
|
||||
});
|
||||
|
||||
if (error || data?.error) {
|
||||
|
||||
Reference in New Issue
Block a user