Add resource column to hc and remove —

This commit is contained in:
Owen
2026-04-16 17:42:30 -07:00
parent b958537f3e
commit d6c15c8b81
60 changed files with 257 additions and 211 deletions
@@ -22,7 +22,7 @@ import { useParams, useRouter, useSearchParams } from "next/navigation";
import { useEffect, useState, useTransition } from "react";
function formatBytes(bytes: number | null): string {
if (bytes === null || bytes === undefined) return "";
if (bytes === null || bytes === undefined) return "-";
if (bytes === 0) return "0 B";
const units = ["B", "KB", "MB", "GB", "TB"];
const i = Math.floor(Math.log(bytes) / Math.log(1024));
@@ -33,7 +33,7 @@ function formatBytes(bytes: number | null): string {
function formatDuration(startedAt: number, endedAt: number | null): string {
if (endedAt === null || endedAt === undefined) return "Active";
const durationSec = endedAt - startedAt;
if (durationSec < 0) return "";
if (durationSec < 0) return "-";
if (durationSec < 60) return `${durationSec}s`;
if (durationSec < 3600) {
const m = Math.floor(durationSec / 60);
@@ -460,7 +460,7 @@ export default function ConnectionLogsPage() {
}
return (
<span className="whitespace-nowrap">
{row.original.resourceName ?? ""}
{row.original.resourceName ?? "-"}
</span>
);
}
@@ -503,7 +503,7 @@ export default function ConnectionLogsPage() {
}
return (
<span className="whitespace-nowrap">
{row.original.clientName ?? ""}
{row.original.clientName ?? "-"}
</span>
);
}
@@ -538,7 +538,7 @@ export default function ConnectionLogsPage() {
</span>
);
}
return <span></span>;
return <span>-</span>;
}
},
{
@@ -612,23 +612,23 @@ export default function ConnectionLogsPage() {
<div>
<strong>Session ID:</strong>{" "}
<span className="font-mono">
{row.sessionId ?? ""}
{row.sessionId ?? "-"}
</span>
</div>
<div>
<strong>Protocol:</strong>{" "}
{row.protocol?.toUpperCase() ?? ""}
{row.protocol?.toUpperCase() ?? "-"}
</div>
<div>
<strong>Source:</strong>{" "}
<span className="font-mono">
{row.sourceAddr ?? ""}
{row.sourceAddr ?? "-"}
</span>
</div>
<div>
<strong>Destination:</strong>{" "}
<span className="font-mono">
{row.destAddr ?? ""}
{row.destAddr ?? "-"}
</span>
</div>
</div>
@@ -638,7 +638,7 @@ export default function ConnectionLogsPage() {
</div>*/}
{/*<div>
<strong>Resource:</strong>{" "}
{row.resourceName ?? ""}
{row.resourceName ?? "-"}
{row.resourceNiceId && (
<span className="text-muted-foreground ml-1">
({row.resourceNiceId})
@@ -646,7 +646,7 @@ export default function ConnectionLogsPage() {
)}
</div>*/}
<div>
<strong>Site:</strong> {row.siteName ?? ""}
<strong>Site:</strong> {row.siteName ?? "-"}
{row.siteNiceId && (
<span className="text-muted-foreground ml-1">
({row.siteNiceId})
@@ -654,7 +654,7 @@ export default function ConnectionLogsPage() {
)}
</div>
<div>
<strong>Site ID:</strong> {row.siteId ?? ""}
<strong>Site ID:</strong> {row.siteId ?? "-"}
</div>
<div>
<strong>Started At:</strong>{" "}
@@ -662,7 +662,7 @@ export default function ConnectionLogsPage() {
? new Date(
row.startedAt * 1000
).toLocaleString()
: ""}
: "-"}
</div>
<div>
<strong>Ended At:</strong>{" "}
@@ -676,7 +676,7 @@ export default function ConnectionLogsPage() {
</div>
{/*<div>
<strong>Resource ID:</strong>{" "}
{row.siteResourceId ?? ""}
{row.siteResourceId ?? "-"}
</div>*/}
</div>
<div className="space-y-2">
@@ -434,7 +434,7 @@ export default function StreamingDestinationsPage() {
disabled={!isEnterprise}
/>
))}
{/* Add card is always clickable paywall is enforced inside the picker */}
{/* Add card is always clickable - paywall is enforced inside the picker */}
<AddDestinationCard onClick={openCreate} />
</div>
)}