The v1.69.0 caching refactor replaced Redis pub/sub push with a global 30s client-side refetchInterval. This caused fast-refresh widgets like health-monitoring (Dashdot, 5s) to only update every 30s. Adds refetchIntervalSeconds field to WidgetDefinition. Each widget declares its own refresh rate alongside its other config. The TRPC provider iterates all widget definitions and calls setQueryDefaults with the widget's queryKey (or auto-derived from widget kind). Widgets whose kind doesn't match their tRPC path set queryKey explicitly (e.g. dnsHoleSummary -> widget.dnsHole, systemResources -> widget.healthMonitoring). Beszel already does this for cache sharing. Removed inline refetchInterval from docker widget component since it's now on the definition. Fixes #6268
30 lines
846 B
TypeScript
30 lines
846 B
TypeScript
import { IconCloud, IconServerOff } from "@tabler/icons-react";
|
|
|
|
import { createWidgetDefinition } from "../definition";
|
|
import { optionsBuilder } from "../options";
|
|
|
|
export const { definition, componentLoader } = createWidgetDefinition("coolify", {
|
|
icon: IconCloud,
|
|
refetchIntervalSeconds: 30,
|
|
createOptions() {
|
|
return optionsBuilder.from((factory) => ({
|
|
showServers: factory.switch({
|
|
defaultValue: true,
|
|
}),
|
|
showApplications: factory.switch({
|
|
defaultValue: true,
|
|
}),
|
|
showServices: factory.switch({
|
|
defaultValue: true,
|
|
}),
|
|
}));
|
|
},
|
|
supportedIntegrations: ["coolify"],
|
|
errors: {
|
|
INTERNAL_SERVER_ERROR: {
|
|
icon: IconServerOff,
|
|
message: (t) => t("widget.coolify.error.internalServerError"),
|
|
},
|
|
},
|
|
}).withDynamicImport(() => import("./component"));
|