Merge pull request #3772 from Hayyan612/fix/site-type-badge-fallback

fix(sites): fall back to newtVersion so the Type badge is never empty
This commit is contained in:
Owen Schwartz
2026-09-16 08:59:07 -04:00
committed by GitHub
+11 -12
View File
@@ -390,22 +390,21 @@ export default function SitesTable({
// it has not checked in yet // it has not checked in yet
return <span>-</span>; return <span>-</span>;
} }
// agent and agentVersion were added after newtVersion, so a
// site still running an older Newt reports only newtVersion.
// Without these fallbacks the badge renders with no label and
// no version at all.
const agentLabel =
originalRow.agent == "cli" ? "Pangolin CLI" : "Newt";
const agentVersion =
originalRow.agentVersion ?? originalRow.newtVersion;
return ( return (
<div className="flex items-center space-x-1"> <div className="flex items-center space-x-1">
<Badge variant="secondary"> <Badge variant="secondary">
<div className="flex items-center space-x-1"> <div className="flex items-center space-x-1">
<span> <span>{agentLabel}</span>
{originalRow.agent == "newt" {agentVersion && (
? "Newt" <span>v{agentVersion}</span>
: null}
{originalRow.agent == "cli"
? "Pangolin CLI"
: null}
</span>
{originalRow.agentVersion && (
<span>
v{originalRow.agentVersion}
</span>
)} )}
</div> </div>
</Badge> </Badge>