From 8eb0f245858b28d6c84c02050c5e7cc4e306feab Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Thu, 13 Nov 2025 19:50:46 +0100 Subject: [PATCH] refactor: move api-client to client --- app/client/components/create-repository-dialog.tsx | 2 +- app/client/components/create-repository-form.tsx | 2 +- app/client/components/create-volume-dialog.tsx | 2 +- app/client/components/create-volume-form.tsx | 2 +- app/client/components/directory-browser.tsx | 2 +- app/client/components/empty-state.tsx | 2 +- app/client/components/grid-background.tsx | 6 +++--- app/client/components/layout.tsx | 4 ++-- app/client/components/snapshots-table.tsx | 2 +- app/client/components/volume-file-browser.tsx | 2 +- app/client/hooks/use-system-info.ts | 2 +- app/client/lib/types.ts | 2 +- .../modules/auth/routes/download-recovery-key.tsx | 2 +- app/client/modules/auth/routes/login.tsx | 2 +- app/client/modules/auth/routes/onboarding.tsx | 2 +- .../backups/components/create-schedule-form.tsx | 4 ++-- .../backups/components/snapshot-file-browser.tsx | 2 +- .../backups/components/snapshot-timeline.tsx | 4 ++-- .../modules/backups/routes/backup-details.tsx | 4 ++-- app/client/modules/backups/routes/backups.tsx | 6 +++--- .../modules/backups/routes/create-backup.tsx | 6 +++--- .../components/restore-snapshot-dialog.tsx | 2 +- .../modules/repositories/routes/repositories.tsx | 10 +++++----- .../repositories/routes/repository-details.tsx | 4 ++-- .../repositories/routes/snapshot-details.tsx | 4 ++-- app/client/modules/repositories/tabs/snapshots.tsx | 6 +++--- app/client/modules/settings/routes/settings.tsx | 10 +++++----- .../volumes/components/healthchecks-card.tsx | 4 ++-- .../modules/volumes/routes/volume-details.tsx | 14 +++++++------- app/client/modules/volumes/routes/volumes.tsx | 10 +++++----- app/client/modules/volumes/tabs/docker.tsx | 2 +- app/client/modules/volumes/tabs/info.tsx | 2 +- app/middleware/auth.ts | 2 +- app/root.tsx | 2 +- app/server/index.ts | 8 ++++---- 35 files changed, 71 insertions(+), 71 deletions(-) diff --git a/app/client/components/create-repository-dialog.tsx b/app/client/components/create-repository-dialog.tsx index 972250ac..8a04e44b 100644 --- a/app/client/components/create-repository-dialog.tsx +++ b/app/client/components/create-repository-dialog.tsx @@ -2,12 +2,12 @@ import { useMutation } from "@tanstack/react-query"; import { Plus } from "lucide-react"; import { useId } from "react"; import { toast } from "sonner"; -import { createRepositoryMutation } from "~/api-client/@tanstack/react-query.gen"; import { parseError } from "~/client/lib/errors"; import { CreateRepositoryForm } from "./create-repository-form"; import { Button } from "./ui/button"; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./ui/dialog"; import { ScrollArea } from "./ui/scroll-area"; +import { createRepositoryMutation } from "../api-client/@tanstack/react-query.gen"; type Props = { open: boolean; diff --git a/app/client/components/create-repository-form.tsx b/app/client/components/create-repository-form.tsx index 2a645cae..fb7d8a7b 100644 --- a/app/client/components/create-repository-form.tsx +++ b/app/client/components/create-repository-form.tsx @@ -8,13 +8,13 @@ import { Button } from "./ui/button"; import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "./ui/form"; import { Input } from "./ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./ui/select"; -import { listRcloneRemotesOptions } from "~/api-client/@tanstack/react-query.gen"; import { useQuery } from "@tanstack/react-query"; import { Alert, AlertDescription } from "./ui/alert"; import { ExternalLink } from "lucide-react"; import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip"; import { useSystemInfo } from "~/client/hooks/use-system-info"; import { COMPRESSION_MODES, repositoryConfigSchema } from "~/schemas/restic"; +import { listRcloneRemotesOptions } from "../api-client/@tanstack/react-query.gen"; export const formSchema = type({ name: "2<=string<=32", diff --git a/app/client/components/create-volume-dialog.tsx b/app/client/components/create-volume-dialog.tsx index 0ed77aef..6ad92ca9 100644 --- a/app/client/components/create-volume-dialog.tsx +++ b/app/client/components/create-volume-dialog.tsx @@ -2,12 +2,12 @@ import { useMutation } from "@tanstack/react-query"; import { Plus } from "lucide-react"; import { useId } from "react"; import { toast } from "sonner"; -import { createVolumeMutation } from "~/api-client/@tanstack/react-query.gen"; import { parseError } from "~/client/lib/errors"; import { CreateVolumeForm } from "./create-volume-form"; import { Button } from "./ui/button"; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./ui/dialog"; import { ScrollArea } from "./ui/scroll-area"; +import { createVolumeMutation } from "../api-client/@tanstack/react-query.gen"; type Props = { open: boolean; diff --git a/app/client/components/create-volume-form.tsx b/app/client/components/create-volume-form.tsx index 7b8114ee..527e4e3c 100644 --- a/app/client/components/create-volume-form.tsx +++ b/app/client/components/create-volume-form.tsx @@ -4,7 +4,6 @@ import { type } from "arktype"; import { CheckCircle, Loader2, XCircle } from "lucide-react"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; -import { testConnectionMutation } from "~/api-client/@tanstack/react-query.gen"; import { cn, slugify } from "~/client/lib/utils"; import { deepClean } from "~/utils/object"; import { DirectoryBrowser } from "./directory-browser"; @@ -13,6 +12,7 @@ import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, For import { Input } from "./ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./ui/select"; import { volumeConfigSchema } from "~/schemas/volumes"; +import { testConnectionMutation } from "../api-client/@tanstack/react-query.gen"; export const formSchema = type({ name: "2<=string<=32", diff --git a/app/client/components/directory-browser.tsx b/app/client/components/directory-browser.tsx index 29650f99..dab1d4d5 100644 --- a/app/client/components/directory-browser.tsx +++ b/app/client/components/directory-browser.tsx @@ -1,8 +1,8 @@ import { useQuery, useQueryClient } from "@tanstack/react-query"; import { useCallback, useMemo, useState } from "react"; -import { browseFilesystemOptions } from "~/api-client/@tanstack/react-query.gen"; import { FileTree, type FileEntry } from "./file-tree"; import { ScrollArea } from "./ui/scroll-area"; +import { browseFilesystemOptions } from "../api-client/@tanstack/react-query.gen"; type Props = { onSelectPath: (path: string) => void; diff --git a/app/client/components/empty-state.tsx b/app/client/components/empty-state.tsx index 4acf26f1..41a89aff 100644 --- a/app/client/components/empty-state.tsx +++ b/app/client/components/empty-state.tsx @@ -17,7 +17,7 @@ export function EmptyState(props: EmptyStateProps) {
-
+
diff --git a/app/client/components/grid-background.tsx b/app/client/components/grid-background.tsx index 5f8df115..bac779ea 100644 --- a/app/client/components/grid-background.tsx +++ b/app/client/components/grid-background.tsx @@ -12,9 +12,9 @@ export function GridBackground({ children, className, containerClassName }: Grid
diff --git a/app/client/components/layout.tsx b/app/client/components/layout.tsx index 70caebb2..bc6df0e1 100644 --- a/app/client/components/layout.tsx +++ b/app/client/components/layout.tsx @@ -2,7 +2,6 @@ import { useMutation } from "@tanstack/react-query"; import { LifeBuoy } from "lucide-react"; import { Outlet, redirect, useNavigate } from "react-router"; import { toast } from "sonner"; -import { logoutMutation } from "~/api-client/@tanstack/react-query.gen"; import { appContext } from "~/context"; import { authMiddleware } from "~/middleware/auth"; import type { Route } from "./+types/layout"; @@ -11,6 +10,7 @@ import { GridBackground } from "./grid-background"; import { Button } from "./ui/button"; import { SidebarProvider, SidebarTrigger } from "./ui/sidebar"; import { AppSidebar } from "./app-sidebar"; +import { logoutMutation } from "../api-client/@tanstack/react-query.gen"; export const clientMiddleware = [authMiddleware]; @@ -42,7 +42,7 @@ export default function Layout({ loaderData }: Route.ComponentProps) {
-
+
diff --git a/app/client/components/snapshots-table.tsx b/app/client/components/snapshots-table.tsx index 564b5e4a..e1852908 100644 --- a/app/client/components/snapshots-table.tsx +++ b/app/client/components/snapshots-table.tsx @@ -1,10 +1,10 @@ import { Calendar, Clock, Database, FolderTree, HardDrive } from "lucide-react"; import { useNavigate } from "react-router"; -import type { ListSnapshotsResponse } from "~/api-client/types.gen"; import { ByteSize } from "~/client/components/bytes-size"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "~/client/components/ui/table"; import { Tooltip, TooltipContent, TooltipTrigger } from "~/client/components/ui/tooltip"; import { formatDuration } from "~/utils/utils"; +import type { ListSnapshotsResponse } from "../api-client"; type Snapshot = ListSnapshotsResponse[number]; diff --git a/app/client/components/volume-file-browser.tsx b/app/client/components/volume-file-browser.tsx index 6e01f6ed..33c5417d 100644 --- a/app/client/components/volume-file-browser.tsx +++ b/app/client/components/volume-file-browser.tsx @@ -1,8 +1,8 @@ import { useQuery, useQueryClient } from "@tanstack/react-query"; import { FolderOpen } from "lucide-react"; import { useCallback, useMemo, useState } from "react"; -import { listFilesOptions } from "~/api-client/@tanstack/react-query.gen"; import { FileTree } from "~/client/components/file-tree"; +import { listFilesOptions } from "../api-client/@tanstack/react-query.gen"; interface FileEntry { name: string; diff --git a/app/client/hooks/use-system-info.ts b/app/client/hooks/use-system-info.ts index b5e62f3f..852a9015 100644 --- a/app/client/hooks/use-system-info.ts +++ b/app/client/hooks/use-system-info.ts @@ -1,5 +1,5 @@ import { useQuery } from "@tanstack/react-query"; -import { getSystemInfoOptions } from "~/api-client/@tanstack/react-query.gen"; +import { getSystemInfoOptions } from "../api-client/@tanstack/react-query.gen"; export function useSystemInfo() { const { data, isLoading, error } = useQuery({ diff --git a/app/client/lib/types.ts b/app/client/lib/types.ts index 1e304fc8..872d6381 100644 --- a/app/client/lib/types.ts +++ b/app/client/lib/types.ts @@ -4,7 +4,7 @@ import type { GetRepositoryResponse, GetVolumeResponse, ListSnapshotsResponse, -} from "~/api-client"; +} from "../api-client"; export type Volume = GetVolumeResponse["volume"]; export type StatFs = GetVolumeResponse["statfs"]; diff --git a/app/client/modules/auth/routes/download-recovery-key.tsx b/app/client/modules/auth/routes/download-recovery-key.tsx index b42f729c..488de694 100644 --- a/app/client/modules/auth/routes/download-recovery-key.tsx +++ b/app/client/modules/auth/routes/download-recovery-key.tsx @@ -3,7 +3,6 @@ import { AlertTriangle, Download } from "lucide-react"; import { useState } from "react"; import { useNavigate } from "react-router"; import { toast } from "sonner"; -import { downloadResticPasswordMutation } from "~/api-client/@tanstack/react-query.gen"; import { AuthLayout } from "~/client/components/auth-layout"; import { Alert, AlertDescription, AlertTitle } from "~/client/components/ui/alert"; import { Button } from "~/client/components/ui/button"; @@ -11,6 +10,7 @@ import { Input } from "~/client/components/ui/input"; import { Label } from "~/client/components/ui/label"; import { authMiddleware } from "~/middleware/auth"; import type { Route } from "./+types/download-recovery-key"; +import { downloadResticPasswordMutation } from "~/client/api-client/@tanstack/react-query.gen"; export const clientMiddleware = [authMiddleware]; diff --git a/app/client/modules/auth/routes/login.tsx b/app/client/modules/auth/routes/login.tsx index 44b35ff8..29d73084 100644 --- a/app/client/modules/auth/routes/login.tsx +++ b/app/client/modules/auth/routes/login.tsx @@ -4,13 +4,13 @@ import { type } from "arktype"; import { useForm } from "react-hook-form"; import { useNavigate } from "react-router"; import { toast } from "sonner"; -import { loginMutation } from "~/api-client/@tanstack/react-query.gen"; import { AuthLayout } from "~/client/components/auth-layout"; import { Button } from "~/client/components/ui/button"; import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "~/client/components/ui/form"; import { Input } from "~/client/components/ui/input"; import { authMiddleware } from "~/middleware/auth"; import type { Route } from "./+types/login"; +import { loginMutation } from "~/client/api-client/@tanstack/react-query.gen"; export const clientMiddleware = [authMiddleware]; diff --git a/app/client/modules/auth/routes/onboarding.tsx b/app/client/modules/auth/routes/onboarding.tsx index 50e3142c..e14296c8 100644 --- a/app/client/modules/auth/routes/onboarding.tsx +++ b/app/client/modules/auth/routes/onboarding.tsx @@ -4,7 +4,6 @@ import { type } from "arktype"; import { useForm } from "react-hook-form"; import { useNavigate } from "react-router"; import { toast } from "sonner"; -import { registerMutation } from "~/api-client/@tanstack/react-query.gen"; import { Form, FormControl, @@ -19,6 +18,7 @@ import type { Route } from "./+types/onboarding"; import { AuthLayout } from "~/client/components/auth-layout"; import { Input } from "~/client/components/ui/input"; import { Button } from "~/client/components/ui/button"; +import { registerMutation } from "~/client/api-client/@tanstack/react-query.gen"; export const clientMiddleware = [authMiddleware]; diff --git a/app/client/modules/backups/components/create-schedule-form.tsx b/app/client/modules/backups/components/create-schedule-form.tsx index fd6752e8..0f1e3113 100644 --- a/app/client/modules/backups/components/create-schedule-form.tsx +++ b/app/client/modules/backups/components/create-schedule-form.tsx @@ -3,7 +3,7 @@ import { useQuery } from "@tanstack/react-query"; import { type } from "arktype"; import { useCallback, useState } from "react"; import { useForm } from "react-hook-form"; -import { listRepositoriesOptions } from "~/api-client/@tanstack/react-query.gen"; +import { listRepositoriesOptions } from "~/client/api-client/@tanstack/react-query.gen"; import { RepositoryIcon } from "~/client/components/repository-icon"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/client/components/ui/card"; import { @@ -136,7 +136,7 @@ export const CreateScheduleForm = ({ initialValues, formId, onSubmit, volume }:
diff --git a/app/client/modules/backups/components/snapshot-file-browser.tsx b/app/client/modules/backups/components/snapshot-file-browser.tsx index d3942da2..a26ecb3e 100644 --- a/app/client/modules/backups/components/snapshot-file-browser.tsx +++ b/app/client/modules/backups/components/snapshot-file-browser.tsx @@ -1,7 +1,6 @@ import { useCallback, useMemo, useState } from "react"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { FileIcon } from "lucide-react"; -import { listSnapshotFilesOptions, restoreSnapshotMutation } from "~/api-client/@tanstack/react-query.gen"; import { FileTree, type FileEntry } from "~/client/components/file-tree"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/client/components/ui/card"; import { Button } from "~/client/components/ui/button"; @@ -20,6 +19,7 @@ import { import { Tooltip, TooltipContent, TooltipTrigger } from "~/client/components/ui/tooltip"; import type { Snapshot, Volume } from "~/client/lib/types"; import { toast } from "sonner"; +import { listSnapshotFilesOptions, restoreSnapshotMutation } from "~/client/api-client/@tanstack/react-query.gen"; interface Props { snapshot: Snapshot; diff --git a/app/client/modules/backups/components/snapshot-timeline.tsx b/app/client/modules/backups/components/snapshot-timeline.tsx index 57b3b75f..4bdce96c 100644 --- a/app/client/modules/backups/components/snapshot-timeline.tsx +++ b/app/client/modules/backups/components/snapshot-timeline.tsx @@ -1,8 +1,8 @@ -import type { ListSnapshotsResponse } from "~/api-client/types.gen"; import { cn } from "~/client/lib/utils"; import { Card } from "~/client/components/ui/card"; import { ByteSize } from "~/client/components/bytes-size"; import { useEffect } from "react"; +import type { ListSnapshotsResponse } from "~/client/api-client"; interface Props { snapshots: ListSnapshotsResponse; @@ -56,7 +56,7 @@ export const SnapshotTimeline = (props: Props) => {
-
+
{snapshots.map((snapshot, index) => { const date = new Date(snapshot.time); const isSelected = snapshotId === snapshot.short_id; diff --git a/app/client/modules/backups/routes/backup-details.tsx b/app/client/modules/backups/routes/backup-details.tsx index 8e2699c8..fd2b0538 100644 --- a/app/client/modules/backups/routes/backup-details.tsx +++ b/app/client/modules/backups/routes/backup-details.tsx @@ -10,15 +10,15 @@ import { listSnapshotsOptions, updateBackupScheduleMutation, stopBackupMutation, -} from "~/api-client/@tanstack/react-query.gen"; +} from "~/client/api-client/@tanstack/react-query.gen"; import { parseError } from "~/client/lib/errors"; import { getCronExpression } from "~/utils/utils"; import { CreateScheduleForm, type BackupScheduleFormValues } from "../components/create-schedule-form"; import { ScheduleSummary } from "../components/schedule-summary"; -import { getBackupSchedule } from "~/api-client"; import type { Route } from "./+types/backup-details"; import { SnapshotFileBrowser } from "../components/snapshot-file-browser"; import { SnapshotTimeline } from "../components/snapshot-timeline"; +import { getBackupSchedule } from "~/client/api-client"; export function meta(_: Route.MetaArgs) { return [ diff --git a/app/client/modules/backups/routes/backups.tsx b/app/client/modules/backups/routes/backups.tsx index cbdb4690..8337201a 100644 --- a/app/client/modules/backups/routes/backups.tsx +++ b/app/client/modules/backups/routes/backups.tsx @@ -1,13 +1,13 @@ import { useQuery } from "@tanstack/react-query"; import { CalendarClock, Database, HardDrive, Plus } from "lucide-react"; import { Link } from "react-router"; -import { listBackupSchedules } from "~/api-client"; -import { listBackupSchedulesOptions } from "~/api-client/@tanstack/react-query.gen"; import { BackupStatusDot } from "../components/backup-status-dot"; import { EmptyState } from "~/client/components/empty-state"; import { Button } from "~/client/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/client/components/ui/card"; import type { Route } from "./+types/backups"; +import { listBackupSchedules } from "~/client/api-client"; +import { listBackupSchedulesOptions } from "~/client/api-client/@tanstack/react-query.gen"; export function meta(_: Route.MetaArgs) { return [ @@ -68,7 +68,7 @@ export default function Backups({ loaderData }: Route.ComponentProps) {
- + Volume {schedule.volume.name} diff --git a/app/client/modules/backups/routes/create-backup.tsx b/app/client/modules/backups/routes/create-backup.tsx index ed1b68a4..eab8668b 100644 --- a/app/client/modules/backups/routes/create-backup.tsx +++ b/app/client/modules/backups/routes/create-backup.tsx @@ -7,7 +7,7 @@ import { createBackupScheduleMutation, listRepositoriesOptions, listVolumesOptions, -} from "~/api-client/@tanstack/react-query.gen"; +} from "~/client/api-client/@tanstack/react-query.gen"; import { Button } from "~/client/components/ui/button"; import { Card, CardContent } from "~/client/components/ui/card"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "~/client/components/ui/select"; @@ -16,7 +16,7 @@ import { EmptyState } from "~/client/components/empty-state"; import { getCronExpression } from "~/utils/utils"; import { CreateScheduleForm, type BackupScheduleFormValues } from "../components/create-schedule-form"; import type { Route } from "./+types/create-backup"; -import { listRepositories, listVolumes } from "~/api-client"; +import { listRepositories, listVolumes } from "~/client/api-client"; export function meta(_: Route.MetaArgs) { return [ @@ -168,7 +168,7 @@ export default function CreateBackup({ loaderData }: Route.ComponentProps) {
-
+
diff --git a/app/client/modules/repositories/components/restore-snapshot-dialog.tsx b/app/client/modules/repositories/components/restore-snapshot-dialog.tsx index 66b1dfd2..83792bae 100644 --- a/app/client/modules/repositories/components/restore-snapshot-dialog.tsx +++ b/app/client/modules/repositories/components/restore-snapshot-dialog.tsx @@ -2,7 +2,7 @@ import { useMutation } from "@tanstack/react-query"; import { RotateCcw } from "lucide-react"; import { useId, useState } from "react"; import { toast } from "sonner"; -import { restoreSnapshotMutation } from "~/api-client/@tanstack/react-query.gen"; +import { restoreSnapshotMutation } from "~/client/api-client/@tanstack/react-query.gen"; import { parseError } from "~/client/lib/errors"; import { Button } from "~/client/components/ui/button"; import { diff --git a/app/client/modules/repositories/routes/repositories.tsx b/app/client/modules/repositories/routes/repositories.tsx index 7d20f44e..39e3e561 100644 --- a/app/client/modules/repositories/routes/repositories.tsx +++ b/app/client/modules/repositories/routes/repositories.tsx @@ -2,8 +2,8 @@ import { useQuery } from "@tanstack/react-query"; import { Database, RotateCcw } from "lucide-react"; import { useState } from "react"; import { useNavigate } from "react-router"; -import { listRepositories } from "~/api-client/sdk.gen"; -import { listRepositoriesOptions } from "~/api-client/@tanstack/react-query.gen"; +import { listRepositories } from "~/client/api-client/sdk.gen"; +import { listRepositoriesOptions } from "~/client/api-client/@tanstack/react-query.gen"; import { CreateRepositoryDialog } from "~/client/components/create-repository-dialog"; import { RepositoryIcon } from "~/client/components/repository-icon"; import { Button } from "~/client/components/ui/button"; @@ -79,13 +79,13 @@ export default function Repositories({ loaderData }: Route.ComponentProps) {
setSearchQuery(e.target.value)} /> setSearchQuery(e.target.value)} diff --git a/app/client/modules/settings/routes/settings.tsx b/app/client/modules/settings/routes/settings.tsx index 0a748345..35fd8a97 100644 --- a/app/client/modules/settings/routes/settings.tsx +++ b/app/client/modules/settings/routes/settings.tsx @@ -3,11 +3,6 @@ import { Download, KeyRound, User } from "lucide-react"; import { useState } from "react"; import { useNavigate } from "react-router"; import { toast } from "sonner"; -import { - changePasswordMutation, - downloadResticPasswordMutation, - logoutMutation, -} from "~/api-client/@tanstack/react-query.gen"; import { Button } from "~/client/components/ui/button"; import { Card, CardContent, CardDescription, CardTitle } from "~/client/components/ui/card"; import { @@ -23,6 +18,11 @@ import { Input } from "~/client/components/ui/input"; import { Label } from "~/client/components/ui/label"; import { appContext } from "~/context"; import type { Route } from "./+types/settings"; +import { + changePasswordMutation, + downloadResticPasswordMutation, + logoutMutation, +} from "~/client/api-client/@tanstack/react-query.gen"; export function meta(_: Route.MetaArgs) { return [ diff --git a/app/client/modules/volumes/components/healthchecks-card.tsx b/app/client/modules/volumes/components/healthchecks-card.tsx index 2fe27607..49c2e195 100644 --- a/app/client/modules/volumes/components/healthchecks-card.tsx +++ b/app/client/modules/volumes/components/healthchecks-card.tsx @@ -2,7 +2,7 @@ import { useMutation } from "@tanstack/react-query"; import { formatDistanceToNow } from "date-fns"; import { HeartIcon } from "lucide-react"; import { toast } from "sonner"; -import { healthCheckVolumeMutation, updateVolumeMutation } from "~/api-client/@tanstack/react-query.gen"; +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"; @@ -54,7 +54,7 @@ export const HealthchecksCard = ({ volume }: Props) => {
- {volume.lastError && {volume.lastError}} + {volume.lastError && {volume.lastError}} {volume.status === "mounted" && Healthy} {volume.status !== "unmounted" && ( Checked {timeAgo || "never"} diff --git a/app/client/modules/volumes/routes/volume-details.tsx b/app/client/modules/volumes/routes/volume-details.tsx index dd6af630..1c14d9fd 100644 --- a/app/client/modules/volumes/routes/volume-details.tsx +++ b/app/client/modules/volumes/routes/volume-details.tsx @@ -2,12 +2,6 @@ import { useMutation, useQuery } from "@tanstack/react-query"; import { useNavigate, useParams, useSearchParams } from "react-router"; import { toast } from "sonner"; import { useState } from "react"; -import { - deleteVolumeMutation, - getVolumeOptions, - mountVolumeMutation, - unmountVolumeMutation, -} from "~/api-client/@tanstack/react-query.gen"; import { StatusDot } from "~/client/components/status-dot"; import { Button } from "~/client/components/ui/button"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "~/client/components/ui/tabs"; @@ -24,12 +18,18 @@ import { VolumeIcon } from "~/client/components/volume-icon"; import { parseError } from "~/client/lib/errors"; import { cn } from "~/client/lib/utils"; import type { Route } from "./+types/volume-details"; -import { getVolume } from "~/api-client"; import { VolumeInfoTabContent } from "../tabs/info"; import { FilesTabContent } from "../tabs/files"; import { DockerTabContent } from "../tabs/docker"; import { Tooltip, TooltipContent, TooltipTrigger } from "~/client/components/ui/tooltip"; import { useSystemInfo } from "~/client/hooks/use-system-info"; +import { getVolume } from "~/client/api-client"; +import { + deleteVolumeMutation, + getVolumeOptions, + mountVolumeMutation, + unmountVolumeMutation, +} from "~/client/api-client/@tanstack/react-query.gen"; export function meta({ params }: Route.MetaArgs) { return [ diff --git a/app/client/modules/volumes/routes/volumes.tsx b/app/client/modules/volumes/routes/volumes.tsx index 2be1e115..e4bf4f2a 100644 --- a/app/client/modules/volumes/routes/volumes.tsx +++ b/app/client/modules/volumes/routes/volumes.tsx @@ -2,8 +2,6 @@ import { useQuery } from "@tanstack/react-query"; import { HardDrive, RotateCcw } from "lucide-react"; import { useState } from "react"; import { useNavigate } from "react-router"; -import { listVolumes } from "~/api-client"; -import { listVolumesOptions } from "~/api-client/@tanstack/react-query.gen"; import { CreateVolumeDialog } from "~/client/components/create-volume-dialog"; import { EmptyState } from "~/client/components/empty-state"; import { StatusDot } from "~/client/components/status-dot"; @@ -14,6 +12,8 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "~ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "~/client/components/ui/table"; import { VolumeIcon } from "~/client/components/volume-icon"; import type { Route } from "./+types/volumes"; +import { listVolumes } from "~/client/api-client"; +import { listVolumesOptions } from "~/client/api-client/@tanstack/react-query.gen"; export function meta(_: Route.MetaArgs) { return [ @@ -79,13 +79,13 @@ export default function Volumes({ loaderData }: Route.ComponentProps) {
setSearchQuery(e.target.value)} />