From 604e92ab1ea289fa9d6a013f78205c035afa574d Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Fri, 26 Sep 2025 22:07:06 +0200 Subject: [PATCH] refactor: unify layout across tabs --- .../details/components/healthchecks-card.tsx | 67 +++++++++++-------- .../app/modules/details/tabs/backups.tsx | 6 +- .../app/modules/details/tabs/docker.tsx | 54 +++++++++++---- apps/client/app/modules/details/tabs/info.tsx | 16 +++-- 4 files changed, 92 insertions(+), 51 deletions(-) diff --git a/apps/client/app/modules/details/components/healthchecks-card.tsx b/apps/client/app/modules/details/components/healthchecks-card.tsx index 4798f39..616f4c4 100644 --- a/apps/client/app/modules/details/components/healthchecks-card.tsx +++ b/apps/client/app/modules/details/components/healthchecks-card.tsx @@ -1,7 +1,7 @@ import { formatDistanceToNow } from "date-fns"; -import { ScanHeartIcon } from "lucide-react"; +import { HeartIcon } from "lucide-react"; import { Button } from "~/components/ui/button"; -import { Card } from "~/components/ui/card"; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/components/ui/card"; import { Switch } from "~/components/ui/switch"; import type { Volume } from "~/lib/types"; import { cn } from "~/lib/utils"; @@ -16,34 +16,45 @@ export const HealthchecksCard = ({ volume }: Props) => { }); return ( - -
- - -

Health Checks

-
- {volume.lastError && {volume.lastError}} - {volume.status === "mounted" && Healthy} - {volume.status !== "unmounted" && ( - Checked {timeAgo || "never"} - )} + + + + + Health Checks + + Monitor and automatically remount volumes on errors to ensure availability. + + +
+ {volume.lastError && {volume.lastError}} + {volume.status === "mounted" && Healthy} + {volume.status !== "unmounted" && ( + Checked {timeAgo || "never"} + )} - - Remount on error -
- {volume.autoRemount ? "Enabled" : "Paused"} - {}} /> + + Remount on error +
+ {volume.autoRemount ? "Enabled" : "Paused"} + {}} /> +
+
+
+ {volume.status !== "unmounted" && ( +
+
-
-
- + )} +
); }; diff --git a/apps/client/app/modules/details/tabs/backups.tsx b/apps/client/app/modules/details/tabs/backups.tsx index 6debd03..c387689 100644 --- a/apps/client/app/modules/details/tabs/backups.tsx +++ b/apps/client/app/modules/details/tabs/backups.tsx @@ -134,14 +134,16 @@ export const VolumeBackupsTabContent = ({ volume }: Props) => { }; return ( -
+
Backup automation - Enable scheduled snapshots and off-site replication for this volume. + + Enable scheduled snapshots and off-site replication for this volume. +
{ }, }); + const dockerRunCommand = `docker run -v ${volume.name}:/path/in/container nginx:latest`; + return ( -
- -
- This volume can be used in your Docker Compose files by referencing it as an external volume. The example - demonstrates how to mount the volume to a service (nginx in this case). Make sure to adjust the path inside - the container to fit your application's needs. -
- -
- Alternatively, you can use the following command to run a Docker container with the volume mounted: -
- +
+ + + Plug-and-play Docker integration + + This volume can be used in your Docker Compose files by referencing it as an external volume. The example + demonstrates how to mount the volume to a service (nginx in this case). Make sure to adjust the path inside + the container to fit your application's needs + + + +
+
+
+ +
+
+ Alternatively, you can use the following command to run a Docker container with the volume mounted +
+
+ +
+
+
+
+ +
+ + + Best practices + Validate the automation before enabling it in production. + + + + +
); }; diff --git a/apps/client/app/modules/details/tabs/info.tsx b/apps/client/app/modules/details/tabs/info.tsx index c2b25a5..f124551 100644 --- a/apps/client/app/modules/details/tabs/info.tsx +++ b/apps/client/app/modules/details/tabs/info.tsx @@ -11,15 +11,17 @@ type Props = { export const VolumeInfoTabContent = ({ volume, statfs }: Props) => { return ( -
- +
+ -
- -
-
- +
+
+ +
+
+ +
);