mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-18 10:39:49 +00:00
Enhancement: Add configurable refresh interval and max points for glances services (#2363)
--------- Co-authored-by: Quentin de Grandmaison <quentin.degrandmaison@7speaking.com> Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
parent
e98b5e2233
commit
c2729e302d
10 changed files with 120 additions and 63 deletions
|
@ -69,16 +69,19 @@ function Mem({ quicklookData, className = "" }) {
|
|||
);
|
||||
}
|
||||
|
||||
const defaultInterval = 1000;
|
||||
const defaultSystemInterval = 30000; // This data (OS, hostname, distribution) is usually super stable.
|
||||
|
||||
export default function Component({ service }) {
|
||||
const { widget } = service;
|
||||
const { chart } = widget;
|
||||
const { chart, refreshInterval = defaultInterval } = widget;
|
||||
|
||||
const { data: quicklookData, errorL: quicklookError } = useWidgetAPI(service.widget, "quicklook", {
|
||||
refreshInterval: 1000,
|
||||
refreshInterval,
|
||||
});
|
||||
|
||||
const { data: systemData, errorL: systemError } = useWidgetAPI(service.widget, "system", {
|
||||
refreshInterval: 30000,
|
||||
refreshInterval: defaultSystemInterval,
|
||||
});
|
||||
|
||||
if (quicklookError) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue