Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function OverviewTab({ events, access }: OverviewTabProps) {
{failures.slice(0, 10).map((failure, index) => (
<TableRow key={`${failure.runId}-${failure.timestamp}-${index}`}>
<TableCell className="font-mono text-xs" title={failure.algorithmId}>{shortId(failure.algorithmId)}</TableCell>
<TableCell className="font-mono text-xs" title={failure.runId}>{shortId(failure.runId)}</TableCell>
<TableCell className="font-mono text-xs" title={failure.runId ?? undefined}>{shortId(failure.runId)}</TableCell>
<TableCell>
<Badge variant="destructive">{failure.event}</Badge>
</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const columns: ColumnDef<DataTableFeatures, RunEvent>[] = [
accessorKey: "runId",
header: "Run",
cell: ({ row }) => (
<span className="font-mono text-xs" title={row.original.runId}>
<span className="font-mono text-xs" title={row.original.runId ?? undefined}>
{shortId(row.original.runId)}
</span>
),
Expand Down Expand Up @@ -68,7 +68,7 @@ export function RunsTab({ events }: { events: RunEvent[] }) {
if (!needle) return true;
return (
event.event.toLowerCase().includes(needle) ||
event.runId.toLowerCase().includes(needle) ||
(event.runId ?? "").toLowerCase().includes(needle) ||
event.algorithmId.toLowerCase().includes(needle)
);
})
Expand Down
2 changes: 1 addition & 1 deletion rads/transparency-portal/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const PDM_URL = import.meta.env.VITE_PDM_URL ?? "https://pdm.r.secure-rads.org";

export interface RunEvent {
algorithmId: string;
runId: string;
runId: string | null;
event: string;
timestamp: string;
receivedAt: string;
Expand Down
3 changes: 2 additions & 1 deletion rads/transparency-portal/src/lib/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ export function formatDateTime(value: string): string {
return Number.isNaN(date.getTime()) ? value : date.toLocaleString();
}

export function shortId(value: string, length = 14): string {
export function shortId(value: string | null | undefined, length = 14): string {
if (!value) return "-";
return value.length <= length ? value : `${value.slice(0, length)}...`;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function OverviewTab({ events, access }: OverviewTabProps) {
{failures.slice(0, 10).map((failure, index) => (
<TableRow key={`${failure.runId}-${failure.timestamp}-${index}`}>
<TableCell className="font-mono text-xs" title={failure.algorithmId}>{shortId(failure.algorithmId)}</TableCell>
<TableCell className="font-mono text-xs" title={failure.runId}>{shortId(failure.runId)}</TableCell>
<TableCell className="font-mono text-xs" title={failure.runId ?? undefined}>{shortId(failure.runId)}</TableCell>
<TableCell>
<Badge variant="destructive">{failure.event}</Badge>
</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const columns: ColumnDef<DataTableFeatures, RunEvent>[] = [
accessorKey: "runId",
header: "Run",
cell: ({ row }) => (
<span className="font-mono text-xs" title={row.original.runId}>
<span className="font-mono text-xs" title={row.original.runId ?? undefined}>
{shortId(row.original.runId)}
</span>
),
Expand Down Expand Up @@ -68,7 +68,7 @@ export function RunsTab({ events }: { events: RunEvent[] }) {
if (!needle) return true;
return (
event.event.toLowerCase().includes(needle) ||
event.runId.toLowerCase().includes(needle) ||
(event.runId ?? "").toLowerCase().includes(needle) ||
event.algorithmId.toLowerCase().includes(needle)
);
})
Expand Down
2 changes: 1 addition & 1 deletion secure/transparency-portal/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const PDM_URL = import.meta.env.VITE_PDM_URL ?? "https://pdm.sr.secure-rads.org"

export interface RunEvent {
algorithmId: string;
runId: string;
runId: string | null;
event: string;
timestamp: string;
receivedAt: string;
Expand Down
3 changes: 2 additions & 1 deletion secure/transparency-portal/src/lib/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ export function formatDateTime(value: string): string {
return Number.isNaN(date.getTime()) ? value : date.toLocaleString();
}

export function shortId(value: string, length = 14): string {
export function shortId(value: string | null | undefined, length = 14): string {
if (!value) return "-";
return value.length <= length ? value : `${value.slice(0, length)}...`;
}

Expand Down
Loading