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:
nioKi 2023-11-22 21:35:54 +01:00 committed by GitHub
parent e98b5e2233
commit c2729e302d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 120 additions and 63 deletions

View file

@ -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) {