fix(release): repair v1.70.0 quality failures (#6279)
* fix(release): repair v1.70.0 quality failures * style: auto-fix lint and format
This commit is contained in:
1 parent
7a768517ef
commit
13c9e5e181
7 files changed
+18
-40
No files matched your search
@@ -105,7 +105,7 @@ export const ManageTourProvider = ({ children, isAdmin }: ManageTourProviderProp
|
||||
content: (
|
||||
<TourStepContent
|
||||
description={t("welcome.description")}
|
||||
documentationHref={createDocumentationLink("/docs/category/management")}
|
||||
documentationHref={createDocumentationLink("/docs/management/boards")}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -21,7 +21,7 @@ export const mediaOrganizerRouter = createTRPCRouter({
|
||||
const results = await Promise.all(
|
||||
ctx.integrations.map(async (integration) => {
|
||||
const innerHandler = mediaOrganizerRequestHandler.handler(integration, { pageSize: input.pageSize });
|
||||
const { data } = await innerHandler.getCachedOrUpdatedDataAsync({ forceUpdate: false });
|
||||
const { data } = await innerHandler.getDataAsync();
|
||||
return {
|
||||
integrationId: integration.id,
|
||||
...data,
|
||||
|
||||
@@ -32,9 +32,6 @@ const integrationAliases: Partial<Record<IntegrationKind, readonly string[]>> =
|
||||
navidrome: ["navidrome"],
|
||||
paperlessNgx: ["paperless-ngx", "paperless"],
|
||||
patchmon: ["patchmon", "patch-mon"],
|
||||
searchCh: ["search-ch"],
|
||||
gitHubContainerRegistry: ["ghcr"],
|
||||
linuxServerIO: ["linuxserver"],
|
||||
coolify: ["coolify"],
|
||||
truenas: ["truenas"],
|
||||
bazarr: ["bazarr"],
|
||||
|
||||
@@ -6,6 +6,7 @@ import { fetchWithTrustedCertificatesAsync } from "@homarr/core/infrastructure/h
|
||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||
|
||||
import type { SessionStore } from "../base/session-store";
|
||||
import type { SynologyDiskRecord, SynologyVolumeRecord } from "./synology-types";
|
||||
import {
|
||||
AUTH_API_NAME,
|
||||
INFO_API_NAME,
|
||||
@@ -23,8 +24,6 @@ import {
|
||||
synologyUpgradeCheckDataSchema,
|
||||
synologyUpgradeStatusDataSchema,
|
||||
synologyUtilizationDataSchema,
|
||||
type SynologyDiskRecord,
|
||||
type SynologyVolumeRecord,
|
||||
} from "./synology-types";
|
||||
|
||||
const logger = createLogger({ module: "synologyClient" });
|
||||
@@ -158,13 +157,7 @@ export class SynologyClient {
|
||||
if (!name) {
|
||||
return null;
|
||||
}
|
||||
return this.mapVolumeRecord(
|
||||
name,
|
||||
volume.size?.used,
|
||||
volume.size?.total,
|
||||
volume.status,
|
||||
volume.display_name,
|
||||
);
|
||||
return this.mapVolumeRecord(name, volume.size?.used, volume.size?.total, volume.status, volume.display_name);
|
||||
})
|
||||
.filter((volume): volume is SynologyVolumeRecord => volume !== null);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { Response } from "undici";
|
||||
import { beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import type { z } from "zod";
|
||||
|
||||
vi.hoisted(() => {
|
||||
process.env.CI = "true";
|
||||
@@ -37,6 +38,7 @@ import { IntegrationResponseError } from "../../base/errors/http/integration-res
|
||||
|
||||
import type { IntegrationSecret } from "../../base/types";
|
||||
import { SynologyIntegration } from "../synology-integration";
|
||||
import type { synologyStorageV2DataSchema, synologyUtilizationDataSchema } from "../synology-types";
|
||||
|
||||
const TEST_URL = "https://synology.example.com:5001";
|
||||
const mockFetch = vi.mocked(fetchWithTrustedCertificatesAsync);
|
||||
@@ -202,8 +204,8 @@ const mockSuccessfulFlow = (options?: {
|
||||
success: boolean;
|
||||
data: Record<string, unknown>;
|
||||
};
|
||||
utilization?: typeof utilizationResponse;
|
||||
storageV2?: typeof storageV2Response;
|
||||
utilization?: { success: boolean; data: z.input<typeof synologyUtilizationDataSchema> };
|
||||
storageV2?: { success: boolean; data: z.input<typeof synologyStorageV2DataSchema> };
|
||||
storageLoadInfo?: typeof storageLoadInfoResponse;
|
||||
}) => {
|
||||
mockFetch.mockImplementation((url) => {
|
||||
@@ -241,9 +243,9 @@ const mockSuccessfulFlow = (options?: {
|
||||
new Response(JSON.stringify({ success: false, error: { code: 103 } }), { status: 200 }),
|
||||
) as unknown as ReturnType<typeof fetchWithTrustedCertificatesAsync>;
|
||||
}
|
||||
return Promise.resolve(new Response(JSON.stringify(options?.storageV2 ?? storageV2Response), { status: 200 })) as unknown as ReturnType<
|
||||
typeof fetchWithTrustedCertificatesAsync
|
||||
>;
|
||||
return Promise.resolve(
|
||||
new Response(JSON.stringify(options?.storageV2 ?? storageV2Response), { status: 200 }),
|
||||
) as unknown as ReturnType<typeof fetchWithTrustedCertificatesAsync>;
|
||||
}
|
||||
|
||||
if (apiName === "SYNO.Core.System" && method === "info" && type === "storage") {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { type CSSProperties } from "react";
|
||||
import type { CSSProperties } from "react";
|
||||
import { RingProgress, ScrollArea, Text, Tooltip } from "@mantine/core";
|
||||
import {
|
||||
IconCircleCheck,
|
||||
@@ -24,13 +24,8 @@ import type { WidgetComponentProps } from "../definition";
|
||||
import classes from "./component.module.css";
|
||||
import { getGridCols, shouldShowComplianceHeroText } from "./layout-utils";
|
||||
import { OsDistributionSection } from "./os-distribution-section";
|
||||
import {
|
||||
resolveStatColor,
|
||||
severityToIconColor,
|
||||
severityToMantineBgColor,
|
||||
severityToMantineColor,
|
||||
type PatchMonStatKey,
|
||||
} from "./stat-colors";
|
||||
import type { PatchMonStatKey } from "./stat-colors";
|
||||
import { resolveStatColor, severityToIconColor, severityToMantineBgColor, severityToMantineColor } from "./stat-colors";
|
||||
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
@@ -83,10 +78,7 @@ const getLayoutMode = (width: number, height: number): LayoutMode => {
|
||||
export default function PatchMonWidget({ integrationIds, options, width, height }: WidgetComponentProps<"patchmon">) {
|
||||
const t = useScopedI18n("widget.patchmon");
|
||||
const integrationId = integrationIds[0] ?? "";
|
||||
const { data: stats } = clientApi.widget.patchmon.getStats.useQuery(
|
||||
{ integrationId },
|
||||
{ staleTime: 60 * 1000 },
|
||||
);
|
||||
const { data: stats } = clientApi.widget.patchmon.getStats.useQuery({ integrationId }, { staleTime: 60 * 1000 });
|
||||
|
||||
if (!stats) return <WidgetEmptyState />;
|
||||
|
||||
@@ -141,8 +133,7 @@ export default function PatchMonWidget({ integrationIds, options, width, height
|
||||
const iconSize = getIconSize(width);
|
||||
const ringSize = getRingSize(width, height, showHeroRingOnly);
|
||||
|
||||
const compliancePercent =
|
||||
stats.totalHosts > 0 ? Math.round((stats.upToDateHosts / stats.totalHosts) * 100) : 100;
|
||||
const compliancePercent = stats.totalHosts > 0 ? Math.round((stats.upToDateHosts / stats.totalHosts) * 100) : 100;
|
||||
const complianceSeverity = resolveStatColor("upToDateHosts", stats.upToDateHosts, colorContext, options);
|
||||
const complianceColor = complianceSeverity === "neutral" ? "blue" : complianceSeverity;
|
||||
|
||||
@@ -242,12 +233,7 @@ export default function PatchMonWidget({ integrationIds, options, width, height
|
||||
style={{ "--stat-bg": severityToMantineBgColor(severity) } as CSSProperties}
|
||||
>
|
||||
{showIcons && (
|
||||
<Icon
|
||||
className={classes.statIcon}
|
||||
size={iconSize}
|
||||
stroke={1.5}
|
||||
color={severityToIconColor(severity)}
|
||||
/>
|
||||
<Icon className={classes.statIcon} size={iconSize} stroke={1.5} color={severityToIconColor(severity)} />
|
||||
)}
|
||||
<span className={classes.statValue}>
|
||||
<Text component="span" fw={700} size="inherit" c={severityToMantineColor(severity)}>
|
||||
|
||||
@@ -137,7 +137,7 @@ function ProtocolCard({ protocol, data }: { protocol: ProtocolKey; data: Traefik
|
||||
|
||||
return (
|
||||
<div className={classes.protocolCard}>
|
||||
<Text className={classes.protocolTitle}>{t(`protocol.${protocol}`)}</Text>
|
||||
<Text className={classes.protocolTitle}>{protocol.toUpperCase()}</Text>
|
||||
<div className={classes.protocolRows}>
|
||||
{rows.map(({ key, icon: Icon, summary }) => (
|
||||
<div key={key} className={classes.protocolRow}>
|
||||
|
||||
Reference in new issue
Block a user