The v1.69.0 caching refactor replaced Redis pub/sub with a global 30s client polling interval. Live monitoring widgets (health-monitoring, Dashdot, dns-hole) that previously refreshed every 5s were stuck at 30s. Adds refetchInterval?: number | null to WidgetDefinition: - number = poll every N seconds (e.g. 5 for live monitoring) - null = fetch on mount only, no background polling - undefined = use global 30s default 9 widgets set refetchInterval: 5 (live monitoring) 16 widgets set refetchInterval: null (slow data, mount-only) Removed inline refetchInterval from docker widget component. Fixes #6268
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import { IconRss } from "@tabler/icons-react";
|
|
import { z } from "zod/v4";
|
|
|
|
import { createWidgetDefinition } from "../definition";
|
|
import { optionsBuilder } from "../options";
|
|
|
|
/**
|
|
* Feed must conform to one of the following standards:
|
|
* - https://www.rssboard.org/rss-specification (https://web.resource.org/rss/1.0/spec)
|
|
* - https://datatracker.ietf.org/doc/html/rfc5023
|
|
* - https://www.jsonfeed.org/version/1.1/
|
|
*/
|
|
export const { definition, componentLoader } = createWidgetDefinition("rssFeed", {
|
|
icon: IconRss,
|
|
refetchInterval: null,
|
|
createOptions() {
|
|
return optionsBuilder.from((factory) => ({
|
|
feedUrls: factory.multiText({
|
|
defaultValue: [],
|
|
validate: z.string().url(),
|
|
}),
|
|
enableRtl: factory.switch({
|
|
defaultValue: false,
|
|
}),
|
|
textLinesClamp: factory.number({
|
|
defaultValue: 5,
|
|
validate: z.number().min(1).max(50),
|
|
}),
|
|
maximumAmountPosts: factory.number({
|
|
defaultValue: 100,
|
|
validate: z.number().min(1).max(9999),
|
|
}),
|
|
hideDescription: factory.switch({
|
|
defaultValue: false,
|
|
}),
|
|
showPosterImage: factory.switch({
|
|
defaultValue: false,
|
|
}),
|
|
}));
|
|
},
|
|
}).withDynamicImport(() => import("./component"));
|