mirror of
https://github.com/fosrl/pangolin.git
synced 2026-09-17 16:19:48 +02:00
Fix agent display again
This commit is contained in:
@@ -63,6 +63,12 @@ export default function SiteInfoCard({}: SiteInfoCardProps) {
|
|||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
if (site.type === "newt") {
|
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 (
|
return (
|
||||||
<Alert>
|
<Alert>
|
||||||
<AlertDescription>
|
<AlertDescription>
|
||||||
@@ -79,13 +85,12 @@ export default function SiteInfoCard({}: SiteInfoCardProps) {
|
|||||||
<InfoSection>
|
<InfoSection>
|
||||||
<InfoSectionTitle>{t("agent")}</InfoSectionTitle>
|
<InfoSectionTitle>{t("agent")}</InfoSectionTitle>
|
||||||
<InfoSectionContent>
|
<InfoSectionContent>
|
||||||
{site.agent == "newt" ? "Newt" : null}
|
<div className="flex items-center space-x-1">
|
||||||
{site.agent == "cli"
|
<span>{agentLabel}</span>
|
||||||
? "Pangolin CLI"
|
{agentVersion && (
|
||||||
: null}{" "}
|
<span>v{agentVersion}</span>
|
||||||
{site.agentVersion
|
)}
|
||||||
? `v${site.agentVersion}`
|
</div>
|
||||||
: "-"}
|
|
||||||
</InfoSectionContent>
|
</InfoSectionContent>
|
||||||
</InfoSection>
|
</InfoSection>
|
||||||
{endpointSection}
|
{endpointSection}
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ export default function SitesTable({
|
|||||||
accessorKey: "type",
|
accessorKey: "type",
|
||||||
friendlyName: t("agent"),
|
friendlyName: t("agent"),
|
||||||
header: () => {
|
header: () => {
|
||||||
return <span className="p-3">{t("type")}</span>;
|
return <span className="p-3">{t("agent")}</span>;
|
||||||
},
|
},
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const originalRow = row.original;
|
const originalRow = row.original;
|
||||||
@@ -395,7 +395,9 @@ export default function SitesTable({
|
|||||||
// Without these fallbacks the badge renders with no label and
|
// Without these fallbacks the badge renders with no label and
|
||||||
// no version at all.
|
// no version at all.
|
||||||
const agentLabel =
|
const agentLabel =
|
||||||
originalRow.agent == "cli" ? "Pangolin CLI" : "Newt";
|
originalRow.agent == "cli"
|
||||||
|
? "Pangolin CLI"
|
||||||
|
: "Newt";
|
||||||
const agentVersion =
|
const agentVersion =
|
||||||
originalRow.agentVersion ?? originalRow.newtVersion;
|
originalRow.agentVersion ?? originalRow.newtVersion;
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user