diff --git a/src/app/[orgId]/settings/sites/CreateSiteForm.tsx b/src/app/[orgId]/settings/sites/CreateSiteForm.tsx index 61bb61de..3064cfa5 100644 --- a/src/app/[orgId]/settings/sites/CreateSiteForm.tsx +++ b/src/app/[orgId]/settings/sites/CreateSiteForm.tsx @@ -200,8 +200,14 @@ export default function CreateSiteForm({ name: data.name, id: data.siteId, nice: data.niceId.toString(), - mbIn: data.type == "wireguard" || data.type == "newt" ? "0 MB" : "--", - mbOut: data.type == "wireguard" || data.type == "newt" ? "0 MB" : "--", + mbIn: + data.type == "wireguard" || data.type == "newt" + ? "0 MB" + : "--", + mbOut: + data.type == "wireguard" || data.type == "newt" + ? "0 MB" + : "--", orgId: orgId as string, type: data.type as any, online: false @@ -331,31 +337,33 @@ PersistentKeepalive = 5` {form.watch("method") === "newt" && ( - <> -
- - - {" "} - Learn how to install Newt on your system - - - - + + + {" "} + Learn how to install Newt on your system + + + )} {form.watch("method") === "local" && ( - <> -
-

- Data will leave Traefik and go wherever you - want; no tunneling involved. -

- + + + {" "} + Local sites do not tunnel, learn more + + + )} {(form.watch("method") === "newt" || diff --git a/src/app/[orgId]/settings/sites/SitesTable.tsx b/src/app/[orgId]/settings/sites/SitesTable.tsx index c06a10a3..e76203a3 100644 --- a/src/app/[orgId]/settings/sites/SitesTable.tsx +++ b/src/app/[orgId]/settings/sites/SitesTable.tsx @@ -23,7 +23,7 @@ import { useState } from "react"; import CreateSiteForm from "./CreateSiteForm"; import ConfirmDeleteDialog from "@app/components/ConfirmDeleteDialog"; import { useToast } from "@app/hooks/useToast"; -import { formatAxiosError } from "@app/lib/api";; +import { formatAxiosError } from "@app/lib/api"; import { createApiClient } from "@app/lib/api"; import { useEnvContext } from "@app/hooks/useEnvContext"; import CreateSiteFormModal from "./CreateSiteModal"; @@ -146,21 +146,27 @@ export default function SitesTable({ sites, orgId }: SitesTableProps) { }, cell: ({ row }) => { const originalRow = row.original; - - if (originalRow.online) { - return ( - -
- Online -
- ); + if ( + originalRow.type == "newt" || + originalRow.type == "wireguard" + ) { + if (originalRow.online) { + return ( + +
+ Online +
+ ); + } else { + return ( + +
+ Offline +
+ ); + } } else { - return ( - -
- Offline -
- ); + return --; } } }, diff --git a/src/app/[orgId]/settings/sites/[niceId]/SiteInfoCard.tsx b/src/app/[orgId]/settings/sites/[niceId]/SiteInfoCard.tsx index d93b815b..2a05606c 100644 --- a/src/app/[orgId]/settings/sites/[niceId]/SiteInfoCard.tsx +++ b/src/app/[orgId]/settings/sites/[niceId]/SiteInfoCard.tsx @@ -16,37 +16,50 @@ type SiteInfoCardProps = {}; export default function SiteInfoCard({}: SiteInfoCardProps) { const { site, updateSite } = useSiteContext(); + const getConnectionTypeString = (type: string) => { + if (type === "newt") { + return "Newt"; + } else if (type === "wireguard") { + return "WireGuard"; + } else if (type === "local") { + return "Local"; + } else { + return "Unknown"; + } + }; + return ( Site Information - - Status - - {site.online ? ( -
-
- Online -
- ) : ( -
-
- Offline -
- )} -
-
- + {(site.type == "newt" || site.type == "wireguard") && ( + <> + + Status + + {site.online ? ( +
+
+ Online +
+ ) : ( +
+
+ Offline +
+ )} +
+
+ + + + )} Connection Type - {site.type === "newt" - ? "Newt" - : site.type === "wireguard" - ? "WireGuard" - : "Unknown"} + {getConnectionTypeString(site.type)}