mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08: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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user