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
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { IconTicket } from "@tabler/icons-react";
|
|
|
|
import { createWidgetDefinition } from "../definition";
|
|
import { optionsBuilder } from "../options";
|
|
|
|
export const { definition, componentLoader } = createWidgetDefinition("mediaReleases", {
|
|
icon: IconTicket,
|
|
queryKey: [["widget", "mediaRelease"]],
|
|
refetchInterval: null,
|
|
createOptions() {
|
|
return optionsBuilder.from((factory) => ({
|
|
layout: factory.select({
|
|
defaultValue: "backdrop",
|
|
options: [
|
|
{
|
|
value: "backdrop",
|
|
label: (t) => t("widget.mediaReleases.option.layout.option.backdrop.label"),
|
|
},
|
|
{
|
|
value: "poster",
|
|
label: (t) => t("widget.mediaReleases.option.layout.option.poster.label"),
|
|
},
|
|
],
|
|
}),
|
|
showDescriptionTooltip: factory.switch({
|
|
defaultValue: true,
|
|
}),
|
|
showType: factory.switch({
|
|
defaultValue: true,
|
|
}),
|
|
showSource: factory.switch({
|
|
defaultValue: true,
|
|
}),
|
|
}));
|
|
},
|
|
supportedIntegrations: ["mock", "emby", "jellyfin", "plex"],
|
|
}).withDynamicImport(() => import("./component"));
|