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
@@ -9,11 +9,11 @@ function convertToFahrenheit(t) {
|
||||
return t * 9/5 + 32
|
||||
}
|
||||
|
||||
export default function CpuTemp({ expanded, units }) {
|
||||
export default function CpuTemp({ expanded, units, refresh = 1500 }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data, error } = useSWR(`/api/widgets/resources?type=cputemp`, {
|
||||
refreshInterval: 1500,
|
||||
refreshInterval: refresh,
|
||||
});
|
||||
|
||||
if (error || data?.error) {
|
||||
|
||||
Reference in new issue
Block a user