diff options
Diffstat (limited to 'frontend/components')
| -rw-r--r-- | frontend/components/history/HistoryView.tsx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/frontend/components/history/HistoryView.tsx b/frontend/components/history/HistoryView.tsx index b01e4c6..d9d3dc2 100644 --- a/frontend/components/history/HistoryView.tsx +++ b/frontend/components/history/HistoryView.tsx | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | import { DriveLogEntry } from "@/lib/drive_types" | 1 | import { DriveLogEntry, isCreateFileEntry, isRenameEntry } from "@/lib/drive_types" |
| 2 | import { DriveHeader } from "@/components/drive/DriveHeader" | 2 | import { DriveHeader } from "@/components/drive/DriveHeader" |
| 3 | import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" | 3 | import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" |
| 4 | import { Button } from "@/components/ui/button" | 4 | import { Button } from "@/components/ui/button" |
| @@ -102,7 +102,7 @@ export function HistoryView({ entries, currentPage, hasNextPage, hasPrevPage, to | |||
| 102 | </TableRow> | 102 | </TableRow> |
| 103 | ) : ( | 103 | ) : ( |
| 104 | entries.map((entry) => ( | 104 | entries.map((entry) => ( |
| 105 | <TableRow key={entry.log_id} className="hover:bg-muted/50"> | 105 | <TableRow key={entry.revision} className="hover:bg-muted/50"> |
| 106 | <TableCell className="font-mono text-sm"> | 106 | <TableCell className="font-mono text-sm"> |
| 107 | {formatDateTime(entry.timestamp)} | 107 | {formatDateTime(entry.timestamp)} |
| 108 | </TableCell> | 108 | </TableCell> |
| @@ -115,19 +115,23 @@ export function HistoryView({ entries, currentPage, hasNextPage, hasPrevPage, to | |||
| 115 | {entry.email} | 115 | {entry.email} |
| 116 | </TableCell> | 116 | </TableCell> |
| 117 | <TableCell className="font-mono text-sm max-w-md truncate"> | 117 | <TableCell className="font-mono text-sm max-w-md truncate"> |
| 118 | {entry.action === "create_file" && entry.blob_id !== "-" ? ( | 118 | {isCreateFileEntry(entry) ? ( |
| 119 | <Link | 119 | <Link |
| 120 | href={`/blob/${entry.blob_id}?filename=${encodeURIComponent(entry.path.split('/').pop() || 'download')}`} | 120 | href={`/blob/${entry.blob_id}?filename=${encodeURIComponent(entry.path.split('/').pop() || 'download')}`} |
| 121 | className="text-blue-600 hover:text-blue-800 hover:underline" | 121 | className="text-blue-600 hover:text-blue-800 hover:underline" |
| 122 | > | 122 | > |
| 123 | {entry.path} | 123 | {entry.path} |
| 124 | </Link> | 124 | </Link> |
| 125 | ) : isRenameEntry(entry) ? ( | ||
| 126 | <span> | ||
| 127 | {entry.old_path} → {entry.new_path} | ||
| 128 | </span> | ||
| 125 | ) : ( | 129 | ) : ( |
| 126 | entry.path | 130 | 'path' in entry ? entry.path : '' |
| 127 | )} | 131 | )} |
| 128 | </TableCell> | 132 | </TableCell> |
| 129 | <TableCell> | 133 | <TableCell> |
| 130 | {formatFileSize(entry.size)} | 134 | {isCreateFileEntry(entry) ? formatFileSize(entry.size) : '-'} |
| 131 | </TableCell> | 135 | </TableCell> |
| 132 | </TableRow> | 136 | </TableRow> |
| 133 | )) | 137 | )) |
