merge: incorporate dev changes and migrate VPN widget
Resolve merge conflicts favoring our simplified caching architecture: - cron-jobs/index.ts: keep reduced job set (no integration cron jobs) - en.json: keep reduced cron job labels - docker-table.tsx: keep refetch() approach, adopt dev's initialData format Migrate new VPN widget to polling architecture: - Remove VPN cron job and subscription-based pattern - Simplify request handler to createIntegrationRequestHandler - Simplify tRPC router to use getDataAsync + settleIntegrationQueries - Convert widget from useSuspenseQuery + subscription to useQuery with polling
This commit is contained in:
55 files changed
+1568
-305
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||
import type { IntegrationKindByCategory } from "@homarr/definitions";
|
||||
import { createIntegrationAsync } from "@homarr/integrations";
|
||||
import type { VpnSummary } from "@homarr/integrations/types";
|
||||
|
||||
import { createIntegrationRequestHandler } from "./lib/integration-request-handler";
|
||||
|
||||
const logger = createLogger({ module: "vpnRequestHandler" });
|
||||
|
||||
export const vpnSummaryHandler = createIntegrationRequestHandler<
|
||||
VpnSummary | null,
|
||||
IntegrationKindByCategory<"vpn">,
|
||||
Record<string, never>
|
||||
>({
|
||||
async requestAsync(integration, _input) {
|
||||
try {
|
||||
const integrationInstance = await createIntegrationAsync(integration);
|
||||
return await integrationInstance.getSummaryAsync();
|
||||
} catch (error) {
|
||||
logger.warn("Failed to fetch VPN summary, marking as unavailable", {
|
||||
integrationId: integration.id,
|
||||
integrationKind: integration.kind,
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
});
|
||||
return null;
|
||||
}
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user