From 17053ac2bd97a87620c54b6fdeb40e4251a7d666 Mon Sep 17 00:00:00 2001 From: Owen Date: Wed, 16 Sep 2026 10:38:52 -0400 Subject: [PATCH] Fix agent display again --- src/components/SiteInfoCard.tsx | 19 ++++++++++++------- src/components/SitesTable.tsx | 6 ++++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/components/SiteInfoCard.tsx b/src/components/SiteInfoCard.tsx index f8a1b1fbb..10fd8d8a5 100644 --- a/src/components/SiteInfoCard.tsx +++ b/src/components/SiteInfoCard.tsx @@ -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 ( @@ -79,13 +85,12 @@ export default function SiteInfoCard({}: SiteInfoCardProps) { {t("agent")} - {site.agent == "newt" ? "Newt" : null} - {site.agent == "cli" - ? "Pangolin CLI" - : null}{" "} - {site.agentVersion - ? `v${site.agentVersion}` - : "-"} +
+ {agentLabel} + {agentVersion && ( + v{agentVersion} + )} +
{endpointSection} diff --git a/src/components/SitesTable.tsx b/src/components/SitesTable.tsx index f9d541d3f..6e125d1bd 100644 --- a/src/components/SitesTable.tsx +++ b/src/components/SitesTable.tsx @@ -373,7 +373,7 @@ export default function SitesTable({ accessorKey: "type", friendlyName: t("agent"), header: () => { - return {t("type")}; + return {t("agent")}; }, 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 (