feat(repositories): expose hostname in snapshot list

This commit is contained in:
colpiche 2026-03-02 17:42:29 +01:00
parent 5775c56bd8
commit 90aafcd04e
3 changed files with 11 additions and 2 deletions

View file

@ -1,6 +1,6 @@
import { useState } from "react";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { Calendar, Clock, Database, HardDrive, Tag, Trash2, X } from "lucide-react";
import { Calendar, Clock, Database, HardDrive, Monitor, Tag, Trash2, X } from "lucide-react";
import { toast } from "sonner";
import { ByteSize } from "~/client/components/bytes-size";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "~/client/components/ui/table";
@ -145,6 +145,7 @@ export const SnapshotsTable = ({ snapshots, repositoryId, backups, listSnapshots
</TableHead>
<TableHead className="uppercase">Snapshot ID</TableHead>
<TableHead className="uppercase">Schedule</TableHead>
<TableHead className="uppercase">Hostname</TableHead>
<TableHead className="uppercase">Date & Time</TableHead>
<TableHead className="uppercase">Size</TableHead>
<TableHead className="uppercase hidden md:table-cell text-right">Duration</TableHead>
@ -198,6 +199,12 @@ export const SnapshotsTable = ({ snapshots, repositoryId, backups, listSnapshots
</span>
</div>
</TableCell>
<TableCell>
<div className="flex items-center gap-2">
<Monitor className="h-4 w-4 text-muted-foreground" />
<span className="text-sm">{snapshot.hostname ?? "-"}</span>
</div>
</TableCell>
<TableCell>
<div className="flex items-center gap-2">
<Calendar className="h-4 w-4 text-muted-foreground" />

View file

@ -58,6 +58,7 @@ export const RepositorySnapshotsTabContent = ({ repository, initialSnapshots, in
return (
snapshot.short_id.toLowerCase().includes(searchLower) ||
snapshot.paths.some((path) => path.toLowerCase().includes(searchLower)) ||
snapshot.hostname?.toLowerCase().includes(searchLower) ||
backup?.name?.toLowerCase().includes(searchLower) ||
backup?.volume?.name?.toLowerCase().includes(searchLower)
);
@ -161,7 +162,7 @@ export const RepositorySnapshotsTabContent = ({ repository, initialSnapshots, in
<Table className="border-t">
<TableBody>
<TableRow>
<TableCell colSpan={5} className="text-center py-12">
<TableCell colSpan={6} className="text-center py-12">
<div className="flex flex-col items-center gap-3">
<p className="text-muted-foreground">No snapshots match your search.</p>
<Button onClick={() => setSearchQuery("")} variant="outline" size="sm">

View file

@ -123,6 +123,7 @@ export const repositoriesController = new Hono()
short_id: snapshot.short_id,
duration,
paths: snapshot.paths,
hostname: snapshot.hostname,
tags: snapshot.tags ?? [],
size: summary?.total_bytes_processed ?? 0,
time: new Date(snapshot.time).getTime(),