diff --git a/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx b/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx index 121e0a58..5ee16461 100644 --- a/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx +++ b/src/app/[orgId]/settings/resources/[resourceId]/rules/page.tsx @@ -352,10 +352,8 @@ export default function ResourceRules(props: { updateRule(row.original.ruleId, { action: value }) } > - - {row.original.action === "ACCEPT" - ? RuleAction.ACCEPT - : RuleAction.DROP} + + @@ -376,12 +374,8 @@ export default function ResourceRules(props: { updateRule(row.original.ruleId, { match: value }) } > - - {row.original.match === "IP" - ? RuleMatch.IP - : row.original.match === "CIDR" - ? RuleMatch.CIDR - : RuleMatch.PATH} + + {RuleMatch.IP} @@ -436,7 +430,7 @@ export default function ResourceRules(props: { return ( - + About Rules diff --git a/src/app/[orgId]/settings/sites/CreateSiteForm.tsx b/src/app/[orgId]/settings/sites/CreateSiteForm.tsx index 6df144ca..98fcc2a6 100644 --- a/src/app/[orgId]/settings/sites/CreateSiteForm.tsx +++ b/src/app/[orgId]/settings/sites/CreateSiteForm.tsx @@ -38,7 +38,16 @@ import { SiteRow } from "./SitesTable"; import { AxiosResponse } from "axios"; import { Button } from "@app/components/ui/button"; import Link from "next/link"; -import { ArrowUpRight, SquareArrowOutUpRight } from "lucide-react"; +import { + ArrowUpRight, + ChevronsUpDown, + SquareArrowOutUpRight +} from "lucide-react"; +import { + Collapsible, + CollapsibleContent, + CollapsibleTrigger +} from "@app/components/ui/collapsible"; const createSiteFormSchema = z.object({ name: z @@ -78,6 +87,8 @@ export default function CreateSiteForm({ const [isLoading, setIsLoading] = useState(false); const [isChecked, setIsChecked] = useState(false); + const [isOpen, setIsOpen] = useState(false); + const [keypair, setKeypair] = useState<{ publicKey: string; privateKey: string; @@ -182,10 +193,9 @@ export default function CreateSiteForm({ } const res = await api - .put>( - `/org/${orgId}/site/`, - payload - ) + .put< + AxiosResponse + >(`/org/${orgId}/site/`, payload) .catch((e) => { toast({ variant: "destructive", @@ -235,6 +245,18 @@ PersistentKeepalive = 5` const newtConfig = `newt --id ${siteDefaults?.newtId} --secret ${siteDefaults?.newtSecret} --endpoint ${env.app.dashboardUrl}`; + const newtConfigDockerCompose = `services: + newt: + image: fosrl/newt + container_name: newt + restart: unless-stopped + environment: + - PANGOLIN_ENDPOINT=${env.app.dashboardUrl} + - NEWT_ID=${siteDefaults?.newtId} + - NEWT_SECRET=${siteDefaults?.newtSecret}`; + + const newtConfigDockerRun = `docker run -it fosrl/newt --id ${siteDefaults?.newtId} --secret ${siteDefaults?.newtSecret} --endpoint ${env.app.dashboardUrl}`; + return (
@@ -305,32 +327,6 @@ PersistentKeepalive = 5` )} /> -
- {form.watch("method") === "wireguard" && !isLoading ? ( - <> - - - You will only be able to see the - configuration once. - - - ) : form.watch("method") === "wireguard" && - isLoading ? ( -

Loading WireGuard configuration...

- ) : form.watch("method") === "newt" ? ( - <> - - - You will only be able to see the - configuration once. - - - ) : null} -
- {form.watch("method") === "newt" && ( )} +
+ {form.watch("method") === "wireguard" && !isLoading ? ( + <> + + + You will only be able to see the + configuration once. + + + ) : form.watch("method") === "wireguard" && + isLoading ? ( +

Loading WireGuard configuration...

+ ) : form.watch("method") === "newt" ? ( + <> +
+ +
+ +
+
+ + + +
+ +
+ Docker Compose + +
+
+ Docker Run + + +
+
+
+
+ + You will only be able to see the + configuration once. + + + ) : null} +
+ {form.watch("method") === "local" && ( - - {" "} - Local sites do not tunnel, learn more - + Local sites do not tunnel, learn more )}