This commit is contained in:
colpiche 2026-06-02 19:59:31 +02:00 committed by GitHub
commit aa98994eac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 21 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, FolderOpen, 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";
@ -146,6 +146,7 @@ export const SnapshotsTable = ({ snapshots, repositoryId, backups, listSnapshots
</TableHead>
<TableHead className="uppercase">Snapshot ID</TableHead>
<TableHead className="uppercase">Schedule</TableHead>
<TableHead className="uppercase">Source</TableHead>
<TableHead className="uppercase">Date & Time</TableHead>
<TableHead className="uppercase">Size</TableHead>
<TableHead className="uppercase hidden md:table-cell text-right">Duration</TableHead>
@ -199,6 +200,22 @@ export const SnapshotsTable = ({ snapshots, repositoryId, backups, listSnapshots
</span>
</div>
</TableCell>
<TableCell>
<div className="flex flex-col gap-2">
{snapshot.hostname && (
<div className="flex items-center gap-2">
<Monitor className="h-4 w-4 text-muted-foreground" />
<span className="text-sm">{snapshot.hostname ?? "-"}</span>
</div>
)}
{snapshot.paths.map((path) => (
<div key={path} className="flex items-center gap-2 text-muted-foreground min-w-0">
<FolderOpen className="h-3 w-3 text-muted-foreground" />
<span className="text-sm font-mono truncate max-w-sm" title={path}>{path}</span>
</div>
))}
</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

@ -131,6 +131,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(),