Fix agent display again

This commit is contained in:
Owen
2026-09-16 10:38:52 -04:00
parent 735787b183
commit 17053ac2bd
2 changed files with 16 additions and 9 deletions
+12 -7
View File
@@ -63,6 +63,12 @@ export default function SiteInfoCard({}: SiteInfoCardProps) {
) : null;
if (site.type === "newt") {
// 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 = site.agent == "cli" ? "Pangolin CLI" : "Newt";
const agentVersion = site.agentVersion ?? site.newtVersion;
return (
<Alert>
<AlertDescription>
@@ -79,13 +85,12 @@ export default function SiteInfoCard({}: SiteInfoCardProps) {
<InfoSection>
<InfoSectionTitle>{t("agent")}</InfoSectionTitle>
<InfoSectionContent>
{site.agent == "newt" ? "Newt" : null}
{site.agent == "cli"
? "Pangolin CLI"
: null}{" "}
{site.agentVersion
? `v${site.agentVersion}`
: "-"}
<div className="flex items-center space-x-1">
<span>{agentLabel}</span>
{agentVersion && (
<span>v{agentVersion}</span>
)}
</div>
</InfoSectionContent>
</InfoSection>
{endpointSection}
+4 -2
View File
@@ -373,7 +373,7 @@ export default function SitesTable({
accessorKey: "type",
friendlyName: t("agent"),
header: () => {
return <span className="p-3">{t("type")}</span>;
return <span className="p-3">{t("agent")}</span>;
},
cell: ({ row }) => {
const originalRow = row.original;
@@ -395,7 +395,9 @@ export default function SitesTable({
// Without these fallbacks the badge renders with no label and
// no version at all.
const agentLabel =
originalRow.agent == "cli" ? "Pangolin CLI" : "Newt";
originalRow.agent == "cli"
? "Pangolin CLI"
: "Newt";
const agentVersion =
originalRow.agentVersion ?? originalRow.newtVersion;
return (