Store the cli version for display and handle auto update

This commit is contained in:
Owen
2026-09-14 11:26:07 -04:00
parent 018ee17304
commit b6c048c805
11 changed files with 93 additions and 46 deletions
@@ -74,6 +74,8 @@ export default async function PendingSitesPage(props: PendingSitesPageProps) {
type: site.type as any,
online: site.online,
newtVersion: site.newtVersion || undefined,
agent: site.agent || undefined,
agentVersion: site.agentVersion || undefined,
newtUpdateAvailable: site.newtUpdateAvailable || false,
exitNodeName: site.exitNodeName || undefined,
exitNodeEndpoint: site.exitNodeEndpoint || undefined,
+2
View File
@@ -70,6 +70,8 @@ export default async function SitesPage(props: SitesPageProps) {
type: site.type as any,
online: site.online,
newtVersion: site.newtVersion || undefined,
agent: site.agent || undefined,
agentVersion: site.agentVersion || undefined,
newtUpdateAvailable: site.newtUpdateAvailable || false,
exitNodeName: site.exitNodeName || undefined,
exitNodeEndpoint: site.exitNodeEndpoint || undefined,
+6 -3
View File
@@ -319,13 +319,16 @@ export default function PendingSitesTable({
const originalRow = row.original;
if (originalRow.type === "newt") {
const isCli = originalRow.agent === "cli";
return (
<div className="flex items-center space-x-1">
<Badge variant="secondary">
<div className="flex items-center space-x-1">
<span>Newt</span>
{originalRow.newtVersion && (
<span>v{originalRow.newtVersion}</span>
<span>{isCli ? "CLI" : "Newt"}</span>
{originalRow.agentVersion && (
<span>
v{originalRow.agentVersion}
</span>
)}
</div>
</Badge>
+6 -3
View File
@@ -63,6 +63,7 @@ export default function SiteInfoCard({}: SiteInfoCardProps) {
) : null;
if (site.type === "newt") {
const isCli = site.agent === "cli";
return (
<Alert>
<AlertDescription>
@@ -72,15 +73,17 @@ export default function SiteInfoCard({}: SiteInfoCardProps) {
<InfoSectionTitle>
{t("connectionType")}
</InfoSectionTitle>
<InfoSectionContent>Newt</InfoSectionContent>
<InfoSectionContent>
{isCli ? "CLI" : "Newt"}
</InfoSectionContent>
</InfoSection>
<InfoSection>
<InfoSectionTitle>
{t("newtVersion")}
</InfoSectionTitle>
<InfoSectionContent>
{site.newtVersion
? `v${site.newtVersion}`
{site.agentVersion
? `v${site.agentVersion}`
: "-"}
</InfoSectionContent>
</InfoSection>
+8 -3
View File
@@ -67,6 +67,8 @@ export type SiteRow = {
orgId: string;
type: "newt" | "wireguard" | "local";
newtVersion?: string;
agent?: string;
agentVersion?: string;
newtUpdateAvailable?: boolean;
online?: boolean | null;
address?: string;
@@ -384,14 +386,17 @@ export default function SitesTable({
);
if (originalRow.type === "newt") {
const isCli = originalRow.agent === "cli";
return (
<div className="flex items-center space-x-1">
<Badge variant="secondary">
<div className="flex items-center space-x-1">
<span>Newt</span>
{originalRow.newtVersion && (
<span>
{isCli ? "CLI" : "Newt"}
</span>
{originalRow.agentVersion && (
<span>
v{originalRow.newtVersion}
v{originalRow.agentVersion}
</span>
)}
</div>