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 a typed WidgetRefetchInterval preset (fiveSeconds | never) to WidgetDefinition. Widgets that need faster polling set fiveSeconds; widgets that don't need polling set never (fetch on mount only, manual refresh via context menu). Absence = global 30s default. nine widgets get fiveSeconds (live monitoring) sixteen widgets get never (slow data, mount-only) remaining widgets use the 30s default Also removes inline refetchInterval from docker widget component. Fixes #6268
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import { widgetRefetchInterval } from "../definition";
|
|
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: widgetRefetchInterval.never,
|
|
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"));
|