From 6ae5a33acda3686e473b8d6a03950d0baf8c429f Mon Sep 17 00:00:00 2001 From: Nico <47644445+nicotsx@users.noreply.github.com> Date: Wed, 22 Apr 2026 22:13:24 +0200 Subject: [PATCH] chore: remove dead files (#827) --- .fallowrc.json | 20 ++- .../volumes/components/healthchecks-card.tsx | 92 ------------ .../volumes/components/storage-chart.tsx | 133 ------------------ app/server/modules/sso/index.ts | 2 - app/utils/object.ts | 14 -- 5 files changed, 19 insertions(+), 242 deletions(-) delete mode 100644 app/client/modules/volumes/components/healthchecks-card.tsx delete mode 100644 app/client/modules/volumes/components/storage-chart.tsx delete mode 100644 app/server/modules/sso/index.ts delete mode 100644 app/utils/object.ts diff --git a/.fallowrc.json b/.fallowrc.json index 16d48ead..21235b80 100644 --- a/.fallowrc.json +++ b/.fallowrc.json @@ -1,3 +1,21 @@ { - "ignorePatterns": ["node_modules/**", ".output/**", "**/api-client/**", "**/components/ui/**", "**/routeTree.gen.ts"] + "entry": [ + "app/client.tsx", + "app/router.tsx", + "app/server.ts", + "app/server/plugins/bootstrap.ts", + "openapi-ts.config.ts", + "scripts/create-test-files.ts", + "scripts/patch-api-client.ts" + ], + "ignorePatterns": [ + "node_modules/**", + ".output/**", + "**/api-client/**", + "**/components/ui/**", + "**/routeTree.gen.ts", + "apps/docs/**", + "app/client/hooks/use-mobile.ts", + "app/client/hooks/useMinimumDuration.ts" + ] } diff --git a/app/client/modules/volumes/components/healthchecks-card.tsx b/app/client/modules/volumes/components/healthchecks-card.tsx deleted file mode 100644 index de3f6ad2..00000000 --- a/app/client/modules/volumes/components/healthchecks-card.tsx +++ /dev/null @@ -1,92 +0,0 @@ -import { useMutation } from "@tanstack/react-query"; -import { Activity, HeartIcon } from "lucide-react"; -import { toast } from "sonner"; -import { healthCheckVolumeMutation, updateVolumeMutation } from "~/client/api-client/@tanstack/react-query.gen"; -import { OnOff } from "~/client/components/onoff"; -import { Button } from "~/client/components/ui/button"; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/client/components/ui/card"; -import type { Volume } from "~/client/lib/types"; -import { TimeAgo } from "~/client/components/time-ago"; - -type Props = { - volume: Volume; -}; - -export const HealthchecksCard = ({ volume }: Props) => { - const healthcheck = useMutation({ - ...healthCheckVolumeMutation(), - onSuccess: (d) => { - if (d.error) { - toast.error("Health check failed", { description: d.error }); - return; - } - toast.success("Health check completed", { description: "The volume is healthy." }); - }, - onError: (error) => { - toast.error("Health check failed", { description: error.message }); - }, - }); - - const toggleAutoRemount = useMutation({ - ...updateVolumeMutation(), - onSuccess: (d) => { - toast.success("Volume updated", { - description: `Auto remount is now ${d.autoRemount ? "enabled" : "paused"}.`, - }); - }, - onError: (error) => { - toast.error("Update failed", { description: error.message }); - }, - }); - - return ( - - - - - Health Checks - - Monitor and automatically remount volumes on errors to ensure availability. - - -
- {volume.lastError && {volume.lastError}} - {volume.status === "mounted" && Healthy} - {volume.status !== "unmounted" && ( - - Checked - - )} -
- Remount on error - - toggleAutoRemount.mutate({ - path: { shortId: volume.shortId }, - body: { autoRemount: !volume.autoRemount }, - }) - } - disabled={toggleAutoRemount.isPending} - enabledLabel="Enabled" - disabledLabel="Paused" - /> -
-
- {volume.status !== "unmounted" && ( -
- -
- )} -
-
- ); -}; diff --git a/app/client/modules/volumes/components/storage-chart.tsx b/app/client/modules/volumes/components/storage-chart.tsx deleted file mode 100644 index 416e3fe7..00000000 --- a/app/client/modules/volumes/components/storage-chart.tsx +++ /dev/null @@ -1,133 +0,0 @@ -"use client"; - -import { HardDrive, Unplug } from "lucide-react"; -import * as React from "react"; -import { Label, Pie, PieChart } from "recharts"; -import { ByteSize } from "~/client/components/bytes-size"; -import { Card, CardContent, CardHeader, CardTitle } from "~/client/components/ui/card"; -import { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from "~/client/components/ui/chart"; -import type { StatFs } from "~/client/lib/types"; - -type Props = { - statfs: StatFs; -}; - -export function StorageChart({ statfs }: Props) { - const chartData = React.useMemo( - () => [ - { - name: "Used", - value: statfs.used, - fill: "var(--strong-accent)", - }, - { - name: "Free", - value: statfs.free, - fill: "lightgray", - }, - ], - [statfs], - ); - - const chartConfig = {} satisfies ChartConfig; - - const usagePercentage = React.useMemo(() => { - return Math.round((statfs.used / statfs.total) * 100); - }, [statfs]); - - const isEmpty = !statfs.total; - - if (isEmpty) { - return ( - - - - - Storage Usage - - - - -

No storage data available. Mount the volume to see usage statistics.

-
-
- ); - } - - return ( - - - - - Storage Usage - - - -
- - - [, name]} - /> - } - /> - - - - -
-
-
-
- - Total capacity -
- -
- -
-
-
- Used space -
-
- -
-
- -
-
-
- Free space -
-
- -
-
-
-
-
- - - ); -} diff --git a/app/server/modules/sso/index.ts b/app/server/modules/sso/index.ts deleted file mode 100644 index efb2f8a8..00000000 --- a/app/server/modules/sso/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { ssoIntegration } from "./sso.integration"; -export { ssoController } from "./sso.controller"; diff --git a/app/utils/object.ts b/app/utils/object.ts deleted file mode 100644 index 9cbb954a..00000000 --- a/app/utils/object.ts +++ /dev/null @@ -1,14 +0,0 @@ -export function deepClean(obj: T): T { - if (Array.isArray(obj)) { - return obj.map(deepClean).filter((v) => v !== undefined && v !== null && v !== "") as T; - } - - if (obj && typeof obj === "object") { - return Object.entries(obj).reduce((acc, [key, value]) => { - const cleaned = deepClean(value); - if (cleaned !== undefined && cleaned !== "") acc[key as keyof T] = cleaned; - return acc; - }, {} as T); - } - return obj; -}