diff --git a/apps/client/app/components/snapshots-table.tsx b/apps/client/app/components/snapshots-table.tsx
index 53be81a..54c040d 100644
--- a/apps/client/app/components/snapshots-table.tsx
+++ b/apps/client/app/components/snapshots-table.tsx
@@ -1,4 +1,5 @@
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 "~/components/bytes-size";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "~/components/ui/table";
@@ -9,9 +10,16 @@ type Snapshot = ListSnapshotsResponse["snapshots"][0];
type Props = {
snapshots: Snapshot[];
+ repositoryName: string;
};
-export const SnapshotsTable = ({ snapshots }: Props) => {
+export const SnapshotsTable = ({ snapshots, repositoryName }: Props) => {
+ const navigate = useNavigate();
+
+ const handleRowClick = (snapshotId: string) => {
+ navigate(`/repositories/${repositoryName}/${snapshotId}`);
+ };
+
return (
@@ -26,7 +34,11 @@ export const SnapshotsTable = ({ snapshots }: Props) => {
{snapshots.map((snapshot) => (
-
+ handleRowClick(snapshot.short_id)}
+ >
diff --git a/apps/client/app/lib/breadcrumbs.ts b/apps/client/app/lib/breadcrumbs.ts
index 699f91e..8c94f25 100644
--- a/apps/client/app/lib/breadcrumbs.ts
+++ b/apps/client/app/lib/breadcrumbs.ts
@@ -23,10 +23,20 @@ export function generateBreadcrumbs(pathname: string, params: Record
{
) : (
<>
-
+
{`Showing ${snapshots.snapshots.length} of ${snapshots.snapshots.length}`}
diff --git a/apps/client/app/modules/details/tabs/files.tsx b/apps/client/app/modules/details/tabs/files.tsx
index 256f1ee..93264ff 100644
--- a/apps/client/app/modules/details/tabs/files.tsx
+++ b/apps/client/app/modules/details/tabs/files.tsx
@@ -26,7 +26,6 @@ export const FilesTabContent = ({ volume }: Props) => {
const [loadingFolders, setLoadingFolders] = useState>(new Set());
const [allFiles, setAllFiles] = useState
) : (
-
+
)}
diff --git a/apps/client/app/routes.ts b/apps/client/app/routes.ts
index 144e30a..7b60ac6 100644
--- a/apps/client/app/routes.ts
+++ b/apps/client/app/routes.ts
@@ -9,5 +9,6 @@ export default [
route("volumes/:name", "./routes/details.tsx"),
route("repositories", "./modules/repositories/routes/repositories.tsx"),
route("repositories/:name", "./modules/repositories/routes/repository-details.tsx"),
+ route("repositories/:name/:snapshotId", "./modules/repositories/routes/snapshot-details.tsx"),
]),
] satisfies RouteConfig;
diff --git a/apps/server/src/modules/repositories/repositories.controller.ts b/apps/server/src/modules/repositories/repositories.controller.ts
index c030649..f08ec5c 100644
--- a/apps/server/src/modules/repositories/repositories.controller.ts
+++ b/apps/server/src/modules/repositories/repositories.controller.ts
@@ -72,13 +72,18 @@ export const repositoriesController = new Hono()
return c.json(response, 200);
})
- .get("/:name/snapshots/:snapshotId/files", listSnapshotFilesDto, validator("query", listSnapshotFilesQuery), async (c) => {
- const { name, snapshotId } = c.req.param();
- const { path } = c.req.valid("query");
+ .get(
+ "/:name/snapshots/:snapshotId/files",
+ listSnapshotFilesDto,
+ validator("query", listSnapshotFilesQuery),
+ async (c) => {
+ const { name, snapshotId } = c.req.param();
+ const { path } = c.req.valid("query");
- const result = await repositoriesService.listSnapshotFiles(name, snapshotId, path);
+ const result = await repositoriesService.listSnapshotFiles(name, snapshotId, path);
- c.header("Cache-Control", "max-age=300, stale-while-revalidate=600");
+ c.header("Cache-Control", "max-age=300, stale-while-revalidate=600");
- return c.json(result, 200);
- });
+ return c.json(result, 200);
+ },
+ );