From a164c951ce98149986c131f1b08ae4d5b68b4720 Mon Sep 17 00:00:00 2001 From: ajnart <49837342+ajnart@users.noreply.github.com> Date: Wed, 24 Jun 2026 13:11:34 +0000 Subject: [PATCH] style: auto-fix lint and format --- .../app/[locale]/_client-providers/trpc.tsx | 7 ++++- .../manage/tools/docker/docker-table.tsx | 26 +++++++++++-------- packages/api/src/router/widgets/rssFeed.ts | 2 +- packages/api/src/router/widgets/umami.ts | 2 +- packages/api/src/test/query-cache.spec.ts | 20 +++++++++++--- packages/redis/src/lib/channel.ts | 3 --- packages/request-handler/src/anchor-notes.ts | 15 +++++------ .../src/archive-team-warrior.ts | 1 - .../request-handler/src/audiobookshelf.ts | 1 - packages/request-handler/src/coolify.ts | 1 - packages/request-handler/src/dns-hole.ts | 1 - packages/request-handler/src/downloads.ts | 1 - packages/request-handler/src/firewall.ts | 1 - .../request-handler/src/health-monitoring.ts | 1 - packages/request-handler/src/immich.ts | 1 - .../request-handler/src/indexer-manager.ts | 1 - packages/request-handler/src/media-release.ts | 1 - .../request-handler/src/media-request-list.ts | 1 - .../src/media-request-stats.ts | 1 - packages/request-handler/src/media-server.ts | 1 - .../request-handler/src/media-transcoding.ts | 1 - packages/request-handler/src/navidrome.ts | 1 - .../request-handler/src/network-controller.ts | 1 - packages/request-handler/src/notifications.ts | 1 - packages/request-handler/src/paperless-ngx.ts | 1 - packages/request-handler/src/releases.ts | 1 - .../src/smart-home-entity-state.ts | 1 - .../request-handler/src/speedtest-tracker.ts | 1 - packages/request-handler/src/timetable.ts | 1 - packages/request-handler/src/tracearr.ts | 1 - packages/request-handler/src/umami.ts | 7 +---- packages/request-handler/src/ups.ts | 1 - packages/request-handler/src/uptime-kuma.ts | 1 - .../widgets/src/app/ping/ping-indicator.tsx | 5 +--- .../widgets/src/beszel-alerts/component.tsx | 6 +---- .../widgets/src/beszel-system-stats/index.ts | 5 +--- .../src/beszel/_shared/system-stats-modal.tsx | 14 +++++----- packages/widgets/src/docker/component.tsx | 4 +-- 38 files changed, 58 insertions(+), 83 deletions(-) diff --git a/apps/nextjs/src/app/[locale]/_client-providers/trpc.tsx b/apps/nextjs/src/app/[locale]/_client-providers/trpc.tsx index 0abe33ae9..1520375f6 100644 --- a/apps/nextjs/src/app/[locale]/_client-providers/trpc.tsx +++ b/apps/nextjs/src/app/[locale]/_client-providers/trpc.tsx @@ -22,7 +22,12 @@ import { TRPCClientError } from "@trpc/client"; import type { AppRouter } from "@homarr/api"; import { clientApi } from "@homarr/api/client"; -import { isPersistableWidgetQueryKey, queryCacheDefaultGcTimeMs, queryCacheDefaultRefetchIntervalMs, queryCacheDefaultStaleTimeMs } from "@homarr/api/query-cache"; +import { + isPersistableWidgetQueryKey, + queryCacheDefaultGcTimeMs, + queryCacheDefaultRefetchIntervalMs, + queryCacheDefaultStaleTimeMs, +} from "@homarr/api/query-cache"; import { createHeadersCallbackForSource, getTrpcUrl } from "@homarr/api/shared"; import { env } from "@homarr/common/env"; import { showWarningNotification } from "@homarr/notifications"; diff --git a/apps/nextjs/src/app/[locale]/manage/tools/docker/docker-table.tsx b/apps/nextjs/src/app/[locale]/manage/tools/docker/docker-table.tsx index 3f846e5ed..0a97d1c84 100644 --- a/apps/nextjs/src/app/[locale]/manage/tools/docker/docker-table.tsx +++ b/apps/nextjs/src/app/[locale]/manage/tools/docker/docker-table.tsx @@ -164,17 +164,21 @@ export function DockerTable({ containers, timestamp }: RouterOutputs["docker"][" const [isPending, setIsPending] = useState(false); const mutate = useCallback(() => { setIsPending(true); - void utils.docker.getContainers.invalidate().then(() => { - showSuccessNotification({ - title: tDocker("action.refresh.notification.success.title"), - message: tDocker("action.refresh.notification.success.message"), - }); - }).catch(() => { - showErrorNotification({ - title: tDocker("action.refresh.notification.error.title"), - message: tDocker("action.refresh.notification.error.message"), - }); - }).finally(() => setIsPending(false)); + void utils.docker.getContainers + .invalidate() + .then(() => { + showSuccessNotification({ + title: tDocker("action.refresh.notification.success.title"), + message: tDocker("action.refresh.notification.success.message"), + }); + }) + .catch(() => { + showErrorNotification({ + title: tDocker("action.refresh.notification.error.title"), + message: tDocker("action.refresh.notification.error.message"), + }); + }) + .finally(() => setIsPending(false)); }, [utils, tDocker]); const table = useTranslatedMantineReactTable({ diff --git a/packages/api/src/router/widgets/rssFeed.ts b/packages/api/src/router/widgets/rssFeed.ts index d13903aa9..075d8a91e 100644 --- a/packages/api/src/router/widgets/rssFeed.ts +++ b/packages/api/src/router/widgets/rssFeed.ts @@ -34,7 +34,7 @@ export const rssFeedRouter = createTRPCRouter({ return rssFeeds .flatMap((rssFeed) => rssFeed.data.entries) .slice(0, input.maximumAmountPosts) - .sort((entryA, entryB) => { + .toSorted((entryA, entryB) => { return entryA.published && entryB.published ? new Date(entryB.published).getTime() - new Date(entryA.published).getTime() : 0; diff --git a/packages/api/src/router/widgets/umami.ts b/packages/api/src/router/widgets/umami.ts index 852d1f1a0..ecfe42436 100644 --- a/packages/api/src/router/widgets/umami.ts +++ b/packages/api/src/router/widgets/umami.ts @@ -147,7 +147,7 @@ export const umamiRouter = createTRPCRouter({ .concat(createOneIntegrationMiddleware("query", "umami")) .query(async ({ ctx, input }) => { try { - const sortedNames = [...input.eventNames].sort(); + const sortedNames = [...input.eventNames].toSorted(); const innerHandler = umamiMultiEventRequestHandler.handler(ctx.integration, { websiteId: input.websiteId, timeFrame: input.timeFrame, diff --git a/packages/api/src/test/query-cache.spec.ts b/packages/api/src/test/query-cache.spec.ts index e25051903..ad3ea1091 100644 --- a/packages/api/src/test/query-cache.spec.ts +++ b/packages/api/src/test/query-cache.spec.ts @@ -6,7 +6,11 @@ import { createId } from "@homarr/common"; import type { Database } from "@homarr/db"; import { boards, users } from "@homarr/db/schema"; import { createDb } from "@homarr/db/test"; -import { isPersistableWidgetQueryKey, queryCacheDefaultStaleTimeMs, queryCacheMaxValueBytes } from "@homarr/api/query-cache"; +import { + isPersistableWidgetQueryKey, + queryCacheDefaultStaleTimeMs, + queryCacheMaxValueBytes, +} from "@homarr/api/query-cache"; import { queryCacheRouter } from "../router/query-cache"; @@ -81,7 +85,12 @@ describe("queryCacheRouter", () => { await expect(caller.setItem({ boardId: "board-1", value: "cached-value" })).resolves.toEqual({ stored: true, }); - expect(redisMock.setQueryCacheAsync).toHaveBeenCalledWith(session.user.id, "board-1", "cached-value", expect.any(Number)); + expect(redisMock.setQueryCacheAsync).toHaveBeenCalledWith( + session.user.id, + "board-1", + "cached-value", + expect.any(Number), + ); await caller.removeItem({ boardId: "board-1" }); expect(redisMock.removeQueryCacheAsync).toHaveBeenCalledWith(session.user.id, "board-1"); @@ -108,7 +117,12 @@ describe("queryCacheRouter", () => { await caller.setItem({ boardId: "board-1", value: "cached-value" }); - expect(redisMock.setQueryCacheAsync).toHaveBeenCalledWith("anonymous", "board-1", "cached-value", expect.any(Number)); + expect(redisMock.setQueryCacheAsync).toHaveBeenCalledWith( + "anonymous", + "board-1", + "cached-value", + expect.any(Number), + ); }); test("rejects oversized values", async () => { diff --git a/packages/redis/src/lib/channel.ts b/packages/redis/src/lib/channel.ts index 848c47afd..cf215cfc7 100644 --- a/packages/redis/src/lib/channel.ts +++ b/packages/redis/src/lib/channel.ts @@ -3,7 +3,6 @@ import superjson from "superjson"; import { createId } from "@homarr/common"; import { createLogger } from "@homarr/core/infrastructure/logs"; - import { ChannelSubscriptionTracker } from "./channel-subscription-tracker"; import { createRedisConnection } from "./connection"; @@ -226,7 +225,6 @@ export const createCacheChannel = (name: string, cacheDurationMs: number }; }; - /** * Invalidates all cached data for a given integration by deleting every Redis key * that starts with `integration:${integrationId}:` as well as the integration's @@ -257,7 +255,6 @@ export const invalidateIntegrationCacheAsync = async (integrationId: string): Pr } }; - export const createChannelEventHistory = (channelName: string, maxElements = 32) => { return { subscribe: (callback: (data: TData) => void) => { diff --git a/packages/request-handler/src/anchor-notes.ts b/packages/request-handler/src/anchor-notes.ts index 2d0bec2f7..b821d23f0 100644 --- a/packages/request-handler/src/anchor-notes.ts +++ b/packages/request-handler/src/anchor-notes.ts @@ -1,4 +1,3 @@ - import type { AnchorNote, AnchorNotesListInput, AnchorNoteSummary } from "@homarr/integrations"; import { createIntegrationAsync } from "@homarr/integrations"; @@ -16,12 +15,10 @@ export const anchorNotesListRequestHandler = createIntegrationRequestHandler< }, }); -export const anchorNoteRequestHandler = createIntegrationRequestHandler( - { - queryKey: "anchorNote", - async requestAsync(integration, input) { - const instance = await createIntegrationAsync(integration); - return instance.getNoteAsync(input.noteId); - }, +export const anchorNoteRequestHandler = createIntegrationRequestHandler({ + queryKey: "anchorNote", + async requestAsync(integration, input) { + const instance = await createIntegrationAsync(integration); + return instance.getNoteAsync(input.noteId); }, -); +}); diff --git a/packages/request-handler/src/archive-team-warrior.ts b/packages/request-handler/src/archive-team-warrior.ts index 172b41fe2..bf3c80f15 100644 --- a/packages/request-handler/src/archive-team-warrior.ts +++ b/packages/request-handler/src/archive-team-warrior.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import type { ArchiveTeamWarriorStatus } from "@homarr/integrations"; import { createIntegrationAsync } from "@homarr/integrations"; diff --git a/packages/request-handler/src/audiobookshelf.ts b/packages/request-handler/src/audiobookshelf.ts index 57980d509..54f4003d8 100644 --- a/packages/request-handler/src/audiobookshelf.ts +++ b/packages/request-handler/src/audiobookshelf.ts @@ -1,4 +1,3 @@ - import { createIntegrationAsync } from "@homarr/integrations"; import type { AudiobookshelfDashboardData } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/coolify.ts b/packages/request-handler/src/coolify.ts index 0c44bbc2f..c129299c6 100644 --- a/packages/request-handler/src/coolify.ts +++ b/packages/request-handler/src/coolify.ts @@ -1,4 +1,3 @@ - import { createIntegrationAsync } from "@homarr/integrations"; import type { CoolifyInstanceInfo } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/dns-hole.ts b/packages/request-handler/src/dns-hole.ts index 2603b1b96..95bfbbd59 100644 --- a/packages/request-handler/src/dns-hole.ts +++ b/packages/request-handler/src/dns-hole.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { DnsHoleSummary } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/downloads.ts b/packages/request-handler/src/downloads.ts index 1b6ac6378..721ef7a4a 100644 --- a/packages/request-handler/src/downloads.ts +++ b/packages/request-handler/src/downloads.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import type { DownloadClientJobsAndStatus } from "@homarr/integrations"; import { createIntegrationAsync } from "@homarr/integrations"; diff --git a/packages/request-handler/src/firewall.ts b/packages/request-handler/src/firewall.ts index 0bfd7b721..3a4018b00 100644 --- a/packages/request-handler/src/firewall.ts +++ b/packages/request-handler/src/firewall.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { diff --git a/packages/request-handler/src/health-monitoring.ts b/packages/request-handler/src/health-monitoring.ts index 5c5051983..b0913afb8 100644 --- a/packages/request-handler/src/health-monitoring.ts +++ b/packages/request-handler/src/health-monitoring.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { ProxmoxClusterInfo, SystemHealthMonitoring } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/immich.ts b/packages/request-handler/src/immich.ts index 4f8341b76..6e296d8d6 100644 --- a/packages/request-handler/src/immich.ts +++ b/packages/request-handler/src/immich.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { ImmichAlbum, ImmichServerStats } from "@homarr/integrations"; diff --git a/packages/request-handler/src/indexer-manager.ts b/packages/request-handler/src/indexer-manager.ts index f87d2184c..b003bf31f 100644 --- a/packages/request-handler/src/indexer-manager.ts +++ b/packages/request-handler/src/indexer-manager.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { Indexer } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/media-release.ts b/packages/request-handler/src/media-release.ts index 442730c9b..5bc5f9843 100644 --- a/packages/request-handler/src/media-release.ts +++ b/packages/request-handler/src/media-release.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { MediaRelease } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/media-request-list.ts b/packages/request-handler/src/media-request-list.ts index e101ef4f8..0f337c359 100644 --- a/packages/request-handler/src/media-request-list.ts +++ b/packages/request-handler/src/media-request-list.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { MediaRequest } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/media-request-stats.ts b/packages/request-handler/src/media-request-stats.ts index f692835a7..699263eef 100644 --- a/packages/request-handler/src/media-request-stats.ts +++ b/packages/request-handler/src/media-request-stats.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { MediaRequestStats } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/media-server.ts b/packages/request-handler/src/media-server.ts index 7bb818622..14bb8aae5 100644 --- a/packages/request-handler/src/media-server.ts +++ b/packages/request-handler/src/media-server.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import type { StreamSession } from "@homarr/integrations"; import { createIntegrationAsync } from "@homarr/integrations"; diff --git a/packages/request-handler/src/media-transcoding.ts b/packages/request-handler/src/media-transcoding.ts index 76d48a21d..49c406e04 100644 --- a/packages/request-handler/src/media-transcoding.ts +++ b/packages/request-handler/src/media-transcoding.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { TdarrQueue, TdarrStatistics, TdarrWorker } from "@homarr/integrations"; diff --git a/packages/request-handler/src/navidrome.ts b/packages/request-handler/src/navidrome.ts index ca19ccbe2..b83f5be4e 100644 --- a/packages/request-handler/src/navidrome.ts +++ b/packages/request-handler/src/navidrome.ts @@ -1,4 +1,3 @@ - import { createIntegrationAsync } from "@homarr/integrations"; import type { NavidromeDashboardData } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/network-controller.ts b/packages/request-handler/src/network-controller.ts index 26fe3693a..a4351f4d2 100644 --- a/packages/request-handler/src/network-controller.ts +++ b/packages/request-handler/src/network-controller.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { NetworkControllerSummary } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/notifications.ts b/packages/request-handler/src/notifications.ts index f244d1ba9..8821f0bf1 100644 --- a/packages/request-handler/src/notifications.ts +++ b/packages/request-handler/src/notifications.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import type { Notification } from "@homarr/integrations"; import { createIntegrationAsync } from "@homarr/integrations"; diff --git a/packages/request-handler/src/paperless-ngx.ts b/packages/request-handler/src/paperless-ngx.ts index b2d6d3675..a9b175a38 100644 --- a/packages/request-handler/src/paperless-ngx.ts +++ b/packages/request-handler/src/paperless-ngx.ts @@ -1,4 +1,3 @@ - import { createIntegrationAsync } from "@homarr/integrations"; import type { PaperlessNgxStats } from "@homarr/integrations"; diff --git a/packages/request-handler/src/releases.ts b/packages/request-handler/src/releases.ts index 2f50782fa..149bb4954 100644 --- a/packages/request-handler/src/releases.ts +++ b/packages/request-handler/src/releases.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import type { ReleaseResponse, ReleasesRepository } from "@homarr/integrations"; import { createIntegrationAsync } from "@homarr/integrations"; diff --git a/packages/request-handler/src/smart-home-entity-state.ts b/packages/request-handler/src/smart-home-entity-state.ts index c80ffce4d..097dec583 100644 --- a/packages/request-handler/src/smart-home-entity-state.ts +++ b/packages/request-handler/src/smart-home-entity-state.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; diff --git a/packages/request-handler/src/speedtest-tracker.ts b/packages/request-handler/src/speedtest-tracker.ts index bd435ebe3..a197fce9a 100644 --- a/packages/request-handler/src/speedtest-tracker.ts +++ b/packages/request-handler/src/speedtest-tracker.ts @@ -1,4 +1,3 @@ - import { createIntegrationAsync } from "@homarr/integrations"; import type { SpeedtestTrackerDashboardData } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/timetable.ts b/packages/request-handler/src/timetable.ts index b753e9485..b020829f3 100644 --- a/packages/request-handler/src/timetable.ts +++ b/packages/request-handler/src/timetable.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { Station, Timetable } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/tracearr.ts b/packages/request-handler/src/tracearr.ts index ae6e98f92..1cb0ae91f 100644 --- a/packages/request-handler/src/tracearr.ts +++ b/packages/request-handler/src/tracearr.ts @@ -1,4 +1,3 @@ - import { createIntegrationAsync } from "@homarr/integrations"; import type { TracearrDashboardData } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/umami.ts b/packages/request-handler/src/umami.ts index 494759c13..8d9a40141 100644 --- a/packages/request-handler/src/umami.ts +++ b/packages/request-handler/src/umami.ts @@ -1,4 +1,3 @@ - import { createIntegrationAsync } from "@homarr/integrations"; import type { UmamiEventSeries, UmamiMetricItem, UmamiVisitorStats } from "@homarr/integrations/types"; @@ -16,11 +15,7 @@ export const umamiRequestHandler = createIntegrationRequestHandler< queryKey: "umamiVisitorStats", }); -export const umamiEventNamesRequestHandler = createIntegrationRequestHandler< - string[], - "umami", - { websiteId: string } ->({ +export const umamiEventNamesRequestHandler = createIntegrationRequestHandler({ async requestAsync(integration, input) { const integrationInstance = await createIntegrationAsync(integration); return await integrationInstance.getEventNamesAsync(input.websiteId); diff --git a/packages/request-handler/src/ups.ts b/packages/request-handler/src/ups.ts index 1627913bf..2c3dbd426 100644 --- a/packages/request-handler/src/ups.ts +++ b/packages/request-handler/src/ups.ts @@ -1,4 +1,3 @@ - import type { IntegrationKindByCategory } from "@homarr/definitions"; import { createIntegrationAsync } from "@homarr/integrations"; import type { UpsSummary } from "@homarr/integrations/types"; diff --git a/packages/request-handler/src/uptime-kuma.ts b/packages/request-handler/src/uptime-kuma.ts index 328619ce3..6e23c21d0 100644 --- a/packages/request-handler/src/uptime-kuma.ts +++ b/packages/request-handler/src/uptime-kuma.ts @@ -1,4 +1,3 @@ - import { createIntegrationAsync } from "@homarr/integrations"; import type { UptimeKumaDashboardData } from "@homarr/integrations/types"; diff --git a/packages/widgets/src/app/ping/ping-indicator.tsx b/packages/widgets/src/app/ping/ping-indicator.tsx index 6a460a3de..75dc38974 100644 --- a/packages/widgets/src/app/ping/ping-indicator.tsx +++ b/packages/widgets/src/app/ping/ping-indicator.tsx @@ -11,10 +11,7 @@ interface PingIndicatorProps { export const PingIndicator = ({ appId }: PingIndicatorProps) => { const t = useI18n(); - const { data: pingResult } = clientApi.widget.app.ping.useQuery( - { id: appId }, - { refetchOnMount: false }, - ); + const { data: pingResult } = clientApi.widget.app.ping.useQuery({ id: appId }, { refetchOnMount: false }); if (!pingResult) return ; diff --git a/packages/widgets/src/beszel-alerts/component.tsx b/packages/widgets/src/beszel-alerts/component.tsx index 8b6bb7723..3f934423d 100644 --- a/packages/widgets/src/beszel-alerts/component.tsx +++ b/packages/widgets/src/beszel-alerts/component.tsx @@ -41,11 +41,7 @@ export default function BeszelAlertsWidget({ () => ({ integrationIds, includeHistory: options.showHistory, maxHistoryItems: options.maxHistoryItems }), [integrationIds, options.showHistory, options.maxHistoryItems], ); - const { - data: results = [], - error: alertsError, - isPending, - } = clientApi.widget.beszel.getAlerts.useQuery(alertsInput); + const { data: results = [], error: alertsError, isPending } = clientApi.widget.beszel.getAlerts.useQuery(alertsInput); const systemNameMap = useMemo(() => { const map: Record = {}; diff --git a/packages/widgets/src/beszel-system-stats/index.ts b/packages/widgets/src/beszel-system-stats/index.ts index 6345de9ea..a184963e7 100644 --- a/packages/widgets/src/beszel-system-stats/index.ts +++ b/packages/widgets/src/beszel-system-stats/index.ts @@ -28,10 +28,7 @@ export const { definition, componentLoader } = createWidgetDefinition("beszelSys data = [], isPending, isError, - } = clientApi.widget.beszel.getSystems.useQuery( - { integrationIds }, - { enabled: integrationIds.length > 0 }, - ); + } = clientApi.widget.beszel.getSystems.useQuery({ integrationIds }, { enabled: integrationIds.length > 0 }); const selectData = data.flatMap((r) => r.systems.map((s) => ({ value: s.id, label: s.name }))); return { data: selectData, isPending, isError }; }, diff --git a/packages/widgets/src/beszel/_shared/system-stats-modal.tsx b/packages/widgets/src/beszel/_shared/system-stats-modal.tsx index ab8419206..1071ccc53 100644 --- a/packages/widgets/src/beszel/_shared/system-stats-modal.tsx +++ b/packages/widgets/src/beszel/_shared/system-stats-modal.tsx @@ -36,14 +36,12 @@ export const BeszelSystemStatsModal = createModal(( const t = useScopedI18n("widget.beszelSystemStats"); const [timePeriod, setTimePeriod] = useState("1h"); - const { data } = clientApi.widget.beszel.getSystemStats.useQuery( - { - integrationIds: [innerProps.integrationId], - systemId: innerProps.systemId, - timePeriod, - includeDocker: false, - }, - ); + const { data } = clientApi.widget.beszel.getSystemStats.useQuery({ + integrationIds: [innerProps.integrationId], + systemId: innerProps.systemId, + timePeriod, + includeDocker: false, + }); const mappers = useMemo( () => ({ diff --git a/packages/widgets/src/docker/component.tsx b/packages/widgets/src/docker/component.tsx index 176168509..625f4cd46 100644 --- a/packages/widgets/src/docker/component.tsx +++ b/packages/widgets/src/docker/component.tsx @@ -198,7 +198,7 @@ export default function DockerWidget({ options, width, isEditMode }: WidgetCompo acc.memory += safeValue(container.memoryUsage); return acc; }, - { cpu: 0, memory: 0 } + { cpu: 0, memory: 0 }, ); }, [containers]); @@ -274,7 +274,7 @@ export default function DockerWidget({ options, width, isEditMode }: WidgetCompo {t("table.totalCpu", { cpu: totals.cpu.toFixed(2) })} - + {t("table.totalMemory", { memory: humanFileSize(totals.memory) })}