Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat(ui): migrate gateway and relay UI to v3 (#7379)
Andrew Huang0d330e0924f1
diff --git a/frontend/src/components/v3/generic/Alert/Alert.stories.tsx b/frontend/src/components/v3/generic/Alert/Alert.stories.tsxindex 2fb1005e6c..b5a17556ff 100644--- a/frontend/src/components/v3/generic/Alert/Alert.stories.tsx+++ b/frontend/src/components/v3/generic/Alert/Alert.stories.tsx@@ -28,6 +28,10 @@ const meta = {control: "select",options: ["default", "info", "success", "warning", "danger", "project", "org", "sub-org"]},+ appearance: {+ control: "select",+ options: ["default", "borderless"]+ },children: {table: {disable: true@@ -68,6 +72,26 @@ export const Default: Story = {)};+export const Borderless: Story = {+ name: "Appearance: Borderless",+ args: {+ appearance: "borderless"+ },+ parameters: {+ docs: {+ description: {+ story: "Use this appearance for alerts that should not render a border."+ }+ }+ },+ render: (args) => (+ <Alert {...args}>+ <AlertTitle>Your changes have been saved.</AlertTitle>+ <AlertDescription>The new configuration will apply on the next sync.</AlertDescription>+ </Alert>+ )+};+export const Info: Story = {name: "Variant: Info",args: {diff --git a/frontend/src/components/v3/generic/Alert/Alert.tsx b/frontend/src/components/v3/generic/Alert/Alert.tsxindex ee4e88fed1..a567e34bd6 100644--- a/frontend/src/components/v3/generic/Alert/Alert.tsx+++ b/frontend/src/components/v3/generic/Alert/Alert.tsx@@ -6,22 +6,33 @@ import { cva, type VariantProps } from "cva";import { cn } from "../../utils";const alertVariants = cva(- "relative w-full rounded-md border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",+ "relative grid min-h-9 w-full grid-cols-[0_1fr] items-center gap-y-1 rounded-md border px-3 py-2.5 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:text-current",{variants: {variant: {- default: "bg-container text-foreground/75 border-border",- info: "bg-info/5 text-info border-info/20",- success: "bg-success/5 text-success border-success/20",- warning: "bg-warning/5 text-warning border-warning/20",- danger: "bg-danger/5 text-danger border-danger/20",- project: "bg-project/5 text-project border-project/20",- org: "bg-org/5 text-org border-org/20",- "sub-org": "bg-sub-org/5 text-sub-org border-sub-org/20"+ default:+ "border-border bg-container text-foreground [&_[data-slot=alert-description]]:text-foreground/80",+ info: "border-info/20 bg-info/5 text-info [&_[data-slot=alert-description]]:text-info/80",+ success:+ "border-success/20 bg-success/5 text-success [&_[data-slot=alert-description]]:text-success/80",+ warning:+ "border-warning/20 bg-warning/5 text-warning [&_[data-slot=alert-description]]:text-warning/80",+ danger:+ "border-danger/20 bg-danger/5 text-danger [&_[data-slot=alert-description]]:text-danger/80",+ project:+ "border-project/20 bg-project/5 text-project [&_[data-slot=alert-description]]:text-project/80",+ org: "border-org/20 bg-org/5 text-org [&_[data-slot=alert-description]]:text-org/80",+ "sub-org":+ "border-sub-org/20 bg-sub-org/5 text-sub-org [&_[data-slot=alert-description]]:text-sub-org/80"+ },+ appearance: {+ default: "",+ borderless: "border-0"}},defaultVariants: {- variant: "default"+ variant: "default",+ appearance: "default"}});@@ -29,13 +40,14 @@ const alertVariants = cva(function Alert({className,variant,+ appearance,...props}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {return (<divdata-slot="alert"role="alert"- className={cn(alertVariants({ variant }), className)}+ className={cn(alertVariants({ variant, appearance }), className)}{...props}/>);@@ -45,7 +57,7 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {return (<divdata-slot="alert-title"- className={cn("col-start-2 line-clamp-1 min-h-4 tracking-tight text-foreground", className)}+ className={cn("col-start-2 line-clamp-1 min-h-4 text-sm font-medium", className)}{...props}/>);@@ -55,10 +67,7 @@ function AlertDescription({ className, ...props }: React.ComponentProps<"div">)return (<divdata-slot="alert-description"- className={cn(- "col-start-2 grid justify-items-start gap-1 text-xs text-foreground/75 [&_p]:leading-relaxed",- className- )}+ className={cn("col-start-2 grid justify-items-start gap-1 text-sm", className)}{...props}/>);diff --git a/frontend/src/components/v3/generic/AlertDialog/AlertDialog.stories.tsx b/frontend/src/components/v3/generic/AlertDialog/AlertDialog.stories.tsxindex cd8f034aaa..909c611286 100644--- a/frontend/src/components/v3/generic/AlertDialog/AlertDialog.stories.tsx+++ b/frontend/src/components/v3/generic/AlertDialog/AlertDialog.stories.tsx@@ -156,7 +156,7 @@ export const SmallSize: Story = {docs: {description: {story:- 'Pass `size="sm"` to `AlertDialogContent` for a compact dialog — header content is center-aligned and footer actions split into a two-column grid. Use for short, single-sentence confirmations.'+ 'Pass `size="sm"` to `AlertDialogContent` for a compact dialog — header content remains left-aligned and footer actions split into a two-column grid. Use for short, single-sentence confirmations.'}}},diff --git a/frontend/src/components/v3/generic/AlertDialog/AlertDialog.tsx b/frontend/src/components/v3/generic/AlertDialog/AlertDialog.tsxindex 6e1e990189..035f4175e4 100644--- a/frontend/src/components/v3/generic/AlertDialog/AlertDialog.tsx+++ b/frontend/src/components/v3/generic/AlertDialog/AlertDialog.tsx@@ -5,6 +5,7 @@ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";import { cn } from "../../utils";import { Button } from "../Button";+import { DIALOG_CONTENT_WIDTH_CLASSNAME } from "../Dialog";function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;@@ -50,7 +51,8 @@ function AlertDialogContent({data-slot="alert-dialog-content"data-size={size}className={cn(- "group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg bg-popover p-4 text-foreground ring-1 ring-foreground/10 duration-100 outline-none data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-md",+ "group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg bg-popover p-4 text-foreground ring-1 ring-foreground/10 duration-100 outline-none data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",+ DIALOG_CONTENT_WIDTH_CLASSNAME,className)}{...props}@@ -64,7 +66,7 @@ function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">)<divdata-slot="alert-dialog-header"className={cn(- "grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-cols-[auto_1fr] sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",+ "grid grid-rows-[auto_1fr] place-items-start gap-3 text-left text-balance has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-cols-[auto_1fr] sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",className)}{...props}@@ -77,7 +79,7 @@ function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">)<divdata-slot="alert-dialog-footer"className={cn(- "-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t border-border px-4 py-3 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",+ "-mx-4 -mb-4 flex flex-row flex-wrap justify-end gap-2 rounded-b-xl border-t border-border px-4 py-3 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2",className)}{...props}@@ -106,7 +108,7 @@ function AlertDialogTitle({<AlertDialogPrimitive.Titledata-slot="alert-dialog-title"className={cn(- "text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",+ "text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",className)}{...props}@@ -130,6 +132,12 @@ function AlertDialogDescription({);}+function AlertDialogConfirmationField({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div data-slot="alert-dialog-confirmation-field" className={cn("mt-4", className)} {...props} />+ );+}+function AlertDialogAction({className,variant = "outline",@@ -186,6 +194,7 @@ export {AlertDialog,AlertDialogAction,AlertDialogCancel,+ AlertDialogConfirmationField,AlertDialogContent,AlertDialogDescription,AlertDialogFooter,diff --git a/frontend/src/components/v3/generic/Badge/Badge.stories.tsx b/frontend/src/components/v3/generic/Badge/Badge.stories.tsxindex 1a717de0b5..db603b013c 100644--- a/frontend/src/components/v3/generic/Badge/Badge.stories.tsx+++ b/frontend/src/components/v3/generic/Badge/Badge.stories.tsx@@ -59,6 +59,10 @@ const meta = {disable: true}},+ iconPosition: {+ control: "select",+ options: ["left", "right", "both"]+ },isSquare: {table: {disable: true@@ -158,6 +162,7 @@ export const Success: Story = {name: "Variant: Success",args: {variant: "success",+ iconPosition: "left",children: (<><CheckIcon />diff --git a/frontend/src/components/v3/generic/Badge/Badge.tsx b/frontend/src/components/v3/generic/Badge/Badge.tsxindex 1100fde58b..d6883dc445 100644--- a/frontend/src/components/v3/generic/Badge/Badge.tsx+++ b/frontend/src/components/v3/generic/Badge/Badge.tsx@@ -6,7 +6,7 @@ import { cn } from "@app/components/v3/utils";const badgeVariants = cva([- "select-none border items-center align-middle rounded-sm h-4.5 px-1.5 text-xs",+ "select-none border items-center align-middle rounded-sm min-h-4.5 px-1.5 py-0.5 text-xs","gap-x-1 [a&,button&]:cursor-pointer inline-flex font-normal","[&>svg]:pointer-events-none [&>svg]:shrink-0 [&>svg]:stroke-[2.25] [&_svg:not([class*='size-'])]:size-3","transition duration-200 ease-in-out"@@ -20,6 +20,11 @@ const badgeVariants = cva(isFullWidth: {true: "w-full justify-center"},+ iconPosition: {+ left: "pl-1",+ right: "pr-1",+ both: "px-1"+ },isSquare: {true: "w-4.5 justify-center px-0.5"},@@ -55,6 +60,7 @@ const Badge = forwardRef<HTMLSpanElement, TBadgeProps>({className,variant,+ iconPosition,asChild = false,isTruncatable = false,isFullWidth = false,@@ -68,7 +74,16 @@ const Badge = forwardRef<HTMLSpanElement, TBadgeProps>(<Compref={ref}data-slot="badge"- className={cn(badgeVariants({ variant, isTruncatable, isFullWidth, isSquare }), className)}+ className={cn(+ badgeVariants({+ variant,+ iconPosition,+ isTruncatable,+ isFullWidth,+ isSquare+ }),+ className+ )}{...props}/>);diff --git a/frontend/src/components/v3/generic/CodeBlock/CodeBlock.stories.tsx b/frontend/src/components/v3/generic/CodeBlock/CodeBlock.stories.tsxnew file mode 100644index 0000000000..557f35d4fc--- /dev/null+++ b/frontend/src/components/v3/generic/CodeBlock/CodeBlock.stories.tsx@@ -0,0 +1,33 @@+import type { Meta, StoryObj } from "@storybook/react-vite";++import { CodeBlock } from "./CodeBlock";++const meta = {+ title: "Generic/CodeBlock",+ component: CodeBlock,+ parameters: { layout: "centered" },+ tags: ["autodocs"],+ decorators: [+ (Story) => (+ <div className="w-[640px]">+ <Story />+ </div>+ )+ ]+} satisfies Meta<typeof CodeBlock>;++export default meta;+type Story = StoryObj<typeof meta>;++export const Default: Story = {+ args: {+ label: "Command",+ value: "infisical gateway start example --enroll-method=token --domain=http://localhost:8080"+ }+};++export const WithoutLabel: Story = {+ args: {+ value: "sudo systemctl start infisical-relay"+ }+};diff --git a/frontend/src/components/v3/generic/CodeBlock/CodeBlock.tsx b/frontend/src/components/v3/generic/CodeBlock/CodeBlock.tsxnew file mode 100644index 0000000000..eca87867eb--- /dev/null+++ b/frontend/src/components/v3/generic/CodeBlock/CodeBlock.tsx@@ -0,0 +1,41 @@+import { cn } from "@app/components/v3/utils";++import { CopyButton } from "../CopyButton";++type CodeBlockProps = React.ComponentProps<"pre"> & {+ value: string;+ label?: React.ReactNode;+ isCopyable?: boolean;+};++const CodeBlock = ({ value, label, isCopyable = true, className, ...props }: CodeBlockProps) => (+ <div+ data-slot="code-block"+ className="max-w-full min-w-0 overflow-hidden rounded-md border border-border bg-container"+ >+ {label && (+ <div className="border-b border-border px-3 py-2 text-xs font-medium text-label">{label}</div>+ )}+ <div className="relative max-w-full min-w-0 overflow-hidden">+ <pre+ className={cn(+ "block thin-scrollbar w-full max-w-full overflow-x-auto p-3 pr-12 font-mono text-xs leading-relaxed whitespace-pre text-foreground",+ className+ )}+ {...props}+ >+ <code>{value}</code>+ </pre>+ {isCopyable && (+ <CopyButton+ value={value}+ ariaLabel={typeof label === "string" ? `Copy ${label.toLowerCase()}` : "Copy code"}+ variant="outline"+ className="absolute top-2 right-2 bg-popover shadow-sm hover:bg-container-hover [&>svg]:size-3"+ />+ )}+ </div>+ </div>+);++export { CodeBlock, type CodeBlockProps };diff --git a/frontend/src/components/v3/generic/CodeBlock/index.ts b/frontend/src/components/v3/generic/CodeBlock/index.tsnew file mode 100644index 0000000000..ca111193d8--- /dev/null+++ b/frontend/src/components/v3/generic/CodeBlock/index.ts@@ -0,0 +1 @@+export * from "./CodeBlock";diff --git a/frontend/src/components/v3/generic/Dialog/Dialog.tsx b/frontend/src/components/v3/generic/Dialog/Dialog.tsxindex c6cc2aab00..4672892c29 100644--- a/frontend/src/components/v3/generic/Dialog/Dialog.tsx+++ b/frontend/src/components/v3/generic/Dialog/Dialog.tsx@@ -6,6 +6,8 @@ import { XIcon } from "lucide-react";import { cn } from "../../utils";+const DIALOG_CONTENT_WIDTH_CLASSNAME = "w-lg max-w-[calc(100%-2rem)]";+function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {return <DialogPrimitive.Root data-slot="dialog" {...props} />;}@@ -55,7 +57,8 @@ function DialogContent({<DialogPrimitive.Contentdata-slot="dialog-content"className={cn(- "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 text-foreground shadow-lg duration-200 outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",+ "fixed top-[50%] left-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border bg-popover p-6 text-foreground shadow-lg duration-200 outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",+ DIALOG_CONTENT_WIDTH_CLASSNAME,className)}onPointerDownOutside={(e) => {@@ -87,7 +90,7 @@ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {return (<divdata-slot="dialog-header"- className={cn("flex flex-col gap-2 text-center sm:text-left", className)}+ className={cn("flex flex-col gap-2 text-left text-balance", className)}{...props}/>);@@ -97,7 +100,7 @@ function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {return (<divdata-slot="dialog-footer"- className={cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)}+ className={cn("flex flex-row flex-wrap justify-end gap-2", className)}{...props}/>);@@ -128,6 +131,7 @@ function DialogDescription({export {Dialog,+ DIALOG_CONTENT_WIDTH_CLASSNAME,DialogClose,DialogContent,DialogDescription,diff --git a/frontend/src/components/v3/generic/Empty/Empty.tsx b/frontend/src/components/v3/generic/Empty/Empty.tsxindex 7289405604..f59ff17122 100644--- a/frontend/src/components/v3/generic/Empty/Empty.tsx+++ b/frontend/src/components/v3/generic/Empty/Empty.tsx@@ -55,7 +55,7 @@ function Empty({<divdata-slot="empty"className={cn(- "flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-md bg-container p-6 text-center text-balance text-foreground shadow-inner md:p-12",+ "flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-md bg-container p-6 text-center text-foreground shadow-inner md:p-12",frame === "none" && "border-dashed border-border",hasFrame && "relative transition-colors duration-200 hover:bg-container-hover",className@@ -141,10 +141,7 @@ function EmptyContent({ className, ...props }: React.ComponentProps<"div">) {return (<divdata-slot="empty-content"- className={cn(- "flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",- className- )}+ className={cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm", className)}{...props}/>);diff --git a/frontend/src/components/v3/generic/Field/Field.tsx b/frontend/src/components/v3/generic/Field/Field.tsxindex f284c48a98..b871d253d7 100644--- a/frontend/src/components/v3/generic/Field/Field.tsx+++ b/frontend/src/components/v3/generic/Field/Field.tsx@@ -92,7 +92,7 @@ function FieldContent({ className, ...props }: React.ComponentProps<"div">) {const fieldLabelVariants = cva(cn(- "group/field-label peer/field-label flex w-fit items-center gap-1.5 border-border text-xs leading-snug text-accent transition-colors duration-75 group-data-[invalid=true]/field:text-danger group-data-[disabled=true]/field:opacity-50",+ "group/field-label peer/field-label flex w-fit items-center gap-1.5 border-border leading-snug text-accent transition-colors duration-75 group-data-[invalid=true]/field:text-danger group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:cursor-pointer has-[>[data-slot=field]]:rounded-md","has-[>[data-slot=field]]:border has-[>[data-slot=field]]:bg-transparent has-[>[data-slot=field]]:hover:bg-container-hover [&>*]:data-[slot=field]:p-2.5 [&>svg]:size-3","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",@@ -110,10 +110,15 @@ const fieldLabelVariants = cva("sub-org":"has-[[data-state=checked]]:border-sub-org/30 has-[[data-state=checked]]:bg-sub-org/5!",pam: "has-[[data-state=checked]]:border-product-pam/30 has-[[data-state=checked]]:bg-product-pam/5!"+ },+ size: {+ default: "text-xs",+ sm: "text-sm font-normal text-label"}},defaultVariants: {- variant: "default"+ variant: "default",+ size: "default"}});@@ -121,12 +126,13 @@ const fieldLabelVariants = cva(function FieldLabel({className,variant,+ size,...props}: React.ComponentProps<typeof Label> & VariantProps<typeof fieldLabelVariants>) {return (<Labeldata-slot="field-label"- className={cn(fieldLabelVariants({ variant }), className)}+ className={cn(fieldLabelVariants({ variant, size }), className)}{...props}/>);@@ -150,7 +156,7 @@ function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {<pdata-slot="field-description"className={cn(- "mt-0.5 text-left text-xs leading-snug font-normal text-muted group-has-[[data-orientation=horizontal]]/field:text-balance [[data-variant=legend]+&]:-mt-1.5",+ "mt-0.5 text-left text-xs leading-snug font-normal text-muted [[data-variant=legend]+&]:-mt-1.5","[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-foreground",className)}diff --git a/frontend/src/components/v3/generic/Table/Table.tsx b/frontend/src/components/v3/generic/Table/Table.tsxindex 9b0a262779..c049da98e2 100644--- a/frontend/src/components/v3/generic/Table/Table.tsx+++ b/frontend/src/components/v3/generic/Table/Table.tsx@@ -91,7 +91,7 @@ function TableHead({data-slot="table-head"className={cn("h-[30px] border-x-0 border-t-0 border-b border-border px-3 text-left align-middle text-xs whitespace-nowrap text-accent select-none [&:has([role=checkbox])]:pr-0",- "has-[>svg]:cursor-pointer [&>svg]:ml-1 [&>svg]:inline-block [&>svg]:size-4",+ "has-[>svg]:cursor-pointer [&>svg]:ml-1 [&>svg]:inline-block [&>svg:not([class*='size-'])]:size-4",isTruncatable && "truncate",className)}@@ -100,6 +100,24 @@ function TableHead({);}+function TableHeadLabel({+ className,+ children,+ trailing,+ ...props+}: React.ComponentProps<"div"> & { trailing?: React.ReactNode }) {+ return (+ <div+ data-slot="table-head-label"+ className={cn("flex min-w-0 items-center gap-1", className)}+ {...props}+ >+ <span className="min-w-0 truncate">{children}</span>+ {trailing}+ </div>+ );+}+function TableCell({className,isTruncatable,@@ -131,4 +149,14 @@ function TableCaption({ className, ...props }: React.ComponentProps<"caption">));}-export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };+export {+ Table,+ TableBody,+ TableCaption,+ TableCell,+ TableFooter,+ TableHead,+ TableHeader,+ TableHeadLabel,+ TableRow+};diff --git a/frontend/src/components/v3/generic/Tooltip/Tooltip.tsx b/frontend/src/components/v3/generic/Tooltip/Tooltip.tsxindex 148393a5e9..8b452a541b 100644--- a/frontend/src/components/v3/generic/Tooltip/Tooltip.tsx+++ b/frontend/src/components/v3/generic/Tooltip/Tooltip.tsx@@ -7,12 +7,14 @@ import { cn } from "../../utils";function TooltipProvider({delayDuration = 0,+ disableHoverableContent = true,...props}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {return (<TooltipPrimitive.Providerdata-slot="tooltip-provider"delayDuration={delayDuration}+ disableHoverableContent={disableHoverableContent}{...props}/>);@@ -42,7 +44,7 @@ function TooltipContent({data-slot="tooltip-content"sideOffset={sideOffset}className={cn(- "z-[70] w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-sm bg-border px-3 py-1.5 text-xs text-pretty text-foreground fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",+ "pointer-events-none z-[70] w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-sm bg-border px-3 py-1.5 text-xs text-pretty text-foreground fade-in-0 select-none zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",className)}{...props}diff --git a/frontend/src/components/v3/generic/index.ts b/frontend/src/components/v3/generic/index.tsindex 4e01526e0c..41426a83fb 100644--- a/frontend/src/components/v3/generic/index.ts+++ b/frontend/src/components/v3/generic/index.ts@@ -9,6 +9,7 @@ export * from "./ButtonGroup";export * from "./Calendar";export * from "./Card";export * from "./Checkbox";+export * from "./CodeBlock";export * from "./ColorPicker";export * from "./Command";export * from "./CopyButton";diff --git a/frontend/src/components/v3/platform/DocumentationLinkBadge/DocumentationLinkBadge.tsx b/frontend/src/components/v3/platform/DocumentationLinkBadge/DocumentationLinkBadge.tsxindex 8a0c1cb981..2328e1036d 100644--- a/frontend/src/components/v3/platform/DocumentationLinkBadge/DocumentationLinkBadge.tsx+++ b/frontend/src/components/v3/platform/DocumentationLinkBadge/DocumentationLinkBadge.tsx@@ -9,7 +9,7 @@ type TDocumentationLinkBadgeProps = {export function DocumentationLinkBadge({ href, className }: TDocumentationLinkBadgeProps) {return (- <Badge variant="info" className={className} asChild>+ <Badge variant="info" iconPosition="right" className={className} asChild><a href={href} target="_blank" rel="noopener noreferrer">Documentation<ExternalLinkIcon />diff --git a/frontend/src/components/v3/platform/OverflowBadgeList/OverflowBadgeList.tsx b/frontend/src/components/v3/platform/OverflowBadgeList/OverflowBadgeList.tsxnew file mode 100644index 0000000000..1eb6cd2e6c--- /dev/null+++ b/frontend/src/components/v3/platform/OverflowBadgeList/OverflowBadgeList.tsx@@ -0,0 +1,234 @@+import { useLayoutEffect, useRef, useState } from "react";++import { Badge, TBadgeProps } from "../../generic/Badge";+import { Popover, PopoverContent, PopoverTrigger } from "../../generic/Popover";+import { Tooltip, TooltipContent, TooltipTrigger } from "../../generic/Tooltip";+import { cn } from "../../utils";++type TOverflowBadgeListProps<T> = {+ items: T[];+ getKey: (item: T) => React.Key;+ getLabel: (item: T) => string;+ getVariant?: (item: T) => TBadgeProps["variant"];+ appearance?: "badge" | "text";+ onItemClick?: (item: T) => void;+ maxBadgeWidth?: number;+ className?: string;+};++type TOverflowLayout = {+ visibleCount: number;+ lastBadgeWidth?: number;+};++export const OverflowBadgeList = <T,>({+ items,+ getKey,+ getLabel,+ getVariant,+ appearance = "badge",+ onItemClick,+ maxBadgeWidth = 160,+ className+}: TOverflowBadgeListProps<T>) => {+ const containerRef = useRef<HTMLDivElement>(null);+ const measurementRef = useRef<HTMLDivElement>(null);+ const [layout, setLayout] = useState<TOverflowLayout>({+ visibleCount: items.length+ });+ const visibleItems = items.slice(0, layout.visibleCount);+ const hiddenCount = Math.max(0, items.length - layout.visibleCount);+ const hiddenItems = items.slice(visibleItems.length);++ useLayoutEffect(() => {+ const container = containerRef.current;+ const measurement = measurementRef.current;+ if (!container || !measurement) return undefined;++ const calculateLayout = () => {+ const availableWidth = container.clientWidth;+ const badgeElements = Array.from(+ measurement.querySelectorAll<HTMLElement>("[data-overflow-badge-measure]")+ );+ const minimumBadgeElement = measurement.querySelector<HTMLElement>(+ "[data-overflow-badge-minimum]"+ );+ const rollupElements = Array.from(+ measurement.querySelectorAll<HTMLElement>("[data-overflow-rollup-measure]")+ );+ const gap = Number.parseFloat(window.getComputedStyle(container).columnGap) || 0;+ const badgeWidths = badgeElements.map((element) => element.getBoundingClientRect().width);+ const minimumBadgeWidth = minimumBadgeElement?.getBoundingClientRect().width ?? 0;+ const rollupWidths = new Map(+ rollupElements.map((element) => [+ Number(element.dataset.overflowRollupMeasure),+ element.getBoundingClientRect().width+ ])+ );++ const fullWidth = badgeWidths.reduce(+ (total, badgeWidth, index) => total + badgeWidth + (index > 0 ? gap : 0),+ 0+ );+ if (fullWidth <= availableWidth) {+ setLayout({ visibleCount: items.length });+ return;+ }++ for (let visibleCount = items.length - 1; visibleCount > 0; visibleCount -= 1) {+ const hiddenItemCount = items.length - visibleCount;+ const rollupWidth = rollupWidths.get(hiddenItemCount) ?? 0;+ const gapsWidth = gap * visibleCount;+ const widthForBadges = availableWidth - rollupWidth - gapsWidth;+ const precedingBadgesWidth = badgeWidths+ .slice(0, visibleCount - 1)+ .reduce((total, width) => total + width, 0);+ const remainingWidth = widthForBadges - precedingBadgesWidth;++ if (remainingWidth >= minimumBadgeWidth) {+ const lastBadgeNaturalWidth = badgeWidths[visibleCount - 1];+ setLayout({+ visibleCount,+ lastBadgeWidth:+ remainingWidth < lastBadgeNaturalWidth ? remainingWidth : lastBadgeNaturalWidth+ });+ return;+ }+ }++ setLayout({ visibleCount: 0 });+ };++ calculateLayout();+ const resizeObserver = new ResizeObserver(calculateLayout);+ resizeObserver.observe(container);++ return () => resizeObserver.disconnect();+ }, [getLabel, getVariant, items, maxBadgeWidth]);++ const renderItem = (item: T, width?: number) => {+ const label = getLabel(item);++ if (appearance === "text") {+ return (+ <Tooltip key={getKey(item)}>+ <TooltipTrigger asChild>+ <button+ type="button"+ className="min-w-0 cursor-pointer truncate text-sm text-foreground underline decoration-muted underline-offset-2 hover:decoration-foreground"+ style={{ maxWidth: width ?? maxBadgeWidth }}+ onClick={(event) => {+ event.stopPropagation();+ onItemClick?.(item);+ }}+ >+ {label}+ </button>+ </TooltipTrigger>+ <TooltipContent>{label}</TooltipContent>+ </Tooltip>+ );+ }++ return (+ <Tooltip key={getKey(item)}>+ <TooltipTrigger asChild>+ <Badge+ variant={getVariant?.(item) ?? "neutral"}+ isTruncatable+ style={{+ maxWidth: width ?? maxBadgeWidth+ }}+ >+ <span>{label}</span>+ </Badge>+ </TooltipTrigger>+ <TooltipContent>{label}</TooltipContent>+ </Tooltip>+ );+ };++ return (+ <div+ ref={containerRef}+ className={cn("relative flex min-w-0 items-center gap-2 overflow-hidden", className)}+ >+ {visibleItems.map((item, index) =>+ renderItem(+ item,+ index === visibleItems.length - 1 && hiddenCount > 0 ? layout.lastBadgeWidth : undefined+ )+ )}+ {hiddenCount > 0 && (+ <Popover>+ <Tooltip>+ <TooltipTrigger asChild>+ <PopoverTrigger asChild>+ <button+ type="button"+ className="shrink-0 cursor-pointer text-xs text-muted transition-colors hover:text-foreground focus-visible:ring-1 focus-visible:ring-accent focus-visible:outline-none"+ onClick={(event) => event.stopPropagation()}+ >+ +{hiddenCount}+ </button>+ </PopoverTrigger>+ </TooltipTrigger>+ <TooltipContent>+ View {hiddenCount} more {hiddenCount === 1 ? "item" : "items"}+ </TooltipContent>+ </Tooltip>+ <PopoverContent+ align="start"+ className="flex w-auto max-w-sm flex-wrap gap-1.5 p-2"+ onClick={(event) => event.stopPropagation()}+ >+ {hiddenItems.map((item) => renderItem(item))}+ </PopoverContent>+ </Popover>+ )}+ <div+ ref={measurementRef}+ aria-hidden+ className="pointer-events-none invisible absolute flex w-max items-center"+ >+ {items.map((item) =>+ appearance === "text" ? (+ <span+ key={getKey(item)}+ data-overflow-badge-measure+ className="truncate text-sm"+ style={{ maxWidth: maxBadgeWidth }}+ >+ {getLabel(item)}+ </span>+ ) : (+ <Badge+ key={getKey(item)}+ data-overflow-badge-measure+ variant={getVariant?.(item) ?? "neutral"}+ isTruncatable+ style={{ maxWidth: maxBadgeWidth }}+ >+ <span>{getLabel(item)}</span>+ </Badge>+ )+ )}+ {appearance === "text" ? (+ <span data-overflow-badge-minimum className="w-6 text-sm" />+ ) : (+ <Badge data-overflow-badge-minimum isTruncatable>+ <span />+ </Badge>+ )}+ {items.map((_, index) => {+ const rollupCount = index + 1;+ return (+ <span key={rollupCount} data-overflow-rollup-measure={rollupCount} className="text-xs">+ +{rollupCount}+ </span>+ );+ })}+ </div>+ </div>+ );+};diff --git a/frontend/src/components/v3/platform/OverflowBadgeList/index.ts b/frontend/src/components/v3/platform/OverflowBadgeList/index.tsnew file mode 100644index 0000000000..c5b11e4d6d--- /dev/null+++ b/frontend/src/components/v3/platform/OverflowBadgeList/index.ts@@ -0,0 +1 @@+export * from "./OverflowBadgeList";diff --git a/frontend/src/components/v3/platform/index.ts b/frontend/src/components/v3/platform/index.tsindex 68def838d7..4b3f876dc9 100644--- a/frontend/src/components/v3/platform/index.ts+++ b/frontend/src/components/v3/platform/index.ts@@ -3,6 +3,7 @@ export * from "./DeleteConfirmDialog";export * from "./DocumentationLinkBadge";export * from "./GatewayPicker";export * from "./IdentityRoleBadges";+export * from "./OverflowBadgeList";export * from "./PageLoader";export * from "./PasswordGenerator";export * from "./PermissionActionSelect";diff --git a/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsx b/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsxindex f29a29ca86..4d273b108a 100644--- a/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsx+++ b/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsx@@ -49,7 +49,7 @@ export const OrganizationLayout = () => {<divclassName={twMerge("flex-1 overflow-x-hidden bg-bunker-800 dark:scheme-dark",- isInsideProject ? "overflow-y-hidden" : "overflow-y-auto px-12 pt-10 pb-4"+ isInsideProject ? "overflow-y-hidden" : "overflow-y-auto px-6 py-10 md:px-12")}><Outlet />diff --git a/frontend/src/layouts/OrganizationLayout/components/NetworkHealthBanner/NetworkHealthBanner.tsx b/frontend/src/layouts/OrganizationLayout/components/NetworkHealthBanner/NetworkHealthBanner.tsxindex b7833031d5..403aa872fc 100644--- a/frontend/src/layouts/OrganizationLayout/components/NetworkHealthBanner/NetworkHealthBanner.tsx+++ b/frontend/src/layouts/OrganizationLayout/components/NetworkHealthBanner/NetworkHealthBanner.tsx@@ -1,15 +1,9 @@import { useMemo, useState } from "react";-import {- faChevronDown,- faChevronUp,- faExclamationTriangle,- faXmark-} from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useQuery } from "@tanstack/react-query";import { Link } from "@tanstack/react-router";+import { ChevronDownIcon, ChevronUpIcon, TriangleAlertIcon, XIcon } from "lucide-react";-import { IconButton } from "@app/components/v2";+import { IconButton } from "@app/components/v3";import { apiRequest } from "@app/config/request";import { useOrganization, useOrgPermission } from "@app/context";import {@@ -53,27 +47,26 @@ type SingleAlertRowProps = {const SingleAlertRow = ({ alert, isChild }: SingleAlertRowProps) => (<div- className={`flex w-full items-center py-2 pr-4 text-sm text-red-200 ${isChild ? "pl-10" : "px-4"}`}+ className={`flex w-full items-center py-2 pr-4 text-sm text-danger ${isChild ? "pl-10" : "px-4"}`}>- {!isChild && (- <FontAwesomeIcon icon={faExclamationTriangle} className="mr-2.5 text-base text-red-400" />- )}+ {!isChild && <TriangleAlertIcon className="mr-2.5 size-4 shrink-0" />}{alert.message}{alert.linkLabel && alert.linkTo && (<Linkto={alert.linkTo}- className="ml-1 cursor-pointer underline underline-offset-2 duration-100 hover:text-red-100"+ className="ml-1 cursor-pointer underline underline-offset-2 duration-100 hover:text-danger/80">{alert.linkLabel}</Link>)}<IconButton- className="ml-auto p-0 text-red-200 hover:text-red-100"- ariaLabel="Dismiss alert"- variant="plain"+ className="ml-auto text-danger hover:text-danger/80"+ aria-label="Dismiss alert"+ variant="ghost"+ size="xs"onClick={alert.onDismiss}>- <FontAwesomeIcon icon={faXmark} />+ <XIcon /></IconButton></div>);@@ -155,40 +148,42 @@ export const NetworkHealthBanner = () => {if (alerts.length === 1) {return (- <div className="w-full border-b border-red-500/50 bg-red-500/20">+ <div className="w-full border-b border-danger/25 bg-danger/10"><SingleAlertRow alert={alerts[0]} /></div>);}return (- <div className="w-full border-b border-red-500/50 bg-red-500/20">- <div className="flex w-full items-center px-4 py-2 text-sm text-red-200">- <FontAwesomeIcon icon={faExclamationTriangle} className="mr-2.5 text-base text-red-400" />+ <div className="w-full border-b border-danger/25 bg-danger/10">+ <div className="flex w-full items-center px-4 py-2 text-sm text-danger">+ <TriangleAlertIcon className="mr-2.5 size-4 shrink-0" /><span className="font-medium">{alerts.length} alerts in your organization require attention.</span><IconButton- className="ml-2 p-0 text-red-200 hover:text-red-100"- ariaLabel={isExpanded ? "Collapse alerts" : "Expand alerts"}- variant="plain"+ className="ml-2 text-danger hover:text-danger/80"+ aria-label={isExpanded ? "Collapse alerts" : "Expand alerts"}+ variant="ghost"+ size="xs"onClick={() => setIsExpanded((prev) => !prev)}>- <FontAwesomeIcon icon={isExpanded ? faChevronUp : faChevronDown} className="text-xs" />+ {isExpanded ? <ChevronUpIcon /> : <ChevronDownIcon />}</IconButton><IconButton- className="ml-auto shrink-0 p-0 text-red-200 hover:text-red-100"- ariaLabel="Dismiss all alerts"- variant="plain"+ className="ml-auto shrink-0 text-danger hover:text-danger/80"+ aria-label="Dismiss all alerts"+ variant="ghost"+ size="xs"onClick={() => alerts.forEach((alert) => alert.onDismiss())}>- <FontAwesomeIcon icon={faXmark} />+ <XIcon /></IconButton></div>{isExpanded && (<div>{alerts.map((alert) => (- <div key={alert.id} className="border-t border-red-500/30">+ <div key={alert.id} className="border-t border-danger/20"><SingleAlertRow alert={alert} isChild /></div>))}diff --git a/frontend/src/layouts/PersonalSettingsLayout/PersonalSettingsLayout.tsx b/frontend/src/layouts/PersonalSettingsLayout/PersonalSettingsLayout.tsxindex 44dcaaba60..2d90c11e3b 100644--- a/frontend/src/layouts/PersonalSettingsLayout/PersonalSettingsLayout.tsx+++ b/frontend/src/layouts/PersonalSettingsLayout/PersonalSettingsLayout.tsx@@ -7,7 +7,7 @@ export const PersonalSettingsLayout = () => {<div className="dark flex h-screen w-full flex-col overflow-x-hidden bg-bunker-800">{!window.isSecureContext && <InsecureConnectionBanner />}<div className="flex grow flex-col overflow-y-hidden md:flex-row">- <main className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-12 pt-10 pb-4 dark:scheme-dark">+ <main className="flex-1 overflow-x-hidden overflow-y-auto bg-bunker-800 px-6 py-10 md:px-12 dark:scheme-dark"><Outlet /></main></div>diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/GatewayDetailsByIDPage.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/GatewayDetailsByIDPage.tsxindex 60ca236578..218b4470d7 100644--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/GatewayDetailsByIDPage.tsx+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/GatewayDetailsByIDPage.tsx@@ -4,8 +4,7 @@ import { Link, useParams } from "@tanstack/react-router";import { ChevronLeftIcon } from "lucide-react";import { OrgPermissionCan } from "@app/components/permissions";-import { EmptyState } from "@app/components/v2";-import { PageLoader } from "@app/components/v3";+import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, PageLoader } from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { useOrganization } from "@app/context";import {@@ -31,7 +30,14 @@ const Page = () => {}if (!gateway) {- return <EmptyState title="Gateway not found" />;+ return (+ <Empty className="border">+ <EmptyHeader>+ <EmptyMedia variant="icon" />+ <EmptyTitle>Gateway not found</EmptyTitle>+ </EmptyHeader>+ </Empty>+ );}return (@@ -46,16 +52,15 @@ const Page = () => {Gateways</Link><GatewayPageHeader gateway={gateway} orgId={orgId} />- <div className="flex flex-col gap-5 lg:flex-row">- <div className="flex w-full flex-col gap-y-5 lg:max-w-[24rem]">+ <div className="grid grid-cols-1 gap-8 lg:grid-cols-[24rem_minmax(0,1fr)]">+ <div className="w-full min-w-0 lg:col-start-1 lg:row-start-1"><GatewayDetailsCard gateway={gateway} /></div>- <div className="flex flex-1 flex-col gap-y-5">+ <div className="flex min-w-0 flex-col gap-y-8 lg:col-start-2 lg:row-start-1"><GatewayDeploySectiongatewayId={gatewayId}gatewayName={gateway.name}authMethod={gateway.authMethod}- isFirstTimeSetup={!gateway.heartbeat}/><GatewayConnectedResourcesSection gatewayId={gatewayId} /></div>diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/AwsStartCommandDialog.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/AwsStartCommandDialog.tsxindex 3d70b5fcaa..bcdf632965 100644--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/AwsStartCommandDialog.tsx+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/AwsStartCommandDialog.tsx@@ -1,37 +1,26 @@import { useMemo, useState } from "react";-import { faCopy, faUpRightFromSquare } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { createNotification } from "@app/components/notifications";import {- Button,- FilterableSelect,- FormControl,- FormLabel,- IconButton,- Input,- Modal,- ModalClose,- ModalContent,- Tab,- TabList,- TabPanel,- Tabs-} from "@app/components/v2";-import { Badge } from "@app/components/v3/generic/Badge";+ CodeBlock,+ Field,+ FieldDescription,+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+ TabsContent+} from "@app/components/v3";import { useGetRelays } from "@app/hooks/api/relays/queries";type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;gatewayId: string;gatewayName: string;};const AUTO_RELAY_OPTION = { id: "_auto", name: "Auto Select Relay" };-// Renders the AWS-method start command. Mirrors EnrollmentTokenDialog.-export const AwsStartCommandDialog = ({ isOpen, onOpenChange, gatewayId, gatewayName }: Props) => {+export const AwsStartCommandContent = ({ gatewayId, gatewayName }: Props) => {const { protocol, hostname, port } = window.location;const portSuffix = port && port !== "80" ? `:${port}` : "";const siteURL = `${protocol}//${hostname}${portSuffix}`;@@ -53,112 +42,46 @@ export const AwsStartCommandDialog = ({ isOpen, onOpenChange, gatewayId, gatewayconst startServiceCommand = `sudo systemctl start ${gatewayName}`;- const copy = (text: string, label: string) => {- navigator.clipboard.writeText(text);- createNotification({ type: "info", text: `${label} copied to clipboard` });- };-return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent- className="max-w-2xl"- title={`Deploy command for ${gatewayName}`}- subTitle="Run the following command on the host where you want to deploy the gateway."- bodyClassName="overflow-visible"- >- <div className="mb-4">- <div className="mb-0.5 flex items-center gap-2">- <FormLabel label="Auth Method" className="mb-0 text-foreground" />- <Badge variant="info">AWS Auth</Badge>- </div>- <p className="mt-1 text-xs text-mineshaft-400">- The host must have AWS credentials whose principal matches your allowlist. To use a- different auth method, update it in the gateway settings.- </p>- </div>- <FormControl- label="Relay"- tooltipText="The relay this gateway should connect through. Auto Select picks a healthy relay and switches to another if it becomes unreachable."- tooltipClassName="max-w-md"- >- <FilterableSelect- value={relay}- onChange={(newValue) =>- setRelay((newValue as { id: string; name: string }) ?? AUTO_RELAY_OPTION)- }- isLoading={isRelaysLoading}- options={[AUTO_RELAY_OPTION, ...(relays || [])]}- placeholder="Select relay..."- getOptionLabel={(option) => option.name}- getOptionValue={(option) => option.id}- />- </FormControl>-- <Tabs defaultValue="cli" className="mt-2">- <TabList>- <Tab value="cli">CLI</Tab>- <Tab value="systemd">CLI (systemd)</Tab>- </TabList>- <TabPanel value="cli">- <div className="flex gap-2">- <Input value={cliCommand} isDisabled />- <IconButton- ariaLabel="copy"- variant="outline_bg"- colorSchema="secondary"- onClick={() => copy(cliCommand, "Command")}- className="w-10"- >- <FontAwesomeIcon icon={faCopy} />- </IconButton>- </div>- </TabPanel>- <TabPanel value="systemd">- <FormLabel label="Installation Command" />- <div className="flex gap-2">- <Input value={systemdInstallCommand} isDisabled />- <IconButton- ariaLabel="copy install"- variant="outline_bg"- colorSchema="secondary"- onClick={() => copy(systemdInstallCommand, "Installation command")}- className="w-10"- >- <FontAwesomeIcon icon={faCopy} />- </IconButton>- </div>- <FormLabel label="Start the Gateway Service" className="mt-4" />- <div className="flex gap-2">- <Input value={startServiceCommand} isDisabled />- <IconButton- ariaLabel="copy start"- variant="outline_bg"- colorSchema="secondary"- onClick={() => copy(startServiceCommand, "Start command")}- className="w-10"- >- <FontAwesomeIcon icon={faCopy} />- </IconButton>- </div>- </TabPanel>- </Tabs>- <a- href="https://infisical.com/docs/cli/overview"- target="_blank"- rel="noreferrer"- className="mt-2 flex h-4 w-fit items-center gap-2 border-b border-mineshaft-400 text-sm text-mineshaft-400 transition-colors hover:border-yellow-400 hover:text-yellow-400"+ <div className="min-w-0 space-y-4">+ <TabsContent value="cli" className="mt-0 min-w-0">+ <CodeBlock value={cliCommand} label="Command" />+ </TabsContent>+ <TabsContent value="systemd" className="mt-0 min-w-0 space-y-4">+ <CodeBlock value={systemdInstallCommand} label="Install service" />+ <CodeBlock value={startServiceCommand} label="Start service" />+ </TabsContent>+ <Field>+ <Select+ value={relay.id}+ onValueChange={(id) =>+ setRelay(+ [AUTO_RELAY_OPTION, ...(relays || [])].find((item) => item.id === id) ||+ AUTO_RELAY_OPTION+ )+ }+ disabled={isRelaysLoading}>- <span>Install the Infisical CLI</span>- <FontAwesomeIcon icon={faUpRightFromSquare} className="size-3" />- </a>- <div className="mt-6 flex items-center">- <ModalClose asChild>- <Button className="mr-4" size="sm" colorSchema="secondary">- Done- </Button>- </ModalClose>- </div>- </ModalContent>- </Modal>+ <SelectTrigger className="w-full">+ <SelectValue placeholder="Select relay" />+ </SelectTrigger>+ <SelectContent>+ {[AUTO_RELAY_OPTION, ...(relays || [])].map((item) => (+ <SelectItem key={item.id} value={item.id}>+ {item.name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ {relay.id !== "_auto" && (+ <FieldDescription>+ * Auto Select chooses a healthy relay and fails over if needed.+ </FieldDescription>+ )}+ </Field>+ <p className="text-xs text-muted">+ Requires AWS credentials matching the configured allowlist.+ </p>+ </div>);};diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/EnrollmentTokenDialog.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/EnrollmentTokenDialog.tsxindex f26260cb09..6523527acd 100644--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/EnrollmentTokenDialog.tsx+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/EnrollmentTokenDialog.tsx@@ -1,41 +1,46 @@-import { useMemo, useState } from "react";-import { faCopy, faUpRightFromSquare } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { useEffect, useMemo, useState } from "react";-import { createNotification } from "@app/components/notifications";import {- Button,- FilterableSelect,- FormControl,- FormLabel,- IconButton,- Input,- Modal,- ModalClose,- ModalContent,- Tab,- TabList,- TabPanel,- Tabs-} from "@app/components/v2";-import { Badge } from "@app/components/v3/generic/Badge";+ Badge,+ CodeBlock,+ Field,+ FieldDescription,+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+ TabsContent+} from "@app/components/v3";import { useGetRelays } from "@app/hooks/api/relays/queries";type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;gatewayName: string;enrollmentToken: string;+ expiresAt: string;+ onCommandDirtyChange: (isDirty: boolean) => void;};const AUTO_RELAY_OPTION = { id: "_auto", name: "Auto Select Relay" };-// Renders the token-method start command after a fresh enrollment token has been minted.-export const EnrollmentTokenDialog = ({- isOpen,- onOpenChange,+const formatTimeRemaining = (expiresAt: string, now: number) => {+ const remainingSeconds = Math.max(0, Math.ceil((new Date(expiresAt).getTime() - now) / 1000));+ if (remainingSeconds === 0) return "Expired";++ const hours = Math.floor(remainingSeconds / 3600);+ const minutes = Math.floor((remainingSeconds % 3600) / 60);+ const seconds = remainingSeconds % 60;++ if (hours > 0) return `${hours}h ${minutes}m remaining`;+ return `${minutes}m ${seconds}s remaining`;+};++// Renders a freshly minted token as inline deployment instructions.+export const EnrollmentTokenContent = ({gatewayName,- enrollmentToken+ enrollmentToken,+ expiresAt,+ onCommandDirtyChange}: Props) => {const { protocol, hostname, port } = window.location;const portSuffix = port && port !== "80" ? `:${port}` : "";@@ -43,8 +48,29 @@ export const EnrollmentTokenDialog = ({const { data: relays, isPending: isRelaysLoading } = useGetRelays();const [relay, setRelay] = useState<{ id: string; name: string }>(AUTO_RELAY_OPTION);+ const [commandRelay, setCommandRelay] = useState<{ id: string; name: string }>(AUTO_RELAY_OPTION);+ const [now, setNow] = useState(Date.now());++ useEffect(() => {+ const timer = window.setInterval(() => setNow(Date.now()), 1000);+ return () => window.clearInterval(timer);+ }, []);++ useEffect(() => {+ setCommandRelay(relay);+ // A newly minted token commits the currently selected relay to the displayed command.+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [enrollmentToken]);- const resolvedRelayName = relay.id === "_auto" ? "" : relay.name;+ const isCommandDirty = relay.id !== commandRelay.id;++ useEffect(() => {+ onCommandDirtyChange(isCommandDirty);+ }, [isCommandDirty, onCommandDirtyChange]);++ const resolvedRelayName = commandRelay.id === "_auto" ? "" : commandRelay.name;+ const expiryLabel = formatTimeRemaining(expiresAt, now);+ const isExpired = expiryLabel === "Expired";const cliCommand = useMemo(() => {const relayPart = resolvedRelayName ? ` --target-relay-name=${resolvedRelayName}` : "";@@ -57,113 +83,63 @@ export const EnrollmentTokenDialog = ({}, [gatewayName, enrollmentToken, resolvedRelayName, siteURL]);const startServiceCommand = `sudo systemctl start ${gatewayName}`;-- const copy = (text: string, label: string) => {- navigator.clipboard.writeText(text);- createNotification({ type: "info", text: `${label} copied to clipboard` });- };+ const commandLabel = (+ <span className="flex w-full items-center justify-between gap-2">+ <span>Command</span>+ <Badge className="tabular-nums" variant={isExpired ? "danger" : "neutral"}>+ {expiryLabel}+ </Badge>+ </span>+ );return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent- className="max-w-2xl"- title={`Deploy command for ${gatewayName}`}- subTitle="Run the following command on the machine where you want to deploy the gateway."- bodyClassName="overflow-visible"- >- <div className="mb-4">- <div className="mb-0.5 flex items-center gap-2">- <FormLabel label="Auth Method" className="mb-0 text-foreground" />- <Badge variant="info">Token Auth</Badge>- </div>- <p className="mt-1 text-xs text-mineshaft-400">- The enrollment token expires in 1 hour and can only be used once. To use a different- auth method, update it in the gateway settings.- </p>- </div>- <FormControl- label="Relay"- tooltipText="The relay this gateway should connect through. Auto Select picks a healthy relay and switches to another if it becomes unreachable."- tooltipClassName="max-w-md"- >- <FilterableSelect- value={relay}- onChange={(newValue) =>- setRelay((newValue as { id: string; name: string }) ?? AUTO_RELAY_OPTION)- }- isLoading={isRelaysLoading}- options={[AUTO_RELAY_OPTION, ...(relays || [])]}- placeholder="Select relay..."- getOptionLabel={(option) => option.name}- getOptionValue={(option) => option.id}- />- </FormControl>-- <Tabs defaultValue="cli" className="mt-2">- <TabList>- <Tab value="cli">CLI</Tab>- <Tab value="systemd">CLI (systemd)</Tab>- </TabList>- <TabPanel value="cli">- <div className="flex gap-2">- <Input value={cliCommand} isDisabled />- <IconButton- ariaLabel="copy"- variant="outline_bg"- colorSchema="secondary"- onClick={() => copy(cliCommand, "Command")}- className="w-10"- >- <FontAwesomeIcon icon={faCopy} />- </IconButton>- </div>- </TabPanel>- <TabPanel value="systemd">- <FormLabel label="Installation Command" />- <div className="flex gap-2">- <Input value={systemdInstallCommand} isDisabled />- <IconButton- ariaLabel="copy install"- variant="outline_bg"- colorSchema="secondary"- onClick={() => copy(systemdInstallCommand, "Installation command")}- className="w-10"- >- <FontAwesomeIcon icon={faCopy} />- </IconButton>- </div>- <FormLabel label="Start the Gateway Service" className="mt-4" />- <div className="flex gap-2">- <Input value={startServiceCommand} isDisabled />- <IconButton- ariaLabel="copy start"- variant="outline_bg"- colorSchema="secondary"- onClick={() => copy(startServiceCommand, "Start command")}- className="w-10"- >- <FontAwesomeIcon icon={faCopy} />- </IconButton>- </div>- </TabPanel>- </Tabs>- <a- href="https://infisical.com/docs/cli/overview"- target="_blank"- rel="noreferrer"- className="mt-2 flex h-4 w-fit items-center gap-2 border-b border-mineshaft-400 text-sm text-mineshaft-400 transition-colors hover:border-yellow-400 hover:text-yellow-400"+ <div className="min-w-0 space-y-4">+ <TabsContent value="cli" className="mt-0 min-w-0">+ <CodeBlock value={cliCommand} label={commandLabel} isCopyable={!isExpired} />+ </TabsContent>+ <TabsContent value="systemd" className="mt-0 min-w-0 space-y-4">+ <CodeBlock+ value={systemdInstallCommand}+ isCopyable={!isExpired}+ label={+ <span className="flex w-full items-center justify-between gap-2">+ <span>Install service</span>+ <Badge className="tabular-nums" variant={isExpired ? "danger" : "neutral"}>+ {expiryLabel}+ </Badge>+ </span>+ }+ />+ <CodeBlock value={startServiceCommand} label="Start service" />+ </TabsContent>+ <Field>+ <Select+ value={relay.id}+ onValueChange={(id) =>+ setRelay(+ [AUTO_RELAY_OPTION, ...(relays || [])].find((item) => item.id === id) ||+ AUTO_RELAY_OPTION+ )+ }+ disabled={isRelaysLoading}>- <span>Install the Infisical CLI</span>- <FontAwesomeIcon icon={faUpRightFromSquare} className="size-3" />- </a>- <div className="mt-6 flex items-center">- <ModalClose asChild>- <Button className="mr-4" size="sm" colorSchema="secondary">- Done- </Button>- </ModalClose>- </div>- </ModalContent>- </Modal>+ <SelectTrigger className="w-full">+ <SelectValue placeholder="Select relay" />+ </SelectTrigger>+ <SelectContent>+ {[AUTO_RELAY_OPTION, ...(relays || [])].map((item) => (+ <SelectItem key={item.id} value={item.id}>+ {item.name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ {relay.id !== "_auto" && (+ <FieldDescription>+ * Auto Select chooses a healthy relay and fails over if needed.+ </FieldDescription>+ )}+ </Field>+ </div>);};diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/GatewayAuthMethodModal.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/GatewayAuthMethodModal.tsxdeleted file mode 100644index 816a2fd7a4..0000000000--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/GatewayAuthMethodModal.tsx+++ /dev/null@@ -1,240 +0,0 @@-import { useEffect } from "react";-import { Controller, useForm } from "react-hook-form";-import { zodResolver } from "@hookform/resolvers/zod";-import { z } from "zod";--import { createNotification } from "@app/components/notifications";-import {- Button,- Dialog,- DialogContent,- DialogDescription,- DialogFooter,- DialogHeader,- DialogTitle,- Field,- FieldContent,- FieldError,- FieldLabel,- FilterableSelect,- Input-} from "@app/components/v3";-import { useOrganization } from "@app/context";-import { useUpdateGateway } from "@app/hooks/api/gateways-v2";-import { GatewayAuthMethodView } from "@app/hooks/api/gateways-v2/types";--type SettableMethod = "aws" | "token";--const METHOD_OPTIONS: { value: SettableMethod; label: string }[] = [- { value: "token", label: "Token Auth" },- { value: "aws", label: "AWS Auth" }-];--const schema = z- .object({- method: z.enum(["aws", "token"]),- stsEndpoint: z.string(),- allowedPrincipalArns: z.string(),- allowedAccountIds: z.string()- })- .superRefine((data, ctx) => {- if (data.method === "aws") {- const hasArns = data.allowedPrincipalArns.trim().length > 0;- const hasAccountIds = data.allowedAccountIds.trim().length > 0;- if (!hasArns && !hasAccountIds) {- const message = "At least one of allowed principal ARNs or allowed account IDs must be set";- ctx.addIssue({- code: z.ZodIssueCode.custom,- path: ["allowedPrincipalArns"],- message- });- ctx.addIssue({- code: z.ZodIssueCode.custom,- path: ["allowedAccountIds"],- message- });- }- }- });--type FormData = z.infer<typeof schema>;--type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;- gatewayId: string;- currentMethod: GatewayAuthMethodView;-};--export const GatewayAuthMethodModal = ({- isOpen,- onOpenChange,- gatewayId,- currentMethod-}: Props) => {- const { mutateAsync: updateGateway, isPending } = useUpdateGateway();- const { isSubOrganization } = useOrganization();-- const initialMethod: SettableMethod = currentMethod.method === "aws" ? "aws" : "token";- const initialAws = currentMethod.method === "aws" ? currentMethod.config : null;-- const {- control,- handleSubmit,- watch,- reset,- formState: { isSubmitting, isDirty }- } = useForm<FormData>({- resolver: zodResolver(schema),- defaultValues: {- method: initialMethod,- stsEndpoint: initialAws?.stsEndpoint ?? "https://sts.amazonaws.com/",- allowedPrincipalArns: initialAws?.allowedPrincipalArns ?? "",- allowedAccountIds: initialAws?.allowedAccountIds ?? ""- }- });-- useEffect(() => {- if (isOpen) {- reset({- method: initialMethod,- stsEndpoint: initialAws?.stsEndpoint ?? "https://sts.amazonaws.com/",- allowedPrincipalArns: initialAws?.allowedPrincipalArns ?? "",- allowedAccountIds: initialAws?.allowedAccountIds ?? ""- });- }- // eslint-disable-next-line react-hooks/exhaustive-deps- }, [isOpen]);-- const method = watch("method");-- const onSubmit = async (form: FormData) => {- try {- if (form.method === "aws") {- await updateGateway({- gatewayId,- authMethod: {- method: "aws",- stsEndpoint: form.stsEndpoint,- allowedPrincipalArns: form.allowedPrincipalArns,- allowedAccountIds: form.allowedAccountIds- }- });- } else {- await updateGateway({ gatewayId, authMethod: { method: "token" } });- }- createNotification({ type: "success", text: "Auth method updated" });- onOpenChange(false);- } catch {- createNotification({ type: "error", text: "Failed to update auth method" });- }- };-- return (- <Dialog open={isOpen} onOpenChange={onOpenChange}>- <DialogContent className="max-w-lg overflow-visible">- <DialogHeader>- <DialogTitle>Edit Auth Method</DialogTitle>- <DialogDescription>- Switch the gateway's auth method or update the current method's config.- </DialogDescription>- </DialogHeader>- <form onSubmit={handleSubmit(onSubmit)} className="space-y-4">- <Controller- control={control}- name="method"- render={({ field }) => {- const selected =- METHOD_OPTIONS.find((o) => o.value === field.value) ?? METHOD_OPTIONS[0];- return (- <Field>- <FieldLabel>Method</FieldLabel>- <FieldContent>- <FilterableSelect- value={selected}- onChange={(opt) => {- const next = opt as { value: SettableMethod } | null;- if (next) field.onChange(next.value);- }}- options={METHOD_OPTIONS}- isSearchable={false}- isClearable={false}- getOptionLabel={(o) => o.label}- getOptionValue={(o) => o.value}- />- </FieldContent>- </Field>- );- }}- />-- {method === "aws" && (- <>- <Controller- control={control}- name="allowedPrincipalArns"- render={({ field, fieldState: { error } }) => (- <Field>- <FieldLabel>Allowed Principal ARNs</FieldLabel>- <FieldContent>- <Input- {...field}- isError={Boolean(error)}- placeholder="arn:aws:iam::123456789012:role/MyRoleName, arn:aws:iam::123456789012:user/MyUserName..."- />- <FieldError errors={[error]} />- </FieldContent>- </Field>- )}- />- <Controller- control={control}- name="allowedAccountIds"- render={({ field, fieldState: { error } }) => (- <Field>- <FieldLabel>Allowed Account IDs</FieldLabel>- <FieldContent>- <Input {...field} isError={Boolean(error)} placeholder="123456789012, ..." />- <FieldError errors={[error]} />- </FieldContent>- </Field>- )}- />- <Controller- control={control}- name="stsEndpoint"- render={({ field, fieldState: { error } }) => (- <Field>- <FieldLabel>STS Endpoint</FieldLabel>- <FieldContent>- <Input- {...field}- isError={Boolean(error)}- placeholder="https://sts.amazonaws.com/"- />- <FieldError errors={[error]} />- </FieldContent>- </Field>- )}- />- </>- )}-- <DialogFooter className="gap-2 sm:gap-2">- <Button type="button" variant="ghost" onClick={() => onOpenChange(false)}>- Cancel- </Button>- <Button- type="submit"- variant={isSubOrganization ? "sub-org" : "org"}- isPending={isSubmitting || isPending}- isDisabled={isSubmitting || isPending || !isDirty}- >- Update- </Button>- </DialogFooter>- </form>- </DialogContent>- </Dialog>- );-};diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayConnectedResourcesSection/GatewayConnectedResourcesSection.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayConnectedResourcesSection/GatewayConnectedResourcesSection.tsxindex 3f27bb33b3..88008202df 100644--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayConnectedResourcesSection/GatewayConnectedResourcesSection.tsx+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayConnectedResourcesSection/GatewayConnectedResourcesSection.tsx@@ -1,7 +1,6 @@import { Link } from "@tanstack/react-router";import { ExternalLinkIcon } from "lucide-react";-import { Spinner } from "@app/components/v2";import {Accordion,AccordionContent,@@ -21,7 +20,8 @@ import {ItemContent,ItemDescription,ItemGroup,- ItemTitle+ ItemTitle,+ Skeleton} from "@app/components/v3";import { useOrganization } from "@app/context";import {@@ -69,15 +69,19 @@ export const GatewayConnectedResourcesSection = ({ gatewayId }: Props) => {const total = totalCountOf(resources);return (- <Card>+ <Card className="min-w-0" aria-labelledby="gateway-connected-resources-title"><CardHeader>- <CardTitle>Connected Resources</CardTitle>+ <CardTitle>+ <h2 id="gateway-connected-resources-title">Connected Resources</h2>+ </CardTitle><CardDescription>Resources currently routing through this gateway</CardDescription></CardHeader><CardContent>{isPending && (- <div className="flex h-32 items-center justify-center">- <Spinner size="lg" />+ <div className="space-y-2" aria-label="Loading connected resources">+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" /></div>)}{!isPending && total === 0 && (@@ -98,7 +102,7 @@ export const GatewayConnectedResourcesSection = ({ gatewayId }: Props) => {<span className="flex-1">App Connections</span><Badge variant="neutral">{resources?.appConnections.length}</Badge></AccordionTrigger>- <AccordionContent className="px-4 py-3">+ <AccordionContent className="group-data-[variant=default]/accordion:p-3"><ItemGroup>{resources?.appConnections.map((c) => (<ResourceRow@@ -122,7 +126,7 @@ export const GatewayConnectedResourcesSection = ({ gatewayId }: Props) => {<span className="flex-1">Dynamic Secrets</span><Badge variant="neutral">{resources?.dynamicSecrets.length}</Badge></AccordionTrigger>- <AccordionContent className="px-4 py-3">+ <AccordionContent className="group-data-[variant=default]/accordion:p-3"><ItemGroup>{resources?.dynamicSecrets.map((d) => (<ResourceRow@@ -148,7 +152,7 @@ export const GatewayConnectedResourcesSection = ({ gatewayId }: Props) => {<span className="flex-1">Kubernetes Auth</span><Badge variant="neutral">{resources?.kubernetesAuths.length}</Badge></AccordionTrigger>- <AccordionContent className="px-4 py-3">+ <AccordionContent className="group-data-[variant=default]/accordion:p-3"><ItemGroup>{resources?.kubernetesAuths.map((a) => (<ResourceRow@@ -170,7 +174,7 @@ export const GatewayConnectedResourcesSection = ({ gatewayId }: Props) => {<span className="flex-1">MCP Servers</span><Badge variant="neutral">{resources?.mcpServers.length}</Badge></AccordionTrigger>- <AccordionContent className="px-4 py-3">+ <AccordionContent className="group-data-[variant=default]/accordion:p-3"><ItemGroup>{resources?.mcpServers.map((s) => (<ResourceRow@@ -192,7 +196,7 @@ export const GatewayConnectedResourcesSection = ({ gatewayId }: Props) => {<span className="flex-1">PKI Discovery</span><Badge variant="neutral">{resources?.pkiDiscoveryConfigs.length}</Badge></AccordionTrigger>- <AccordionContent className="px-4 py-3">+ <AccordionContent className="group-data-[variant=default]/accordion:p-3"><ItemGroup>{resources?.pkiDiscoveryConfigs.map((c) => (<ResourceRowdiff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsxindex 7423ccea3f..c392db6cf3 100644--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsx+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsx@@ -1,110 +1,137 @@import { useState } from "react";-import { RocketIcon } from "lucide-react";+import { LockKeyholeIcon, RefreshCwIcon, RocketIcon } from "lucide-react";import { createNotification } from "@app/components/notifications";-import { OrgPermissionCan } from "@app/components/permissions";import {+ Alert,+ AlertDescription,+ AlertTitle,Button,Card,CardAction,+ CardContent,CardDescription,CardHeader,- CardTitle+ CardTitle,+ DocumentationLinkBadge,+ Tabs,+ TabsList,+ TabsTrigger} from "@app/components/v3";-import { useOrganization } from "@app/context";+import { useOrgPermission } from "@app/context";import {OrgGatewayPermissionActions,OrgPermissionSubjects} from "@app/context/OrgPermissionContext/types";import { useMintGatewayToken } from "@app/hooks/api/gateways-v2";-import { GatewayAuthMethodView } from "@app/hooks/api/gateways-v2/types";+import { GatewayAuthMethodView, TGatewayEnrollmentToken } from "@app/hooks/api/gateways-v2/types";-import { AwsStartCommandDialog } from "../GatewayAuthMethod/AwsStartCommandDialog";-import { EnrollmentTokenDialog } from "../GatewayAuthMethod/EnrollmentTokenDialog";+import { AwsStartCommandContent } from "../GatewayAuthMethod/AwsStartCommandDialog";+import { EnrollmentTokenContent } from "../GatewayAuthMethod/EnrollmentTokenDialog";type Props = {gatewayId: string;gatewayName: string;authMethod: GatewayAuthMethodView;- // True when the gateway has no heartbeat — drives highlighting the start-command button.- isFirstTimeSetup: boolean;};-export const GatewayDeploySection = ({- gatewayId,- gatewayName,- authMethod,- isFirstTimeSetup-}: Props) => {- const { isSubOrganization } = useOrganization();- const [showAwsCommand, setShowAwsCommand] = useState(false);- const [enrollmentToken, setEnrollmentToken] = useState<string | null>(null);+export const GatewayDeploySection = ({ gatewayId, gatewayName, authMethod }: Props) => {+ const [deploymentMethod, setDeploymentMethod] = useState("cli");+ const [mintedEnrollment, setMintedEnrollment] = useState<+ (TGatewayEnrollmentToken & { gatewayId: string }) | null+ >(null);+ const [isCommandDirty, setIsCommandDirty] = useState(false);const { mutateAsync: mint, isPending: isMinting } = useMintGatewayToken();+ const { permission } = useOrgPermission();+ const enrollment = mintedEnrollment?.gatewayId === gatewayId ? mintedEnrollment : null;+ const canEditGateway = permission.can(+ OrgGatewayPermissionActions.EditGateways,+ OrgPermissionSubjects.Gateway+ );if (authMethod.method === "identity") return null;- const handleClick = async () => {- if (authMethod.method === "aws") {- setShowAwsCommand(true);- return;- }+ const showDeploymentControls = authMethod.method === "aws" || Boolean(enrollment);++ const handleGenerate = async () => {try {const result = await mint({ gatewayId });- setEnrollmentToken(result.token);+ setMintedEnrollment({ ...result, gatewayId });} catch {createNotification({ type: "error", text: "Failed to generate enrollment token" });}};return (- <>- <Card className="w-full">+ <Tabs value={deploymentMethod} onValueChange={setDeploymentMethod} className="min-w-0">+ <Card className="min-w-0" aria-labelledby="gateway-deployment-title"><CardHeader>- <CardTitle>Deployment</CardTitle>- <CardDescription>Launch this gateway on a target host</CardDescription>- <CardAction>- <OrgPermissionCan- I={OrgGatewayPermissionActions.EditGateways}- a={OrgPermissionSubjects.Gateway}- >- {(isAllowed) => {- let variant: "neutral" | "org" | "sub-org" = "neutral";- if (isFirstTimeSetup) variant = isSubOrganization ? "sub-org" : "org";- return (+ <CardTitle>+ <h2 id="gateway-deployment-title">Deployment</h2>+ <DocumentationLinkBadge href="https://infisical.com/docs/cli/overview" />+ </CardTitle>+ <CardDescription>Run this gateway on a target host.</CardDescription>+ {canEditGateway && showDeploymentControls && (+ <CardAction>+ <TabsList variant="filled">+ <TabsTrigger value="cli">CLI</TabsTrigger>+ <TabsTrigger value="systemd">System service</TabsTrigger>+ </TabsList>+ </CardAction>+ )}+ </CardHeader>+ <CardContent className="space-y-4">+ {!canEditGateway ? (+ <Alert variant="warning" appearance="borderless">+ <LockKeyholeIcon />+ <AlertTitle>Access restricted</AlertTitle>+ <AlertDescription>+ You don't have permission to generate gateway deployment commands.+ </AlertDescription>+ </Alert>+ ) : (+ <>+ {authMethod.method === "aws" && (+ <AwsStartCommandContent gatewayId={gatewayId} gatewayName={gatewayName} />+ )}++ {authMethod.method === "token" && !enrollment && (+ <Button+ variant="neutral"+ size="sm"+ isPending={isMinting}+ isDisabled={isMinting}+ onClick={handleGenerate}+ >+ <RocketIcon className="size-4" />+ Generate deploy command+ </Button>+ )}++ {authMethod.method === "token" && enrollment && (+ <>+ <EnrollmentTokenContent+ gatewayName={gatewayName}+ enrollmentToken={enrollment.token}+ expiresAt={enrollment.expiresAt}+ onCommandDirtyChange={setIsCommandDirty}+ /><Button- variant={variant}+ variant={isCommandDirty ? "warning" : "neutral"}size="sm"isPending={isMinting}- isDisabled={!isAllowed || isMinting}- onClick={handleClick}+ isDisabled={isMinting}+ onClick={handleGenerate}>- <RocketIcon className="size-4" />- Show deploy command+ <RefreshCwIcon className="size-4" />+ {isCommandDirty ? "Update command for selected relay" : "Regenerate command"}</Button>- );- }}- </OrgPermissionCan>- </CardAction>- </CardHeader>+ </>+ )}+ </>+ )}+ </CardContent></Card>-- {authMethod.method === "aws" && (- <AwsStartCommandDialog- isOpen={showAwsCommand}- onOpenChange={setShowAwsCommand}- gatewayId={gatewayId}- gatewayName={gatewayName}- />- )}-- {enrollmentToken && (- <EnrollmentTokenDialog- isOpen- onOpenChange={(open) => !open && setEnrollmentToken(null)}- gatewayName={gatewayName}- enrollmentToken={enrollmentToken}- />- )}- </>+ </Tabs>);};diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDetailsCard/GatewayDetailsCard.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDetailsCard/GatewayDetailsCard.tsxindex 04bb12f25c..26e6e00ff6 100644--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDetailsCard/GatewayDetailsCard.tsx+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDetailsCard/GatewayDetailsCard.tsx@@ -1,8 +1,8 @@-import { useState } from "react";import { Link } from "@tanstack/react-router";import { format } from "date-fns";-import { CheckIcon, ClipboardListIcon, PencilIcon, TriangleAlertIcon } from "lucide-react";+import { CheckIcon, ClipboardListIcon, TriangleAlertIcon } from "lucide-react";+import { createNotification } from "@app/components/notifications";import { OrgPermissionCan } from "@app/components/permissions";import {Alert,@@ -30,15 +30,11 @@ import {OrgPermissionSubjects} from "@app/context/OrgPermissionContext/types";import { useTimedReset } from "@app/hooks";-import {- GatewayAuthMethodView,- TGatewayV2,- TGatewayV2WithAuthMethod-} from "@app/hooks/api/gateways-v2/types";+import { useUpdateGateway } from "@app/hooks/api/gateways-v2";+import { TGatewayV2, TGatewayV2WithAuthMethod } from "@app/hooks/api/gateways-v2/types";import { isGatewayHealthy } from "@app/hooks/api/gateways-v2/utils";-import { GatewayAuthMethodModal } from "../GatewayAuthMethod/GatewayAuthMethodModal";-import { ViewGatewayAuth } from "../GatewayAuthMethod/ViewGatewayAuth";+import { NetworkingAuthMethodForm } from "../../../components/NetworkingAuthMethodForm";const HealthBadge = ({ gateway }: { gateway: TGatewayV2 }) => {if (!gateway.heartbeat && !gateway.heartbeatTTL) {@@ -50,146 +46,137 @@ const HealthBadge = ({ gateway }: { gateway: TGatewayV2 }) => {return <Badge variant="danger">Unreachable</Badge>;};-const AuthMethodBadge = ({ method }: { method: GatewayAuthMethodView["method"] }) => {- if (method === "aws") return <Badge variant="info">AWS Auth</Badge>;- if (method === "token") return <Badge variant="info">Token Auth</Badge>;- return <Badge variant="warning">Machine Identity</Badge>;-};-export const GatewayDetailsCard = ({ gateway }: { gateway: TGatewayV2WithAuthMethod }) => {const [, isCopyingId, setCopyTextId] = useTimedReset<string>({initialState: "Copy ID to clipboard"});- const [authModalOpen, setAuthModalOpen] = useState(false);const { currentOrg } = useOrganization();const orgId = currentOrg?.id || "";+ const { mutateAsync: updateGateway, isPending: isUpdatingAuthMethod } = useUpdateGateway();const { authMethod } = gateway;const isIdentityGateway = authMethod.method === "identity";return (- <>- <Card className="w-full">- <CardHeader className="border-b">- <CardTitle>Details</CardTitle>- </CardHeader>- <CardContent>- <DetailGroup>- <DetailGroupHeader>General</DetailGroupHeader>- <Detail>- <DetailLabel>ID</DetailLabel>- <DetailValue className="flex items-center gap-x-1">- <span className="font-mono text-xs">{gateway.id}</span>+ <Card className="w-full">+ <CardHeader className="border-b">+ <CardTitle>Details</CardTitle>+ </CardHeader>+ <CardContent>+ <DetailGroup>+ <DetailGroupHeader>General</DetailGroupHeader>+ <Detail>+ <DetailLabel>ID</DetailLabel>+ <DetailValue className="flex items-center gap-x-1">+ <span className="font-mono text-xs">{gateway.id}</span>+ <Tooltip>+ <TooltipTrigger asChild>+ <IconButton+ aria-label="copy gateway id"+ onClick={() => {+ navigator.clipboard.writeText(gateway.id);+ setCopyTextId("Copied");+ }}+ variant="ghost"+ size="xs"+ >+ {isCopyingId ? <CheckIcon /> : <ClipboardListIcon className="text-label" />}+ </IconButton>+ </TooltipTrigger>+ <TooltipContent>Copy gateway ID to clipboard</TooltipContent>+ </Tooltip>+ </DetailValue>+ </Detail>+ <Detail>+ <DetailLabel>Health</DetailLabel>+ <DetailValue>+ <HealthBadge gateway={gateway} />+ </DetailValue>+ </Detail>+ <Detail>+ <DetailLabel>Last Seen</DetailLabel>+ <DetailValue>+ {gateway.heartbeat ? (<Tooltip><TooltipTrigger asChild>- <IconButton- aria-label="copy gateway id"- onClick={() => {- navigator.clipboard.writeText(gateway.id);- setCopyTextId("Copied");- }}- variant="ghost"- size="xs"- >- {isCopyingId ? <CheckIcon /> : <ClipboardListIcon className="text-label" />}- </IconButton>+ <span className="cursor-default">+ {format(new Date(gateway.heartbeat), "PPpp")}+ </span></TooltipTrigger>- <TooltipContent>Copy gateway ID to clipboard</TooltipContent>+ <TooltipContent>{new Date(gateway.heartbeat).toUTCString()}</TooltipContent></Tooltip>- </DetailValue>- </Detail>- <Detail>- <DetailLabel>Health</DetailLabel>- <DetailValue>- <HealthBadge gateway={gateway} />- </DetailValue>- </Detail>- <Detail>- <DetailLabel>Last Seen</DetailLabel>- <DetailValue>- {gateway.heartbeat ? (- <Tooltip>- <TooltipTrigger asChild>- <span className="cursor-default">- {format(new Date(gateway.heartbeat), "PPpp")}- </span>- </TooltipTrigger>- <TooltipContent>{new Date(gateway.heartbeat).toUTCString()}</TooltipContent>- </Tooltip>- ) : (- <span className="text-muted">—</span>- )}- </DetailValue>- </Detail>- <Detail>- <DetailLabel>Created</DetailLabel>- <DetailValue>{format(new Date(gateway.createdAt), "PPpp")}</DetailValue>- </Detail>- </DetailGroup>- <Separator className="my-4" />- <DetailGroup>- <DetailGroupHeader className="flex items-center justify-between">- Authentication- {!isIdentityGateway && (- <OrgPermissionCan- I={OrgGatewayPermissionActions.EditGateways}- a={OrgPermissionSubjects.Gateway}+ ) : (+ <span className="text-muted">—</span>+ )}+ </DetailValue>+ </Detail>+ <Detail>+ <DetailLabel>Created</DetailLabel>+ <DetailValue>{format(new Date(gateway.createdAt), "PPpp")}</DetailValue>+ </Detail>+ </DetailGroup>+ <Separator className="my-4" />+ <DetailGroup>+ <DetailGroupHeader>Authentication</DetailGroupHeader>+ {isIdentityGateway && (+ <Alert variant="warning">+ <TriangleAlertIcon />+ <AlertTitle>Authenticated via Machine Identity (Legacy)</AlertTitle>+ <AlertDescription>+ <p>+ This gateway is still using machine identity. We recommend creating a new gateway.+ </p>+ <Link+ to="/organizations/$orgId/networking"+ params={{ orgId }}+ search={{ selectedTab: "gateways" }}+ className="underline underline-offset-4">- {(isAllowed) => (- <IconButton- size="xs"- variant="ghost-muted"- aria-label="edit auth method"- isDisabled={!isAllowed}- onClick={() => setAuthModalOpen(true)}- >- <PencilIcon />- </IconButton>- )}- </OrgPermissionCan>+ Create a new gateway+ </Link>+ </AlertDescription>+ </Alert>+ )}+ {!isIdentityGateway && (+ <OrgPermissionCan+ I={OrgGatewayPermissionActions.EditGateways}+ a={OrgPermissionSubjects.Gateway}+ >+ {(isAllowed) => (+ <NetworkingAuthMethodForm+ currentMethod={authMethod}+ isDisabled={!isAllowed}+ isPending={isUpdatingAuthMethod}+ onUpdate={async (form) => {+ try {+ await updateGateway({+ gatewayId: gateway.id,+ authMethod:+ form.method === "aws"+ ? {+ method: "aws",+ stsEndpoint: form.stsEndpoint,+ allowedPrincipalArns: form.allowedPrincipalArns,+ allowedAccountIds: form.allowedAccountIds+ }+ : { method: "token" }+ });+ createNotification({ type: "success", text: "Auth method updated" });+ return true;+ } catch {+ createNotification({+ type: "error",+ text: "Failed to update auth method"+ });+ return false;+ }+ }}+ />)}- </DetailGroupHeader>- {isIdentityGateway && (- <Alert variant="warning">- <TriangleAlertIcon />- <AlertTitle>Authenticated via Machine Identity (Legacy)</AlertTitle>- <AlertDescription>- <p>- This gateway is still using machine identity. We recommend creating a new- gateway.- </p>- <Link- to="/organizations/$orgId/networking"- params={{ orgId }}- search={{ selectedTab: "gateways" }}- className="underline underline-offset-4"- >- Create a new gateway- </Link>- </AlertDescription>- </Alert>- )}- {!isIdentityGateway && (- <Detail>- <DetailLabel>Method</DetailLabel>- <DetailValue>- <AuthMethodBadge method={authMethod.method} />- </DetailValue>- </Detail>- )}- <ViewGatewayAuth authMethod={authMethod} />- </DetailGroup>- </CardContent>- </Card>-- {!isIdentityGateway && (- <GatewayAuthMethodModal- isOpen={authModalOpen}- onOpenChange={setAuthModalOpen}- gatewayId={gateway.id}- currentMethod={authMethod}- />- )}- </>+ </OrgPermissionCan>+ )}+ </DetailGroup>+ </CardContent>+ </Card>);};diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayPageHeader/GatewayPageHeader.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayPageHeader/GatewayPageHeader.tsxindex 09acf6cbbd..c252e4af03 100644--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayPageHeader/GatewayPageHeader.tsx+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayPageHeader/GatewayPageHeader.tsx@@ -1,15 +1,30 @@+import { useState } from "react";import { useNavigate } from "@tanstack/react-router";import { BanIcon, CopyIcon, EllipsisIcon, HeartPulseIcon, TrashIcon } from "lucide-react";import { createNotification } from "@app/components/notifications";import { OrgPermissionCan } from "@app/components/permissions";-import { DeleteActionModal, PageHeader } from "@app/components/v2";+import { PageHeader } from "@app/components/v2";import {+ Alert,+ AlertDescription,+ AlertDialog,+ AlertDialogAction,+ AlertDialogCancel,+ AlertDialogConfirmationField,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogTitle,Button,DropdownMenu,DropdownMenuContent,DropdownMenuItem,- DropdownMenuTrigger+ DropdownMenuTrigger,+ Field,+ FieldLabel,+ Input} from "@app/components/v3";import {OrgGatewayPermissionActions,@@ -25,19 +40,24 @@ import { TGatewayV2 } from "@app/hooks/api/gateways-v2/types";export const GatewayPageHeader = ({ gateway, orgId }: { gateway: TGatewayV2; orgId: string }) => {const navigate = useNavigate();- const { mutateAsync: deleteGateway } = useDeleteGatewayV2ById();- const { mutateAsync: revokeGateway } = useRevokeGatewayAccess();+ const { mutateAsync: deleteGateway, isPending: isDeleting } = useDeleteGatewayV2ById();+ const { mutateAsync: revokeGateway, isPending: isRevoking } = useRevokeGatewayAccess();const { mutateAsync: triggerHeartbeat, isPending: isHeartbeating } =useTriggerGatewayV2Heartbeat();const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["deleteGateway","revokeGateway"] as const);+ const [deleteConfirmation, setDeleteConfirmation] = useState("");const onDelete = async () => {- await deleteGateway(gateway.id);- createNotification({ type: "success", text: "Successfully deleted gateway" });- navigate({ to: "/organizations/$orgId/networking", params: { orgId } });+ try {+ await deleteGateway(gateway.id);+ createNotification({ type: "success", text: "Successfully deleted gateway" });+ navigate({ to: "/organizations/$orgId/networking", params: { orgId } });+ } catch {+ createNotification({ type: "error", text: "Failed to delete gateway" });+ }};const onRevoke = async () => {@@ -128,22 +148,84 @@ export const GatewayPageHeader = ({ gateway, orgId }: { gateway: TGatewayV2; org</DropdownMenu></PageHeader>- <DeleteActionModal- isOpen={popUp.deleteGateway.isOpen}- title={`Delete gateway "${gateway.name}"?`}- onChange={(isOpen) => handlePopUpToggle("deleteGateway", isOpen)}- deleteKey="confirm"- onDeleteApproved={onDelete}- />- <DeleteActionModal- isOpen={popUp.revokeGateway.isOpen}- title={`Revoke access for gateway "${gateway.name}"?`}- subTitle="The gateway will be disconnected and any active tokens will be invalidated. The gateway will need to re-authenticate to reconnect."- onChange={(isOpen) => handlePopUpToggle("revokeGateway", isOpen)}- deleteKey="confirm"- buttonText="Revoke access"- onDeleteApproved={onRevoke}- />+ <AlertDialog+ open={popUp.deleteGateway.isOpen}+ onOpenChange={(open) => {+ if (!open) setDeleteConfirmation("");+ handlePopUpToggle("deleteGateway", open);+ }}+ >+ <AlertDialogContent>+ <AlertDialogHeader>+ <AlertDialogTitle>Delete Gateway?</AlertDialogTitle>+ <AlertDialogDescription>+ This permanently removes the gateway from your organization.+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogConfirmationField>+ <Field>+ <FieldLabel htmlFor="delete-gateway-confirmation" size="sm">+ <span>+ Type "<span className="text-foreground">{gateway.name}</span>" to+ confirm.+ </span>+ </FieldLabel>+ <Input+ id="delete-gateway-confirmation"+ value={deleteConfirmation}+ onChange={(event) => setDeleteConfirmation(event.target.value)}+ placeholder={gateway.name}+ autoComplete="off"+ autoFocus+ />+ </Field>+ </AlertDialogConfirmationField>+ <Alert variant="danger" appearance="borderless">+ <AlertDescription>Deleting this gateway cannot be undone.</AlertDescription>+ </Alert>+ <AlertDialogFooter>+ <AlertDialogCancel isDisabled={isDeleting}>Cancel</AlertDialogCancel>+ <AlertDialogAction+ variant="danger"+ isPending={isDeleting}+ isDisabled={deleteConfirmation !== gateway.name}+ onClick={(event) => {+ event.preventDefault();+ onDelete();+ }}+ >+ Delete Gateway+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog>+ <AlertDialog+ open={popUp.revokeGateway.isOpen}+ onOpenChange={(open) => handlePopUpToggle("revokeGateway", open)}+ >+ <AlertDialogContent>+ <AlertDialogHeader>+ <AlertDialogTitle>Revoke Gateway Access?</AlertDialogTitle>+ <AlertDialogDescription>+ The gateway will be disconnected and active tokens invalidated. It must+ re-authenticate to reconnect.+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogFooter>+ <AlertDialogCancel isDisabled={isRevoking}>Cancel</AlertDialogCancel>+ <AlertDialogAction+ variant="danger"+ isPending={isRevoking}+ onClick={(event) => {+ event.preventDefault();+ onRevoke();+ }}+ >+ Revoke Access+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog></>);};diff --git a/frontend/src/pages/organization/NetworkingPage/NetworkingPage.tsx b/frontend/src/pages/organization/NetworkingPage/NetworkingPage.tsxindex ad856172cd..0fc6bbc985 100644--- a/frontend/src/pages/organization/NetworkingPage/NetworkingPage.tsx+++ b/frontend/src/pages/organization/NetworkingPage/NetworkingPage.tsx@@ -19,7 +19,7 @@ export const NetworkingPage = () => {<PageHeaderscope={isSubOrganization ? "namespace" : "org"}title="Networking"- description="Manage gateways and relays to securely access private network resources from Infisical"+ description="Manage gateways and relays that securely connect Infisical to your infrastructure"/><NetworkingTabGroup /></div>diff --git a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/RelayDetailsByIDPage.tsx b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/RelayDetailsByIDPage.tsxindex 94bdf17304..07ab44d1a4 100644--- a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/RelayDetailsByIDPage.tsx+++ b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/RelayDetailsByIDPage.tsx@@ -4,8 +4,7 @@ import { Link, useParams } from "@tanstack/react-router";import { ChevronLeftIcon } from "lucide-react";import { OrgPermissionCan } from "@app/components/permissions";-import { EmptyState } from "@app/components/v2";-import { PageLoader } from "@app/components/v3";+import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, PageLoader } from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { useOrganization } from "@app/context";import {@@ -31,7 +30,14 @@ const Page = () => {}if (!relay) {- return <EmptyState title="Relay not found" />;+ return (+ <Empty className="border">+ <EmptyHeader>+ <EmptyMedia variant="icon" />+ <EmptyTitle>Relay not found</EmptyTitle>+ </EmptyHeader>+ </Empty>+ );}return (@@ -46,16 +52,15 @@ const Page = () => {Relays</Link><RelayPageHeader relay={relay} orgId={orgId} />- <div className="flex flex-col gap-5 lg:flex-row">- <div className="flex w-full flex-col gap-y-5 lg:max-w-[24rem]">+ <div className="grid grid-cols-1 gap-8 lg:grid-cols-[24rem_minmax(0,1fr)]">+ <div className="w-full min-w-0 lg:col-start-1 lg:row-start-1"><RelayDetailsCard relay={relay} /></div>- <div className="flex flex-1 flex-col gap-y-5">+ <div className="flex min-w-0 flex-col gap-y-8 lg:col-start-2 lg:row-start-1"><RelayDeploySectionrelayId={relayId}relayName={relay.name}authMethod={relay.authMethod}- isFirstTimeSetup={!relay.heartbeat}/><RelayConnectedGatewaysSection relayId={relayId} /></div>diff --git a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayAuthMethod/RelayAuthMethodModal.tsx b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayAuthMethod/RelayAuthMethodModal.tsxdeleted file mode 100644index 5bb570d3bf..0000000000--- a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayAuthMethod/RelayAuthMethodModal.tsx+++ /dev/null@@ -1,235 +0,0 @@-import { useEffect } from "react";-import { Controller, useForm } from "react-hook-form";-import { zodResolver } from "@hookform/resolvers/zod";-import { z } from "zod";--import { createNotification } from "@app/components/notifications";-import {- Button,- Dialog,- DialogContent,- DialogDescription,- DialogFooter,- DialogHeader,- DialogTitle,- Field,- FieldContent,- FieldError,- FieldLabel,- FilterableSelect,- Input-} from "@app/components/v3";-import { useOrganization } from "@app/context";-import { useUpdateRelay } from "@app/hooks/api/relays";-import { TRelayAuthMethodView } from "@app/hooks/api/relays/types";--type SettableMethod = "aws" | "token";--const METHOD_OPTIONS: { value: SettableMethod; label: string }[] = [- { value: "token", label: "Token Auth" },- { value: "aws", label: "AWS Auth" }-];--const schema = z- .object({- method: z.enum(["aws", "token"]),- stsEndpoint: z.string(),- allowedPrincipalArns: z.string(),- allowedAccountIds: z.string()- })- .superRefine((data, ctx) => {- if (data.method === "aws") {- const hasArns = data.allowedPrincipalArns.trim().length > 0;- const hasAccountIds = data.allowedAccountIds.trim().length > 0;- if (!hasArns && !hasAccountIds) {- const message = "At least one of allowed principal ARNs or allowed account IDs must be set";- ctx.addIssue({- code: z.ZodIssueCode.custom,- path: ["allowedPrincipalArns"],- message- });- ctx.addIssue({- code: z.ZodIssueCode.custom,- path: ["allowedAccountIds"],- message- });- }- }- });--type FormData = z.infer<typeof schema>;--type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;- relayId: string;- currentMethod: TRelayAuthMethodView;-};--export const RelayAuthMethodModal = ({ isOpen, onOpenChange, relayId, currentMethod }: Props) => {- const { mutateAsync: updateRelay, isPending } = useUpdateRelay();- const { isSubOrganization } = useOrganization();-- const initialMethod: SettableMethod = currentMethod.method === "aws" ? "aws" : "token";- const initialAws = currentMethod.method === "aws" ? currentMethod.config : null;-- const {- control,- handleSubmit,- watch,- reset,- formState: { isSubmitting, isDirty }- } = useForm<FormData>({- resolver: zodResolver(schema),- defaultValues: {- method: initialMethod,- stsEndpoint: initialAws?.stsEndpoint ?? "https://sts.amazonaws.com/",- allowedPrincipalArns: initialAws?.allowedPrincipalArns ?? "",- allowedAccountIds: initialAws?.allowedAccountIds ?? ""- }- });-- useEffect(() => {- if (isOpen) {- reset({- method: initialMethod,- stsEndpoint: initialAws?.stsEndpoint ?? "https://sts.amazonaws.com/",- allowedPrincipalArns: initialAws?.allowedPrincipalArns ?? "",- allowedAccountIds: initialAws?.allowedAccountIds ?? ""- });- }- // eslint-disable-next-line react-hooks/exhaustive-deps- }, [isOpen]);-- const method = watch("method");-- const onSubmit = async (form: FormData) => {- try {- if (form.method === "aws") {- await updateRelay({- relayId,- authMethod: {- method: "aws",- stsEndpoint: form.stsEndpoint,- allowedPrincipalArns: form.allowedPrincipalArns,- allowedAccountIds: form.allowedAccountIds- }- });- } else {- await updateRelay({ relayId, authMethod: { method: "token" } });- }- createNotification({ type: "success", text: "Auth method updated" });- onOpenChange(false);- } catch {- createNotification({ type: "error", text: "Failed to update auth method" });- }- };-- return (- <Dialog open={isOpen} onOpenChange={onOpenChange}>- <DialogContent className="max-w-lg overflow-visible">- <DialogHeader>- <DialogTitle>Edit Auth Method</DialogTitle>- <DialogDescription>- Switch the relay's auth method or update the current method's config.- </DialogDescription>- </DialogHeader>- <form onSubmit={handleSubmit(onSubmit)} className="space-y-4">- <Controller- control={control}- name="method"- render={({ field }) => {- const selected =- METHOD_OPTIONS.find((o) => o.value === field.value) ?? METHOD_OPTIONS[0];- return (- <Field>- <FieldLabel>Method</FieldLabel>- <FieldContent>- <FilterableSelect- value={selected}- onChange={(opt) => {- const next = opt as { value: SettableMethod } | null;- if (next) field.onChange(next.value);- }}- options={METHOD_OPTIONS}- isSearchable={false}- isClearable={false}- getOptionLabel={(o) => o.label}- getOptionValue={(o) => o.value}- />- </FieldContent>- </Field>- );- }}- />-- {method === "aws" && (- <>- <Controller- control={control}- name="allowedPrincipalArns"- render={({ field, fieldState: { error } }) => (- <Field>- <FieldLabel>Allowed Principal ARNs</FieldLabel>- <FieldContent>- <Input- {...field}- isError={Boolean(error)}- placeholder="arn:aws:iam::123456789012:role/MyRoleName, arn:aws:iam::123456789012:user/MyUserName..."- />- <FieldError errors={[error]} />- </FieldContent>- </Field>- )}- />- <Controller- control={control}- name="allowedAccountIds"- render={({ field, fieldState: { error } }) => (- <Field>- <FieldLabel>Allowed Account IDs</FieldLabel>- <FieldContent>- <Input {...field} isError={Boolean(error)} placeholder="123456789012, ..." />- <FieldError errors={[error]} />- </FieldContent>- </Field>- )}- />- <Controller- control={control}- name="stsEndpoint"- render={({ field, fieldState: { error } }) => (- <Field>- <FieldLabel>STS Endpoint</FieldLabel>- <FieldContent>- <Input- {...field}- isError={Boolean(error)}- placeholder="https://sts.amazonaws.com/"- />- <FieldError errors={[error]} />- </FieldContent>- </Field>- )}- />- </>- )}-- <DialogFooter className="gap-2 sm:gap-2">- <Button type="button" variant="ghost" onClick={() => onOpenChange(false)}>- Cancel- </Button>- <Button- type="submit"- variant={isSubOrganization ? "sub-org" : "org"}- isPending={isSubmitting || isPending}- isDisabled={isSubmitting || isPending || !isDirty}- >- Update- </Button>- </DialogFooter>- </form>- </DialogContent>- </Dialog>- );-};diff --git a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayConnectedGatewaysSection/RelayConnectedGatewaysSection.tsx b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayConnectedGatewaysSection/RelayConnectedGatewaysSection.tsxindex 0ad7ee0aea..80d4805bad 100644--- a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayConnectedGatewaysSection/RelayConnectedGatewaysSection.tsx+++ b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayConnectedGatewaysSection/RelayConnectedGatewaysSection.tsx@@ -3,7 +3,6 @@ import { Link } from "@tanstack/react-router";import { formatDistanceToNow } from "date-fns";import { ExternalLinkIcon } from "lucide-react";-import { Spinner } from "@app/components/v2";import {Accordion,AccordionContent,@@ -23,7 +22,8 @@ import {ItemContent,ItemDescription,ItemGroup,- ItemTitle+ ItemTitle,+ Skeleton} from "@app/components/v3";import { useOrganization } from "@app/context";import {@@ -75,15 +75,19 @@ export const RelayConnectedGatewaysSection = ({ relayId }: { relayId: string })const total = gateways?.length ?? 0;return (- <Card>+ <Card className="min-w-0" aria-labelledby="relay-connected-gateways-title"><CardHeader>- <CardTitle>Connected Gateways</CardTitle>+ <CardTitle>+ <h2 id="relay-connected-gateways-title">Connected Gateways</h2>+ </CardTitle><CardDescription>Gateways currently routing through this relay</CardDescription></CardHeader><CardContent>{isPending && (- <div className="flex h-32 items-center justify-center">- <Spinner size="lg" />+ <div className="space-y-2" aria-label="Loading connected gateways">+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" />+ <Skeleton className="h-10 w-full" /></div>)}{!isPending && total === 0 && (@@ -108,7 +112,7 @@ export const RelayConnectedGatewaysSection = ({ relayId }: { relayId: string })<span className="flex-1">{label}</span><Badge variant={variant}>{items.length}</Badge></AccordionTrigger>- <AccordionContent className="px-4 py-3">+ <AccordionContent className="group-data-[variant=default]/accordion:p-3"><ItemGroup>{items.map((g) => (<Item asChild variant="outline" size="xs" key={g.id}>diff --git a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDeploySection/RelayDeployCommandDialog.tsx b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDeploySection/RelayDeployCommandDialog.tsxindex e67d131c3f..04da9344b8 100644--- a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDeploySection/RelayDeployCommandDialog.tsx+++ b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDeploySection/RelayDeployCommandDialog.tsx@@ -1,43 +1,44 @@-import { useMemo } from "react";-import { faCopy, faUpRightFromSquare } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { useEffect, useMemo, useState } from "react";-import { createNotification } from "@app/components/notifications";-import {- Button,- FormLabel,- IconButton,- Input,- Modal,- ModalClose,- ModalContent,- Tab,- TabList,- TabPanel,- Tabs-} from "@app/components/v2";-import { Badge } from "@app/components/v3/generic/Badge";+import { Badge, CodeBlock, TabsContent } from "@app/components/v3";type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;relayId: string;relayName: string;authMethod: "token" | "aws";- enrollmentToken: string | null;+ enrollmentToken?: string;+ expiresAt?: string;};-export const RelayDeployCommandDialog = ({- isOpen,- onOpenChange,+const formatTimeRemaining = (expiresAt: string, now: number) => {+ const remainingSeconds = Math.max(0, Math.ceil((new Date(expiresAt).getTime() - now) / 1000));+ if (remainingSeconds === 0) return "Expired";++ const hours = Math.floor(remainingSeconds / 3600);+ const minutes = Math.floor((remainingSeconds % 3600) / 60);+ const seconds = remainingSeconds % 60;++ if (hours > 0) return `${hours}h ${minutes}m remaining`;+ return `${minutes}m ${seconds}s remaining`;+};++export const RelayDeployCommandContent = ({relayId,relayName,authMethod,- enrollmentToken+ enrollmentToken,+ expiresAt}: Props) => {const { protocol, hostname, port } = window.location;const portSuffix = port && port !== "80" ? `:${port}` : "";const siteURL = `${protocol}//${hostname}${portSuffix}`;+ const [now, setNow] = useState(Date.now());++ useEffect(() => {+ if (!expiresAt) return undefined;+ const timer = window.setInterval(() => setNow(Date.now()), 1000);+ return () => window.clearInterval(timer);+ }, [expiresAt]);const cliCommand = useMemo(() => {if (authMethod === "aws") {@@ -54,99 +55,37 @@ export const RelayDeployCommandDialog = ({}, [relayName, relayId, enrollmentToken, authMethod, siteURL]);const startServiceCommand = `sudo systemctl start ${relayName}`;-- const copy = (text: string, label: string) => {- navigator.clipboard.writeText(text);- createNotification({ type: "info", text: `${label} copied to clipboard` });- };-- const badgeLabel = authMethod === "aws" ? "AWS Auth" : "Token Auth";- const helperText =- authMethod === "aws"- ? "The host must have AWS credentials whose principal matches your allowlist."- : "The enrollment token expires in 1 hour and can only be used once.";+ const expiryLabel = expiresAt ? formatTimeRemaining(expiresAt, now) : null;+ const isExpired = expiryLabel === "Expired";+ const label = (title: string) => (+ <span className="flex w-full items-center justify-between gap-2">+ <span>{title}</span>+ {expiryLabel && (+ <Badge className="tabular-nums" variant={expiryLabel === "Expired" ? "danger" : "neutral"}>+ {expiryLabel}+ </Badge>+ )}+ </span>+ );return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent- className="max-w-2xl"- title={`Deploy command for ${relayName}`}- subTitle="Run the following command on the machine where you want to deploy the relay."- bodyClassName="overflow-visible"- >- <div className="mb-4">- <div className="mb-0.5 flex items-center gap-2">- <FormLabel label="Auth Method" className="mb-0 text-foreground" />- <Badge variant="info">{badgeLabel}</Badge>- </div>- <p className="mt-1 text-xs text-mineshaft-400">{helperText}</p>- </div>-- <Tabs defaultValue="cli" className="mt-2">- <TabList>- <Tab value="cli">CLI</Tab>- <Tab value="systemd">CLI (systemd)</Tab>- </TabList>- <TabPanel value="cli">- <div className="flex gap-2">- <Input value={cliCommand} isDisabled />- <IconButton- ariaLabel="copy"- variant="outline_bg"- colorSchema="secondary"- onClick={() => copy(cliCommand, "Command")}- className="w-10"- >- <FontAwesomeIcon icon={faCopy} />- </IconButton>- </div>- </TabPanel>- <TabPanel value="systemd">- <FormLabel label="Installation Command" />- <div className="flex gap-2">- <Input value={systemdInstallCommand} isDisabled />- <IconButton- ariaLabel="copy install"- variant="outline_bg"- colorSchema="secondary"- onClick={() => copy(systemdInstallCommand, "Installation command")}- className="w-10"- >- <FontAwesomeIcon icon={faCopy} />- </IconButton>- </div>- <FormLabel label="Start the Relay Service" className="mt-4" />- <div className="flex gap-2">- <Input value={startServiceCommand} isDisabled />- <IconButton- ariaLabel="copy start"- variant="outline_bg"- colorSchema="secondary"- onClick={() => copy(startServiceCommand, "Start command")}- className="w-10"- >- <FontAwesomeIcon icon={faCopy} />- </IconButton>- </div>- </TabPanel>- </Tabs>- <a- href="https://infisical.com/docs/cli/overview"- target="_blank"- rel="noreferrer"- className="mt-2 flex h-4 w-fit items-center gap-2 border-b border-mineshaft-400 text-sm text-mineshaft-400 transition-colors hover:border-yellow-400 hover:text-yellow-400"- >- <span>Install the Infisical CLI</span>- <FontAwesomeIcon icon={faUpRightFromSquare} className="size-3" />- </a>- <div className="mt-6 flex items-center">- <ModalClose asChild>- <Button className="mr-4" size="sm" colorSchema="secondary">- Done- </Button>- </ModalClose>- </div>- </ModalContent>- </Modal>+ <div className="min-w-0 space-y-4">+ <TabsContent value="cli" className="mt-0 min-w-0">+ <CodeBlock value={cliCommand} label={label("Command")} isCopyable={!isExpired} />+ </TabsContent>+ <TabsContent value="systemd" className="mt-0 min-w-0 space-y-4">+ <CodeBlock+ value={systemdInstallCommand}+ label={label("Install service")}+ isCopyable={!isExpired}+ />+ <CodeBlock value={startServiceCommand} label="Start service" />+ </TabsContent>+ {authMethod === "aws" && (+ <p className="text-xs text-muted">+ Requires AWS credentials matching the configured allowlist.+ </p>+ )}+ </div>);};diff --git a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDeploySection/RelayDeploySection.tsx b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDeploySection/RelayDeploySection.tsxindex 0c7195095c..b0e2365a63 100644--- a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDeploySection/RelayDeploySection.tsx+++ b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDeploySection/RelayDeploySection.tsx@@ -1,17 +1,24 @@import { useState } from "react";-import { RocketIcon } from "lucide-react";+import { LockKeyholeIcon, RefreshCwIcon, RocketIcon } from "lucide-react";import { createNotification } from "@app/components/notifications";-import { OrgPermissionCan } from "@app/components/permissions";import {+ Alert,+ AlertDescription,+ AlertTitle,Button,Card,CardAction,+ CardContent,CardDescription,CardHeader,- CardTitle+ CardTitle,+ DocumentationLinkBadge,+ Tabs,+ TabsList,+ TabsTrigger} from "@app/components/v3";-import { useOrganization } from "@app/context";+import { useOrgPermission } from "@app/context";import {OrgPermissionSubjects,OrgRelayPermissionActions@@ -19,84 +26,115 @@ import {import { useGenerateRelayEnrollmentToken } from "@app/hooks/api/relays";import { TRelayAuthMethodView } from "@app/hooks/api/relays/types";-import { RelayDeployCommandDialog } from "./RelayDeployCommandDialog";+import { RelayDeployCommandContent } from "./RelayDeployCommandDialog";type Props = {relayId: string;relayName: string;authMethod: TRelayAuthMethodView;- isFirstTimeSetup: boolean;};-export const RelayDeploySection = ({ relayId, relayName, authMethod, isFirstTimeSetup }: Props) => {- const { isSubOrganization } = useOrganization();- const [showDialog, setShowDialog] = useState(false);- const [enrollmentToken, setEnrollmentToken] = useState<string | null>(null);+type Enrollment = { token: string; expiresAt: string; relayId: string };++export const RelayDeploySection = ({ relayId, relayName, authMethod }: Props) => {+ const [deploymentMethod, setDeploymentMethod] = useState("cli");+ const [mintedEnrollment, setMintedEnrollment] = useState<Enrollment | null>(null);const { mutateAsync: mint, isPending: isMinting } = useGenerateRelayEnrollmentToken();+ const { permission } = useOrgPermission();+ const enrollment = mintedEnrollment?.relayId === relayId ? mintedEnrollment : null;+ const canEditRelay = permission.can(+ OrgRelayPermissionActions.EditRelays,+ OrgPermissionSubjects.Relay+ );if (authMethod.method === "identity") return null;- const handleClick = async () => {- if (authMethod.method === "token") {- try {- const result = await mint({ relayId });- setEnrollmentToken(result.token);- setShowDialog(true);- } catch {- createNotification({ type: "error", text: "Failed to generate enrollment token" });- }- } else {- setShowDialog(true);+ const showDeploymentControls = authMethod.method === "aws" || Boolean(enrollment);++ const handleGenerate = async () => {+ try {+ const result = await mint({ relayId });+ setMintedEnrollment({ ...result, relayId });+ } catch {+ createNotification({ type: "error", text: "Failed to generate enrollment token" });}};return (- <>- <Card className="w-full">+ <Tabs value={deploymentMethod} onValueChange={setDeploymentMethod} className="min-w-0">+ <Card className="min-w-0" aria-labelledby="relay-deployment-title"><CardHeader>- <CardTitle>Deployment</CardTitle>- <CardDescription>Launch this relay on a target host</CardDescription>- <CardAction>- <OrgPermissionCan- I={OrgRelayPermissionActions.EditRelays}- a={OrgPermissionSubjects.Relay}- >- {(isAllowed) => {- let variant: "neutral" | "org" | "sub-org" = "neutral";- if (isFirstTimeSetup) variant = isSubOrganization ? "sub-org" : "org";- return (+ <CardTitle>+ <h2 id="relay-deployment-title">Deployment</h2>+ <DocumentationLinkBadge href="https://infisical.com/docs/cli/overview" />+ </CardTitle>+ <CardDescription>Run this relay on a target host.</CardDescription>+ {canEditRelay && showDeploymentControls && (+ <CardAction>+ <TabsList variant="filled">+ <TabsTrigger value="cli">CLI</TabsTrigger>+ <TabsTrigger value="systemd">System service</TabsTrigger>+ </TabsList>+ </CardAction>+ )}+ </CardHeader>+ <CardContent className="space-y-4">+ {!canEditRelay ? (+ <Alert variant="warning" appearance="borderless">+ <LockKeyholeIcon />+ <AlertTitle>Access restricted</AlertTitle>+ <AlertDescription>+ You don't have permission to generate relay deployment commands.+ </AlertDescription>+ </Alert>+ ) : (+ <>+ {authMethod.method === "aws" && (+ <RelayDeployCommandContent+ relayId={relayId}+ relayName={relayName}+ authMethod="aws"+ />+ )}++ {authMethod.method === "token" && !enrollment && (+ <Button+ variant="neutral"+ size="sm"+ isPending={isMinting}+ isDisabled={isMinting}+ onClick={handleGenerate}+ >+ <RocketIcon className="size-4" />+ Generate deploy command+ </Button>+ )}++ {authMethod.method === "token" && enrollment && (+ <>+ <RelayDeployCommandContent+ relayId={relayId}+ relayName={relayName}+ authMethod="token"+ enrollmentToken={enrollment.token}+ expiresAt={enrollment.expiresAt}+ /><Button- variant={variant}+ variant="neutral"size="sm"isPending={isMinting}- isDisabled={!isAllowed || isMinting}- onClick={handleClick}+ isDisabled={isMinting}+ onClick={handleGenerate}>- <RocketIcon className="size-4" />- Show deploy command+ <RefreshCwIcon className="size-4" />+ Regenerate command</Button>- );- }}- </OrgPermissionCan>- </CardAction>- </CardHeader>+ </>+ )}+ </>+ )}+ </CardContent></Card>-- {showDialog && (- <RelayDeployCommandDialog- isOpen- onOpenChange={(open) => {- if (!open) {- setShowDialog(false);- setEnrollmentToken(null);- }- }}- relayId={relayId}- relayName={relayName}- authMethod={authMethod.method as "token" | "aws"}- enrollmentToken={enrollmentToken}- />- )}- </>+ </Tabs>);};diff --git a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDetailsCard/RelayDetailsCard.tsx b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDetailsCard/RelayDetailsCard.tsxindex edcf4bb3f3..463c36bbc1 100644--- a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDetailsCard/RelayDetailsCard.tsx+++ b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayDetailsCard/RelayDetailsCard.tsx@@ -40,9 +40,9 @@ import {} from "@app/context/OrgPermissionContext/types";import { useTimedReset } from "@app/hooks";import { useUpdateRelay } from "@app/hooks/api/relays";-import { TRelayAuthMethodView, TRelayWithAuthMethod } from "@app/hooks/api/relays/types";+import { TRelayWithAuthMethod } from "@app/hooks/api/relays/types";-import { RelayAuthMethodModal } from "../RelayAuthMethod/RelayAuthMethodModal";+import { NetworkingAuthMethodForm } from "../../../components/NetworkingAuthMethodForm";const HealthBadge = ({ relay }: { relay: TRelayWithAuthMethod }) => {if (!relay.heartbeat) {@@ -56,12 +56,6 @@ const HealthBadge = ({ relay }: { relay: TRelayWithAuthMethod }) => {return <Badge variant="danger">Unreachable</Badge>;};-const AuthMethodBadge = ({ method }: { method: TRelayAuthMethodView["method"] }) => {- if (method === "aws") return <Badge variant="info">AWS Auth</Badge>;- if (method === "token") return <Badge variant="info">Token Auth</Badge>;- return <Badge variant="warning">Machine Identity</Badge>;-};-const EditGeneralModal = ({isOpen,onOpenChange,@@ -133,10 +127,10 @@ export const RelayDetailsCard = ({ relay }: { relay: TRelayWithAuthMethod }) =>const [, isCopyingId, setCopyTextId] = useTimedReset<string>({initialState: "Copy ID to clipboard"});- const [authModalOpen, setAuthModalOpen] = useState(false);const [generalModalOpen, setGeneralModalOpen] = useState(false);const { currentOrg } = useOrganization();const orgId = currentOrg?.id || "";+ const { mutateAsync: updateRelayAuthMethod, isPending: isUpdatingAuthMethod } = useUpdateRelay();const { authMethod } = relay;const isIdentityRelay = authMethod.method === "identity";@@ -212,27 +206,7 @@ export const RelayDetailsCard = ({ relay }: { relay: TRelayWithAuthMethod }) =></DetailGroup><Separator className="my-4" /><DetailGroup>- <DetailGroupHeader className="flex items-center justify-between">- Authentication- {!isIdentityRelay && (- <OrgPermissionCan- I={OrgRelayPermissionActions.EditRelays}- a={OrgPermissionSubjects.Relay}- >- {(isAllowed) => (- <IconButton- size="xs"- variant="ghost-muted"- aria-label="edit auth method"- isDisabled={!isAllowed}- onClick={() => setAuthModalOpen(true)}- >- <PencilIcon />- </IconButton>- )}- </OrgPermissionCan>- )}- </DetailGroupHeader>+ <DetailGroupHeader>Authentication</DetailGroupHeader>{isIdentityRelay && (<Alert variant="warning"><TriangleAlertIcon />@@ -253,36 +227,42 @@ export const RelayDetailsCard = ({ relay }: { relay: TRelayWithAuthMethod }) =></Alert>)}{!isIdentityRelay && (- <Detail>- <DetailLabel>Method</DetailLabel>- <DetailValue>- <AuthMethodBadge method={authMethod.method} />- </DetailValue>- </Detail>- )}- {authMethod.method === "aws" && (- <>- <Detail>- <DetailLabel>STS Endpoint</DetailLabel>- <DetailValue>{authMethod.config.stsEndpoint}</DetailValue>- </Detail>- <Detail>- <DetailLabel>Allowed Principal ARNs</DetailLabel>- <DetailValue>- {authMethod.config.allowedPrincipalArns || (- <span className="text-muted">—</span>- )}- </DetailValue>- </Detail>- <Detail>- <DetailLabel>Allowed Account IDs</DetailLabel>- <DetailValue>- {authMethod.config.allowedAccountIds || (- <span className="text-muted">—</span>- )}- </DetailValue>- </Detail>- </>+ <OrgPermissionCan+ I={OrgRelayPermissionActions.EditRelays}+ a={OrgPermissionSubjects.Relay}+ >+ {(isAllowed) => (+ <NetworkingAuthMethodForm+ currentMethod={authMethod}+ isDisabled={!isAllowed}+ isPending={isUpdatingAuthMethod}+ onUpdate={async (form) => {+ try {+ await updateRelayAuthMethod({+ relayId: relay.id,+ authMethod:+ form.method === "aws"+ ? {+ method: "aws",+ stsEndpoint: form.stsEndpoint,+ allowedPrincipalArns: form.allowedPrincipalArns,+ allowedAccountIds: form.allowedAccountIds+ }+ : { method: "token" }+ });+ createNotification({ type: "success", text: "Auth method updated" });+ return true;+ } catch {+ createNotification({+ type: "error",+ text: "Failed to update auth method"+ });+ return false;+ }+ }}+ />+ )}+ </OrgPermissionCan>)}{authMethod.method === "identity" && authMethod.config.identityName && (<Detail>@@ -300,15 +280,6 @@ export const RelayDetailsCard = ({ relay }: { relay: TRelayWithAuthMethod }) =>relayId={relay.id}currentHost={relay.host}/>-- {!isIdentityRelay && (- <RelayAuthMethodModal- isOpen={authModalOpen}- onOpenChange={setAuthModalOpen}- relayId={relay.id}- currentMethod={authMethod}- />- )}</>);};diff --git a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayPageHeader/RelayPageHeader.tsx b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayPageHeader/RelayPageHeader.tsxindex 0df41b3e1c..49a75df337 100644--- a/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayPageHeader/RelayPageHeader.tsx+++ b/frontend/src/pages/organization/NetworkingPage/RelayDetailsByIDPage/components/RelayPageHeader/RelayPageHeader.tsx@@ -1,15 +1,30 @@+import { useState } from "react";import { useNavigate } from "@tanstack/react-router";import { BanIcon, CopyIcon, EllipsisIcon, TrashIcon } from "lucide-react";import { createNotification } from "@app/components/notifications";import { OrgPermissionCan } from "@app/components/permissions";-import { DeleteActionModal, PageHeader } from "@app/components/v2";+import { PageHeader } from "@app/components/v2";import {+ Alert,+ AlertDescription,+ AlertDialog,+ AlertDialogAction,+ AlertDialogCancel,+ AlertDialogConfirmationField,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogTitle,Button,DropdownMenu,DropdownMenuContent,DropdownMenuItem,- DropdownMenuTrigger+ DropdownMenuTrigger,+ Field,+ FieldLabel,+ Input} from "@app/components/v3";import {OrgPermissionSubjects,@@ -27,21 +42,26 @@ export const RelayPageHeader = ({orgId: string;}) => {const navigate = useNavigate();- const { mutateAsync: deleteRelay } = useDeleteRelayById();- const { mutateAsync: revokeRelay } = useRevokeRelayAccess();+ const { mutateAsync: deleteRelay, isPending: isDeleting } = useDeleteRelayById();+ const { mutateAsync: revokeRelay, isPending: isRevoking } = useRevokeRelayAccess();const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["deleteRelay","revokeRelay"] as const);+ const [deleteConfirmation, setDeleteConfirmation] = useState("");const onDelete = async () => {- await deleteRelay(relay.id);- createNotification({ type: "success", text: "Successfully deleted relay" });- navigate({- to: "/organizations/$orgId/networking",- params: { orgId },- search: { selectedTab: "relays" }- });+ try {+ await deleteRelay(relay.id);+ createNotification({ type: "success", text: "Successfully deleted relay" });+ navigate({+ to: "/organizations/$orgId/networking",+ params: { orgId },+ search: { selectedTab: "relays" }+ });+ } catch {+ createNotification({ type: "error", text: "Failed to delete relay" });+ }};const onRevoke = async () => {@@ -116,22 +136,83 @@ export const RelayPageHeader = ({</DropdownMenu></PageHeader>- <DeleteActionModal- isOpen={popUp.deleteRelay.isOpen}- title={`Delete relay "${relay.name}"?`}- onChange={(isOpen) => handlePopUpToggle("deleteRelay", isOpen)}- deleteKey="confirm"- onDeleteApproved={onDelete}- />- <DeleteActionModal- isOpen={popUp.revokeRelay.isOpen}- title={`Revoke access for relay "${relay.name}"?`}- subTitle="The relay will be disconnected and any active tokens will be invalidated. The relay will need to re-authenticate to reconnect."- onChange={(isOpen) => handlePopUpToggle("revokeRelay", isOpen)}- deleteKey="confirm"- buttonText="Revoke access"- onDeleteApproved={onRevoke}- />+ <AlertDialog+ open={popUp.deleteRelay.isOpen}+ onOpenChange={(open) => {+ if (!open) setDeleteConfirmation("");+ handlePopUpToggle("deleteRelay", open);+ }}+ >+ <AlertDialogContent>+ <AlertDialogHeader>+ <AlertDialogTitle>Delete Relay?</AlertDialogTitle>+ <AlertDialogDescription>+ This permanently removes the relay from your organization.+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogConfirmationField>+ <Field>+ <FieldLabel htmlFor="delete-relay-confirmation" size="sm">+ <span>+ Type "<span className="text-foreground">{relay.name}</span>" to confirm.+ </span>+ </FieldLabel>+ <Input+ id="delete-relay-confirmation"+ value={deleteConfirmation}+ onChange={(event) => setDeleteConfirmation(event.target.value)}+ placeholder={relay.name}+ autoComplete="off"+ autoFocus+ />+ </Field>+ </AlertDialogConfirmationField>+ <Alert variant="danger" appearance="borderless">+ <AlertDescription>Deleting this relay cannot be undone.</AlertDescription>+ </Alert>+ <AlertDialogFooter>+ <AlertDialogCancel isDisabled={isDeleting}>Cancel</AlertDialogCancel>+ <AlertDialogAction+ variant="danger"+ isPending={isDeleting}+ isDisabled={deleteConfirmation !== relay.name}+ onClick={(event) => {+ event.preventDefault();+ onDelete();+ }}+ >+ Delete Relay+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog>+ <AlertDialog+ open={popUp.revokeRelay.isOpen}+ onOpenChange={(open) => handlePopUpToggle("revokeRelay", open)}+ >+ <AlertDialogContent>+ <AlertDialogHeader>+ <AlertDialogTitle>Revoke Relay Access?</AlertDialogTitle>+ <AlertDialogDescription>+ The relay will be disconnected and active tokens invalidated. It must re-authenticate+ to reconnect.+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogFooter>+ <AlertDialogCancel isDisabled={isRevoking}>Cancel</AlertDialogCancel>+ <AlertDialogAction+ variant="danger"+ isPending={isRevoking}+ onClick={(event) => {+ event.preventDefault();+ onRevoke();+ }}+ >+ Revoke Access+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog></>);};diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsxindex 0e068d8b0a..5290bfb2e4 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx@@ -1,43 +1,34 @@import { useState } from "react";-import {- faCopy,- faDoorClosed,- faEdit,- faEllipsisV,- faHeartPulse,- faInfoCircle,- faSearch,- faTrash-} from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useQuery } from "@tanstack/react-query";import { useNavigate } from "@tanstack/react-router";-import { PlusIcon, SearchIcon } from "lucide-react";+import {+ CopyIcon,+ DoorClosedIcon,+ HeartPulseIcon,+ InfoIcon,+ MoreHorizontalIcon,+ PencilIcon,+ PlusIcon,+ SearchIcon,+ TrashIcon+} from "lucide-react";import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";import { createNotification } from "@app/components/notifications";import { OrgPermissionCan } from "@app/components/permissions";import {- DeleteActionModal,- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- EmptyState,- IconButton,- Modal,- ModalContent,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tooltip,- Tr-} from "@app/components/v2";-import {+ Alert,+ AlertDescription,+ AlertDialog,+ AlertDialogAction,+ AlertDialogCancel,+ AlertDialogConfirmationField,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogTitle,+ Badge,Button,Card,CardAction,@@ -45,13 +36,41 @@ import {CardDescription,CardHeader,CardTitle,+ Dialog,+ DialogContent,+ DialogHeader,+ DialogTitle,DocumentationLinkBadge,+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuTrigger,+ Empty,+ EmptyHeader,+ EmptyMedia,+ EmptyTitle,+ Field,+ FieldLabel,+ IconButton,+ Input,InputGroup,InputGroupAddon,InputGroupInput,+ OverflowBadgeList,+ Skeleton,+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableHeadLabel,+ TableRow,Tabs,TabsList,- TabsTrigger+ TabsTrigger,+ Tooltip,+ TooltipContent,+ TooltipTrigger} from "@app/components/v3";import { useOrganization } from "@app/context";import {@@ -63,6 +82,7 @@ import { useSubscription } from "@app/context/SubscriptionContext";import { withPermission } from "@app/hoc";import { usePopUp } from "@app/hooks";import { useListGatewayPools } from "@app/hooks/api/gateway-pools";+import { TGatewayPool } from "@app/hooks/api/gateway-pools/types";import { gatewaysQueryKeys, useDeleteGatewayById } from "@app/hooks/api/gateways";import { useDeleteGatewayV2ById, useTriggerGatewayV2Heartbeat } from "@app/hooks/api/gateways-v2";@@ -71,6 +91,7 @@ import { EditGatewayDetailsModal } from "./components/EditGatewayDetailsModal";import { GatewayDeployModal } from "./components/GatewayDeployModal";import { GatewayHealthStatus } from "./components/GatewayHealthStatus";import { GatewayPoolsContent } from "./components/GatewayPoolsContent";+import { PoolDetailSheet } from "./components/PoolDetailSheet";export const GatewayTab = withPermission(() => {@@ -84,19 +105,22 @@ export const GatewayTab = withPermission(const showPoolsTab = subscription?.gatewayPool;const [search, setSearch] = useState("");const [poolSearch, setPoolSearch] = useState("");+ const [selectedPoolId, setSelectedPoolId] = useState<string | null>(null);+ const [deleteConfirmation, setDeleteConfirmation] = useState("");const { data: gateways, isPending: isGatewaysLoading } = useQuery({...gatewaysQueryKeys.listWithTokens(),refetchInterval: 15_000});const { data: pools } = useListGatewayPools({ enabled: Boolean(showPoolsTab) });+ const selectedPool = pools?.find((pool) => pool.id === selectedPoolId) ?? null;- // Build reverse map: gatewayId -> pool names- const gatewayPoolMap = new Map<string, string[]>();+ // Build reverse map: gatewayId -> pools+ const gatewayPoolMap = new Map<string, TGatewayPool[]>();if (showPoolsTab && pools) {pools.forEach((pool) => {pool.memberGatewayIds.forEach((gwId) => {const existing = gatewayPoolMap.get(gwId) ?? [];- existing.push(pool.name);+ existing.push(pool);gatewayPoolMap.set(gwId, existing);});});@@ -128,13 +152,17 @@ export const GatewayTab = withPermission(const handleDeleteGateway = async () => {const data = popUp.deleteGateway.data as { id: string; isV1: boolean };- if (data.isV1) {- await deleteGatewayById.mutateAsync(data.id);- } else {- await deleteGatewayV2ById.mutateAsync(data.id);+ try {+ if (data.isV1) {+ await deleteGatewayById.mutateAsync(data.id);+ } else {+ await deleteGatewayV2ById.mutateAsync(data.id);+ }+ handlePopUpToggle("deleteGateway", false);+ createNotification({ type: "success", text: "Successfully deleted gateway" });+ } catch {+ createNotification({ type: "error", text: "Failed to delete gateway" });}- handlePopUpToggle("deleteGateway");- createNotification({ type: "success", text: "Successfully deleted gateway" });};const filteredGateway = gateways?.filter((el) =>@@ -157,7 +185,7 @@ export const GatewayTab = withPermission(<CardDescription>{activeSubTab === "gateway-pools"? "Pool gateways for high availability and automatic failover"- : "Create and configure gateways to access private network resources from Infisical"}+ : "Create and manage gateways that securely proxy Infisical traffic into your infrastructure"}</CardDescription><CardAction>{activeSubTab === "all-gateways" ? (@@ -239,119 +267,152 @@ export const GatewayTab = withPermission({activeSubTab === "gateway-pools" ? (<GatewayPoolsContent search={poolSearch} />) : (- <TableContainer>- <Table>- <THead>- <Tr>- <Th className="w-1/3">Name</Th>- {showPoolsTab && <Th>Pools</Th>}- <Th>Connected</Th>- <Th>- Health Check- <Tooltip- asChild={false}- className="normal-case"- content="The last known healthcheck. Triggers every 3 minutes."- >- <FontAwesomeIcon icon={faInfoCircle} className="ml-2" />- </Tooltip>- </Th>- <Th className="w-5" />- </Tr>- </THead>- <TBody>- {isGatewaysLoading && (- <TableSkeleton- innerKey="gateway-table"- columns={showPoolsTab ? 5 : 4}- key="gateway-table"- />- )}- {filteredGateway?.map((el) => {- const canNavigate = !el.isV1;- return (- <Tr- key={el.id}- className={- canNavigate ? "cursor-pointer hover:bg-mineshaft-700" : undefined- }- onClick={- canNavigate- ? () =>- navigate({- to: "/organizations/$orgId/networking/gateways/$gatewayId",- params: { orgId, gatewayId: el.id }- })- : undefined- }- >- <Td>- <div className="flex items-center gap-2">- <span>{el.name}</span>- <span className="rounded-sm bg-mineshaft-700 px-1.5 py-0.5 text-xs text-mineshaft-400">- Gateway v{el.isV1 ? "1" : "2"}- </span>- </div>- </Td>- {showPoolsTab && (- <Td>- {(gatewayPoolMap.get(el.id) ?? []).length > 0 ? (- <div className="flex flex-wrap gap-1">- {(gatewayPoolMap.get(el.id) ?? []).map((poolName) => (- <span- key={poolName}- className="rounded-sm bg-info/15 px-1.5 py-0.5 text-xs text-info"- >- {poolName}- </span>- ))}- </div>+ <>+ {!isGatewaysLoading && !filteredGateway?.length ? (+ <Empty className="border">+ <EmptyHeader>+ <EmptyMedia variant="icon">+ {gateways?.length ? <SearchIcon /> : <DoorClosedIcon />}+ </EmptyMedia>+ <EmptyTitle>+ {gateways?.length+ ? "No gateways match your search"+ : "No gateways configured"}+ </EmptyTitle>+ </EmptyHeader>+ </Empty>+ ) : (+ <Table className="min-w-[57rem] table-fixed">+ <TableHeader>+ <TableRow>+ <TableHead className="w-80 min-w-80">+ <TableHeadLabel>Name</TableHeadLabel>+ </TableHead>+ {showPoolsTab && (+ <TableHead className="w-[28%]">+ <TableHeadLabel>Pools</TableHeadLabel>+ </TableHead>+ )}+ <TableHead className="w-36">+ <TableHeadLabel>Connected</TableHeadLabel>+ </TableHead>+ <TableHead className="w-40">+ <TableHeadLabel+ trailing={+ <Tooltip>+ <TooltipTrigger asChild>+ <InfoIcon className="size-3" />+ </TooltipTrigger>+ <TooltipContent>+ The last known health check. Triggers every 3 minutes.+ </TooltipContent>+ </Tooltip>+ }+ >+ Health Check+ </TableHeadLabel>+ </TableHead>+ <TableHead className="w-12" />+ </TableRow>+ </TableHeader>+ <TableBody>+ {isGatewaysLoading &&+ ["first", "second", "third"].map((row) => (+ <TableRow key={`gateway-skeleton-${row}`}>+ {["name", "pools", "connected", "health", "actions"]+ .slice(0, showPoolsTab ? 5 : 4)+ .map((cell) => (+ <TableCell key={`gateway-skeleton-${row}-${cell}`}>+ <Skeleton className="h-4 w-full" />+ </TableCell>+ ))}+ </TableRow>+ ))}+ {filteredGateway?.map((el) => {+ const canNavigate = !el.isV1;+ return (+ <TableRow+ key={el.id}+ className={canNavigate ? "cursor-pointer" : undefined}+ onClick={+ canNavigate+ ? () =>+ navigate({+ to: "/organizations/$orgId/networking/gateways/$gatewayId",+ params: { orgId, gatewayId: el.id }+ })+ : undefined+ }+ >+ <TableCell className="min-w-80">+ <div className="flex min-w-0 items-center gap-2">+ <Tooltip>+ <TooltipTrigger asChild>+ <span className="min-w-0 flex-1 truncate">{el.name}</span>+ </TooltipTrigger>+ <TooltipContent>{el.name}</TooltipContent>+ </Tooltip>+ {el.isV1 && (+ <Tooltip>+ <TooltipTrigger asChild>+ <Badge variant="neutral" className="shrink-0">+ V1+ </Badge>+ </TooltipTrigger>+ <TooltipContent>Legacy</TooltipContent>+ </Tooltip>+ )}+ </div>+ </TableCell>+ {showPoolsTab && (+ <TableCell className="min-w-0">+ {(gatewayPoolMap.get(el.id) ?? []).length > 0 ? (+ <OverflowBadgeList+ items={gatewayPoolMap.get(el.id) ?? []}+ getKey={(pool) => pool.id}+ getLabel={(pool) => pool.name}+ appearance="text"+ onItemClick={(pool) => setSelectedPoolId(pool.id)}+ maxBadgeWidth={144}+ />+ ) : (+ <span className="text-muted">—</span>+ )}+ </TableCell>+ )}+ <TableCell className="whitespace-nowrap">+ {!el.isV1 && el.connectedResourcesCount > 0 ? (+ <span>+ {el.connectedResourcesCount} resource+ {el.connectedResourcesCount !== 1 ? "s" : ""}+ </span>) : (- <span className="text-mineshaft-400">—</span>+ <span className="text-muted">—</span>)}- </Td>- )}- <Td>- {!el.isV1 && el.connectedResourcesCount > 0 ? (- <span className="text-mineshaft-200">- {el.connectedResourcesCount} resource- {el.connectedResourcesCount !== 1 ? "s" : ""}- </span>- ) : (- <span className="text-mineshaft-400">—</span>- )}- </Td>- <Td>- <GatewayHealthStatus- heartbeat={"heartbeat" in el ? el.heartbeat : null}- heartbeatTTL={"heartbeatTTL" in el ? el.heartbeatTTL : null}- />- </Td>- <Td className="w-5" onClick={(e) => e.stopPropagation()}>- <Tooltip className="max-w-sm text-center" content="Options">+ </TableCell>+ <TableCell className="whitespace-nowrap">+ <GatewayHealthStatus+ heartbeat={"heartbeat" in el ? el.heartbeat : null}+ heartbeatTTL={"heartbeatTTL" in el ? el.heartbeatTTL : null}+ />+ </TableCell>+ <TableCell className="w-12" onClick={(e) => e.stopPropagation()}><DropdownMenu><DropdownMenuTrigger asChild>- <IconButton- ariaLabel="Options"- colorSchema="secondary"- className="w-6"- variant="plain"- >- <FontAwesomeIcon icon={faEllipsisV} />+ <IconButton aria-label="Gateway options" variant="ghost" size="sm">+ <MoreHorizontalIcon /></IconButton></DropdownMenuTrigger><DropdownMenuContent align="end"><DropdownMenuItem- icon={<FontAwesomeIcon icon={faCopy} />}onClick={() => navigator.clipboard.writeText(el.id)}>+ <CopyIcon />Copy ID</DropdownMenuItem>{!el.isV1 && (!!el.heartbeat || !!el.heartbeatTTL) && (- <DropdownMenuItem- icon={<FontAwesomeIcon icon={faHeartPulse} />}- onClick={() => handleTriggerHealthCheck(el.id)}- >+ <DropdownMenuItem onClick={() => handleTriggerHealthCheck(el.id)}>+ <HeartPulseIcon />Trigger Health Check</DropdownMenuItem>)}@@ -363,9 +424,9 @@ export const GatewayTab = withPermission({(isAllowed: boolean) => (<DropdownMenuItemisDisabled={!isAllowed}- icon={<FontAwesomeIcon icon={faEdit} />}onClick={() => handlePopUpOpen("editDetails", el)}>+ <PencilIcon />Edit Details</DropdownMenuItem>)}@@ -378,58 +439,114 @@ export const GatewayTab = withPermission({(isAllowed: boolean) => (<DropdownMenuItemisDisabled={!isAllowed}- icon={<FontAwesomeIcon icon={faTrash} />}- className="text-red"+ variant="danger"onClick={() => handlePopUpOpen("deleteGateway", el)}>+ <TrashIcon />Delete Gateway</DropdownMenuItem>)}</OrgPermissionCan></DropdownMenuContent></DropdownMenu>- </Tooltip>- </Td>- </Tr>- );- })}- </TBody>- </Table>- <Modal- isOpen={popUp.editDetails.isOpen}+ </TableCell>+ </TableRow>+ );+ })}+ </TableBody>+ </Table>+ )}+ <Dialog+ open={popUp.editDetails.isOpen}onOpenChange={(isOpen) => handlePopUpToggle("editDetails", isOpen)}>- <ModalContent title="Edit Gateway">+ <DialogContent>+ <DialogHeader>+ <DialogTitle>Edit Gateway</DialogTitle>+ </DialogHeader><EditGatewayDetailsModalgatewayDetails={popUp.editDetails.data}onClose={() => handlePopUpToggle("editDetails")}/>- </ModalContent>- </Modal>- {!isGatewaysLoading && !filteredGateway?.length && (- <EmptyState- title={- gateways?.length- ? "No Gateways match search..."- : "No Gateways have been configured"- }- icon={gateways?.length ? faSearch : faDoorClosed}- />- )}- <DeleteActionModal- isOpen={popUp.deleteGateway.isOpen}- title={`Are you sure you want to delete gateway ${(popUp?.deleteGateway?.data as { name: string })?.name || ""}?`}- onChange={(isOpen) => handlePopUpToggle("deleteGateway", isOpen)}- deleteKey="confirm"- onDeleteApproved={() => handleDeleteGateway()}- />+ </DialogContent>+ </Dialog>+ <AlertDialog+ open={popUp.deleteGateway.isOpen}+ onOpenChange={(open) => {+ if (!open) setDeleteConfirmation("");+ handlePopUpToggle("deleteGateway", open);+ }}+ >+ <AlertDialogContent>+ <AlertDialogHeader>+ <AlertDialogTitle>Delete Gateway?</AlertDialogTitle>+ <AlertDialogDescription>+ This permanently removes the gateway from your organization.+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogConfirmationField>+ <Field>+ <FieldLabel htmlFor="delete-gateway-confirmation" size="sm">+ <span>+ Type "+ <span className="text-foreground">+ {(popUp.deleteGateway.data as { name?: string })?.name || "gateway"}+ </span>+ " to confirm.+ </span>+ </FieldLabel>+ <Input+ id="delete-gateway-confirmation"+ value={deleteConfirmation}+ onChange={(event) => setDeleteConfirmation(event.target.value)}+ placeholder={+ (popUp.deleteGateway.data as { name?: string })?.name || "gateway"+ }+ autoComplete="off"+ autoFocus+ />+ </Field>+ </AlertDialogConfirmationField>+ <Alert variant="danger" appearance="borderless">+ <AlertDescription>Deleting this gateway cannot be undone.</AlertDescription>+ </Alert>+ <AlertDialogFooter>+ <AlertDialogCancel+ isDisabled={deleteGatewayById.isPending || deleteGatewayV2ById.isPending}+ >+ Cancel+ </AlertDialogCancel>+ <AlertDialogAction+ variant="danger"+ isPending={deleteGatewayById.isPending || deleteGatewayV2ById.isPending}+ isDisabled={+ deleteConfirmation !==+ ((popUp.deleteGateway.data as { name?: string })?.name || "gateway")+ }+ onClick={(event) => {+ event.preventDefault();+ handleDeleteGateway();+ }}+ >+ Delete Gateway+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog><GatewayDeployModalisOpen={popUp.deployGateway.isOpen}onOpenChange={(isOpen) => handlePopUpToggle("deployGateway", isOpen)}/>- </TableContainer>+ </>)}</CardContent>+ <PoolDetailSheet+ isOpen={Boolean(selectedPoolId)}+ onOpenChange={(open) => {+ if (!open) setSelectedPoolId(null);+ }}+ pool={selectedPool}+ /><CreateGatewayPoolModalisOpen={popUp.createPool.isOpen}onToggle={(isOpen) => handlePopUpToggle("createPool", isOpen)}diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/CreateGatewayPoolModal.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/CreateGatewayPoolModal.tsxindex 3de6356cfd..1c7fa87b5d 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/CreateGatewayPoolModal.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/CreateGatewayPoolModal.tsx@@ -2,7 +2,19 @@ import { useMemo, useState } from "react";import { z } from "zod";import { createNotification } from "@app/components/notifications";-import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";+import {+ Button,+ Dialog,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+ Field,+ FieldError,+ FieldLabel,+ Input+} from "@app/components/v3";import { useCreateGatewayPool, useListGatewayPools } from "@app/hooks/api/gateway-pools";import { slugSchema } from "@app/lib/schemas";@@ -59,8 +71,8 @@ export const CreateGatewayPoolModal = ({ isOpen, onToggle }: Props) => {};return (- <Modal- isOpen={isOpen}+ <Dialog+ open={isOpen}onOpenChange={(open) => {if (!open) {setName("");@@ -69,24 +81,34 @@ export const CreateGatewayPoolModal = ({ isOpen, onToggle }: Props) => {onToggle(open);}}>- <ModalContent title="Create Gateway Pool">- <FormControl label="Name" isRequired isError={Boolean(errors.name)} errorText={errors.name}>+ <DialogContent>+ <DialogHeader>+ <DialogTitle>Create Gateway Pool</DialogTitle>+ <DialogDescription>+ Group gateways for high availability and automatic failover.+ </DialogDescription>+ </DialogHeader>+ <Field data-invalid={Boolean(errors.name)}>+ <FieldLabel htmlFor="gateway-pool-name">Name</FieldLabel><Input+ id="gateway-pool-name"value={name}onChange={(e) => setName(e.target.value)}placeholder="Enter gateway pool name"autoFocus+ isError={Boolean(errors.name)}/>- </FormControl>- <div className="mt-4 flex justify-end gap-2">- <Button variant="outline_bg" onClick={() => onToggle(false)} type="button">+ <FieldError>{errors.name}</FieldError>+ </Field>+ <DialogFooter>+ <Button variant="ghost" onClick={() => onToggle(false)} type="button">Cancel</Button>- <Button onClick={handleSubmit} isLoading={createPool.isPending}>+ <Button variant="org" onClick={handleSubmit} isPending={createPool.isPending}>Create Pool</Button>- </div>- </ModalContent>- </Modal>+ </DialogFooter>+ </DialogContent>+ </Dialog>);};diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/EditGatewayPoolModal.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/EditGatewayPoolModal.tsxindex f38be23be8..3e505d6983 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/EditGatewayPoolModal.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/EditGatewayPoolModal.tsx@@ -2,7 +2,19 @@ import { useEffect, useMemo, useState } from "react";import { z } from "zod";import { createNotification } from "@app/components/notifications";-import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";+import {+ Button,+ Dialog,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+ Field,+ FieldError,+ FieldLabel,+ Input+} from "@app/components/v3";import { useListGatewayPools, useUpdateGatewayPool } from "@app/hooks/api/gateway-pools";import { TGatewayPool } from "@app/hooks/api/gateway-pools/types";import { slugSchema } from "@app/lib/schemas";@@ -67,20 +79,31 @@ export const EditGatewayPoolModal = ({ isOpen, onToggle, pool }: Props) => {};return (- <Modal isOpen={isOpen} onOpenChange={onToggle}>- <ModalContent title="Edit Gateway Pool">- <FormControl label="Name" isRequired isError={Boolean(errors.name)} errorText={errors.name}>- <Input value={name} onChange={(e) => setName(e.target.value)} />- </FormControl>- <div className="mt-4 flex justify-end gap-2">- <Button variant="outline_bg" onClick={() => onToggle(false)} type="button">+ <Dialog open={isOpen} onOpenChange={onToggle}>+ <DialogContent>+ <DialogHeader>+ <DialogTitle>Edit Gateway Pool</DialogTitle>+ <DialogDescription>Update the name shown across your organization.</DialogDescription>+ </DialogHeader>+ <Field data-invalid={Boolean(errors.name)}>+ <FieldLabel htmlFor="edit-gateway-pool-name">Name</FieldLabel>+ <Input+ id="edit-gateway-pool-name"+ value={name}+ onChange={(e) => setName(e.target.value)}+ isError={Boolean(errors.name)}+ />+ <FieldError>{errors.name}</FieldError>+ </Field>+ <DialogFooter>+ <Button variant="ghost" onClick={() => onToggle(false)} type="button">Cancel</Button>- <Button onClick={handleSubmit} isLoading={updatePool.isPending}>- Save+ <Button variant="org" onClick={handleSubmit} isPending={updatePool.isPending}>+ Save Changes</Button>- </div>- </ModalContent>- </Modal>+ </DialogFooter>+ </DialogContent>+ </Dialog>);};diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayDeployModal.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayDeployModal.tsxindex b6d023c938..446bd9ab88 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayDeployModal.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayDeployModal.tsx@@ -5,7 +5,20 @@ import { useNavigate } from "@tanstack/react-router";import { z } from "zod";import { createNotification } from "@app/components/notifications";-import { Button, FormControl, Input, Modal, ModalClose, ModalContent } from "@app/components/v2";+import {+ Button,+ Dialog,+ DialogClose,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+ Field,+ FieldError,+ FieldLabel,+ Input+} from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { useOrganization } from "@app/context";import { gatewaysQueryKeys } from "@app/hooks/api/gateways";@@ -33,74 +46,87 @@ const Content = ({ onClose }: { onClose: () => void }) => {const {control,handleSubmit,+ watch,formState: { isSubmitting }} = useForm<FormData>({resolver: zodResolver(formSchema),defaultValues: { name: "" }});+ const name = watch("name");+ const isNameProvided = Boolean(name.trim());- const onSubmit = async ({ name }: FormData) => {+ const onSubmit = async ({ name: gatewayName }: FormData) => {const existingNames = gateways?.map((g) => g.name) ?? [];- if (existingNames.includes(name.trim())) {+ if (existingNames.includes(gatewayName.trim())) {createNotification({ type: "error", text: "A gateway with this name already exists." });return;}try {- const gateway = await createGateway({ name, authMethod: { method: "token" } });+ const gateway = await createGateway({+ name: gatewayName,+ authMethod: { method: "token" }+ });onClose();navigate({to: "/organizations/$orgId/networking/gateways/$gatewayId" as const,params: { orgId, gatewayId: gateway.id }});} catch {- createNotification({ type: "error", text: "Failed to create gateway" });+ // The shared mutation error handler displays the API error.}};return (- <form onSubmit={handleSubmit(onSubmit)}>+ <form className="contents" onSubmit={handleSubmit(onSubmit)}><Controllercontrol={control}name="name"render={({ field, fieldState: { error } }) => (- <FormControl- label="Name"- tooltipText="The name for your gateway."- isError={Boolean(error)}- errorText={error?.message}- >- <Input {...field} placeholder="Enter gateway name..." />- </FormControl>+ <Field data-invalid={Boolean(error)}>+ <FieldLabel htmlFor="gateway-name">Name</FieldLabel>+ <Input+ id="gateway-name"+ {...field}+ placeholder="Enter gateway name"+ isError={Boolean(error)}+ autoFocus+ />+ <FieldError>{error?.message}</FieldError>+ </Field>)}/>-- <div className="mt-6 flex items-center">+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="ghost" type="button">+ Cancel+ </Button>+ </DialogClose><Button- className="mr-4"- size="sm"- colorSchema="secondary"+ variant="org"type="submit"- isLoading={isPending || isSubmitting}+ isPending={isPending || isSubmitting}+ isDisabled={!isNameProvided}>- Create+ Create Gateway</Button>- <ModalClose asChild>- <Button colorSchema="secondary" variant="plain">- Cancel- </Button>- </ModalClose>- </div>+ </DialogFooter></form>);};export const GatewayDeployModal = ({ isOpen, onOpenChange }: Props) => {return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent className="max-w-md" title="Create Gateway" bodyClassName="overflow-visible">+ <Dialog open={isOpen} onOpenChange={onOpenChange}>+ <DialogContent>+ <DialogHeader>+ <DialogTitle>Create Gateway</DialogTitle>+ <DialogDescription>+ Create a gateway to securely proxy Infisical traffic into your infrastructure.+ </DialogDescription>+ </DialogHeader><Content onClose={() => onOpenChange(false)} />- </ModalContent>- </Modal>+ </DialogContent>+ </Dialog>);};diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayHealthStatus.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayHealthStatus.tsxindex 559509cda8..c15debc146 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayHealthStatus.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayHealthStatus.tsx@@ -1,6 +1,7 @@import { format } from "date-fns";+import { CircleCheckIcon, CircleDashedIcon, CircleXIcon } from "lucide-react";-import { Tooltip, TooltipContent, TooltipTrigger } from "@app/components/v3";+import { Badge, Tooltip, TooltipContent, TooltipTrigger } from "@app/components/v3";import { isGatewayHealthy } from "@app/hooks/api/gateways-v2/utils";export const GatewayHealthStatus = ({@@ -11,7 +12,12 @@ export const GatewayHealthStatus = ({heartbeatTTL?: number | null;}) => {if (!heartbeat && !heartbeatTTL) {- return <span className="cursor-default text-yellow-500">Unregistered</span>;+ return (+ <Badge variant="warning" iconPosition="left">+ <CircleDashedIcon />+ Unregistered+ </Badge>+ );}const heartbeatDate = heartbeat ? new Date(heartbeat) : null;@@ -20,14 +26,13 @@ export const GatewayHealthStatus = ({return (<Tooltip><TooltipTrigger asChild>- <span className={`cursor-default ${isHealthy ? "text-green-400" : "text-red-400"}`}>+ <Badge variant={isHealthy ? "success" : "danger"} iconPosition="left">+ {isHealthy ? <CircleCheckIcon /> : <CircleXIcon />}{isHealthy ? "Healthy" : "Unreachable"}- </span>+ </Badge></TooltipTrigger><TooltipContent>- {heartbeatDate- ? `Last seen: ${format(heartbeatDate, "PPpp")} (${heartbeatDate.toUTCString()})`- : "No data available"}+ {heartbeatDate ? `Last seen ${format(heartbeatDate, "PPp")}` : "No data available"}</TooltipContent></Tooltip>);diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayPoolsContent.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayPoolsContent.tsxindex d8f5d57066..0a086b41c1 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayPoolsContent.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayPoolsContent.tsx@@ -1,25 +1,48 @@import { useState } from "react";-import { faEllipsisV, faPen, faTrash } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import {+ DoorClosedIcon,+ ExternalLinkIcon,+ MoreHorizontalIcon,+ PencilIcon,+ SearchIcon,+ Settings2Icon,+ TrashIcon+} from "lucide-react";import { createNotification } from "@app/components/notifications";import {- DeleteActionModal,+ Alert,+ AlertDescription,+ AlertDialog,+ AlertDialogAction,+ AlertDialogCancel,+ AlertDialogConfirmationField,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogTitle,DropdownMenu,DropdownMenuContent,DropdownMenuItem,DropdownMenuTrigger,- EmptyState,+ Empty,+ EmptyHeader,+ EmptyMedia,+ EmptyTitle,+ Field,+ FieldLabel,IconButton,+ Input,+ Skeleton,Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tr-} from "@app/components/v2";+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableHeadLabel,+ TableRow+} from "@app/components/v3";import { useSubscription } from "@app/context/SubscriptionContext";import { usePopUp } from "@app/hooks";import { useDeleteGatewayPool, useListGatewayPools } from "@app/hooks/api/gateway-pools";@@ -39,6 +62,7 @@ export const GatewayPoolsContent = ({ search }: Props) => {const isEnterprise = subscription?.gatewayPool;const [selectedPoolId, setSelectedPoolId] = useState<string | null>(null);const [resourcesPool, setResourcesPool] = useState<{ id: string; name: string } | null>(null);+ const [deleteConfirmation, setDeleteConfirmation] = useState("");const { data: pools, isLoading: isPoolsLoading } = useListGatewayPools({refetchInterval: 15_000,enabled: Boolean(isEnterprise)@@ -70,26 +94,50 @@ export const GatewayPoolsContent = ({ search }: Props) => {return (<div>- <TableContainer>- <Table>- <THead>- <Tr>- <Th className="w-1/3">Name</Th>- <Th>Connected</Th>- <Th>Health</Th>- <Th className="w-5" />- </Tr>- </THead>- <TBody>- {isPoolsLoading && <TableSkeleton innerKey="pool-table" columns={4} key="pool-table" />}+ {!isPoolsLoading && !filteredPools?.length ? (+ <Empty className="border">+ <EmptyHeader>+ <EmptyMedia variant="icon">+ {pools?.length ? <SearchIcon /> : <DoorClosedIcon />}+ </EmptyMedia>+ <EmptyTitle>+ {pools?.length ? "No gateway pools match your search" : "No gateway pools configured"}+ </EmptyTitle>+ </EmptyHeader>+ </Empty>+ ) : (+ <Table className="min-w-[52rem] table-fixed">+ <TableHeader>+ <TableRow>+ <TableHead className="w-80 min-w-80">+ <TableHeadLabel>Name</TableHeadLabel>+ </TableHead>+ <TableHead className="w-36">+ <TableHeadLabel>Connected</TableHeadLabel>+ </TableHead>+ <TableHead className="w-40">+ <TableHeadLabel>Health</TableHeadLabel>+ </TableHead>+ <TableHead className="w-12" />+ </TableRow>+ </TableHeader>+ <TableBody>+ {isPoolsLoading &&+ ["first", "second", "third"].map((row) => (+ <TableRow key={`pool-skeleton-${row}`}>+ {["name", "connected", "health", "actions"].map((cell) => (+ <TableCell key={`pool-skeleton-${row}-${cell}`}>+ <Skeleton className="h-4 w-full" />+ </TableCell>+ ))}+ </TableRow>+ ))}{filteredPools?.map((pool) => (- <Tr- key={pool.id}- className="cursor-pointer hover:bg-mineshaft-700/50"- onClick={() => setSelectedPoolId(pool.id)}- >- <Td>{pool.name}</Td>- <Td>+ <TableRow key={pool.id} onClick={() => setSelectedPoolId(pool.id)}>+ <TableCell className="min-w-80 font-medium">+ <span className="block truncate">{pool.name}</span>+ </TableCell>+ <TableCell>{pool.connectedResourcesCount > 0 ? (<buttontype="button"@@ -97,19 +145,19 @@ export const GatewayPoolsContent = ({ search }: Props) => {e.stopPropagation();setResourcesPool({ id: pool.id, name: pool.name });}}- className="cursor-pointer text-mineshaft-200 underline decoration-mineshaft-400 underline-offset-2 hover:text-mineshaft-100 hover:decoration-mineshaft-300"+ className="cursor-pointer text-foreground underline decoration-muted underline-offset-2 hover:decoration-foreground">{pool.connectedResourcesCount} resource{pool.connectedResourcesCount !== 1 ? "s" : ""}</button>) : (- <span className="text-mineshaft-400">—</span>+ <span className="text-muted">—</span>)}- </Td>- <Td>+ </TableCell>+ <TableCell><PoolHealthBadge pool={pool} />- </Td>- <Td>+ </TableCell>+ <TableCell className="w-12"><divonClick={(e) => e.stopPropagation()}onKeyDown={(e) => e.stopPropagation()}@@ -117,40 +165,48 @@ export const GatewayPoolsContent = ({ search }: Props) => {><DropdownMenu><DropdownMenuTrigger asChild>- <IconButton ariaLabel="Options" variant="plain" size="sm" className="p-1.5">- <FontAwesomeIcon icon={faEllipsisV} />+ <IconButton aria-label="Gateway pool options" variant="ghost" size="sm">+ <MoreHorizontalIcon /></IconButton></DropdownMenuTrigger><DropdownMenuContent align="end">- <DropdownMenuItem- icon={<FontAwesomeIcon icon={faPen} />}- onClick={() => handlePopUpOpen("editPool", pool)}- >+ <DropdownMenuItem onClick={() => setSelectedPoolId(pool.id)}>+ <Settings2Icon />+ Manage Gateways+ </DropdownMenuItem>+ {pool.connectedResourcesCount > 0 && (+ <DropdownMenuItem+ onClick={() =>+ setResourcesPool({+ id: pool.id,+ name: pool.name+ })+ }+ >+ <ExternalLinkIcon />+ View Resources+ </DropdownMenuItem>+ )}+ <DropdownMenuItem onClick={() => handlePopUpOpen("editPool", pool)}>+ <PencilIcon />Edit</DropdownMenuItem><DropdownMenuItem- icon={<FontAwesomeIcon icon={faTrash} />}onClick={() => handlePopUpOpen("deletePool", pool)}- className="text-red-500"+ variant="danger">+ <TrashIcon />Delete</DropdownMenuItem></DropdownMenuContent></DropdownMenu></div>- </Td>- </Tr>+ </TableCell>+ </TableRow>))}- {!isPoolsLoading && !filteredPools?.length && (- <Tr>- <Td colSpan={4}>- <EmptyState title="No gateway pools found" />- </Td>- </Tr>- )}- </TBody>+ </TableBody></Table>- </TableContainer>+ )}<PoolDetailSheetisOpen={Boolean(selectedPoolId)}@@ -174,13 +230,62 @@ export const GatewayPoolsContent = ({ search }: Props) => {onToggle={(isOpen) => handlePopUpToggle("editPool", isOpen)}pool={popUp.editPool.data as TGatewayPool}/>- <DeleteActionModal- isOpen={popUp.deletePool.isOpen}- title={`Delete pool "${(popUp.deletePool.data as TGatewayPool)?.name ?? ""}"?`}- onChange={(isOpen) => handlePopUpToggle("deletePool", isOpen)}- deleteKey="confirm"- onDeleteApproved={handleDeletePool}- />+ <AlertDialog+ open={popUp.deletePool.isOpen}+ onOpenChange={(open) => {+ if (!open) setDeleteConfirmation("");+ handlePopUpToggle("deletePool", open);+ }}+ >+ <AlertDialogContent>+ <AlertDialogHeader>+ <AlertDialogTitle>Delete Gateway Pool?</AlertDialogTitle>+ <AlertDialogDescription>+ This permanently removes the gateway pool from your organization.+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogConfirmationField>+ <Field>+ <FieldLabel htmlFor="delete-pool-confirmation" size="sm">+ <span>+ Type "+ <span className="text-foreground">+ {(popUp.deletePool.data as TGatewayPool)?.name}+ </span>+ " to confirm.+ </span>+ </FieldLabel>+ <Input+ id="delete-pool-confirmation"+ value={deleteConfirmation}+ onChange={(event) => setDeleteConfirmation(event.target.value)}+ placeholder={(popUp.deletePool.data as TGatewayPool)?.name}+ autoComplete="off"+ autoFocus+ />+ </Field>+ </AlertDialogConfirmationField>+ <Alert variant="danger" appearance="borderless">+ <AlertDescription>Deleting this gateway pool cannot be undone.</AlertDescription>+ </Alert>+ <AlertDialogFooter>+ <AlertDialogCancel isDisabled={deletePool.isPending}>Cancel</AlertDialogCancel>+ <AlertDialogAction+ variant="danger"+ isPending={deletePool.isPending}+ isDisabled={+ deleteConfirmation !== (popUp.deletePool.data as TGatewayPool | undefined)?.name+ }+ onClick={(event) => {+ event.preventDefault();+ handleDeletePool();+ }}+ >+ Delete Pool+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog></div>);};diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolConnectedResourcesDrawer.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolConnectedResourcesDrawer.tsxindex c5ea5ef77b..cc44a18273 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolConnectedResourcesDrawer.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolConnectedResourcesDrawer.tsx@@ -117,7 +117,7 @@ export const PoolConnectedResourcesDrawer = ({ isOpen, onOpenChange, poolId, poo<span className="flex-1">Kubernetes Auth</span><Badge variant="neutral">{resources?.kubernetesAuths.length}</Badge></AccordionTrigger>- <AccordionContent className="p-0">+ <AccordionContent className="group-data-[variant=default]/accordion:p-0">{resources?.kubernetesAuths.map((auth, idx) => (<ResourceRowkey={auth.id}@@ -141,7 +141,7 @@ export const PoolConnectedResourcesDrawer = ({ isOpen, onOpenChange, poolId, poo<span className="flex-1">PKI Discovery</span><Badge variant="neutral">{resources?.pkiDiscoveryConfigs.length}</Badge></AccordionTrigger>- <AccordionContent className="p-0">+ <AccordionContent className="group-data-[variant=default]/accordion:p-0">{resources?.pkiDiscoveryConfigs.map((r, idx) => (<ResourceRowkey={r.id}@@ -160,7 +160,7 @@ export const PoolConnectedResourcesDrawer = ({ isOpen, onOpenChange, poolId, poo<span className="flex-1">App Connections</span><Badge variant="neutral">{resources?.appConnections.length}</Badge></AccordionTrigger>- <AccordionContent className="p-0">+ <AccordionContent className="group-data-[variant=default]/accordion:p-0">{resources?.appConnections.map((r, idx) => (<ResourceRowkey={r.id}@@ -179,7 +179,7 @@ export const PoolConnectedResourcesDrawer = ({ isOpen, onOpenChange, poolId, poo<span className="flex-1">Dynamic Secrets</span><Badge variant="neutral">{resources?.dynamicSecrets.length}</Badge></AccordionTrigger>- <AccordionContent className="p-0">+ <AccordionContent className="group-data-[variant=default]/accordion:p-0">{resources?.dynamicSecrets.map((r, idx) => (<ResourceRowkey={r.id}diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolDetailSheet.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolDetailSheet.tsxindex 960890d30e..fc07b200ff 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolDetailSheet.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolDetailSheet.tsx@@ -1,26 +1,33 @@import { useMemo, useState } from "react";-import { faEllipsisV, faHeartPulse, faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";+import { faEllipsisV, faHeartPulse, faTrash } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useQuery } from "@tanstack/react-query";import { createNotification } from "@app/components/notifications";import { OrgPermissionCan } from "@app/components/permissions";-import { Button, DeleteActionModal, IconButton } from "@app/components/v2";import {+ Alert,+ AlertDescription,+ AlertDialog,+ AlertDialogAction,+ AlertDialogCancel,+ AlertDialogConfirmationField,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogTitle,Badge,- Command,- CommandEmpty,- CommandGroup,- CommandInput,- CommandItem,- CommandList,+ Button,DropdownMenu,DropdownMenuContent,DropdownMenuItem,DropdownMenuTrigger,- Popover,- PopoverContent,- PopoverTrigger,+ Field,+ FieldLabel,+ FilterableSelect,+ IconButton,+ Input,Sheet,SheetContent,SheetHeader,@@ -30,7 +37,11 @@ import {TableCell,TableHead,TableHeader,- TableRow+ TableHeadLabel,+ TableRow,+ Tooltip,+ TooltipContent,+ TooltipTrigger} from "@app/components/v3";import {OrgGatewayPoolPermissionActions,@@ -51,6 +62,11 @@ type Props = {pool: TGatewayPool | null;};+type GatewayOption = {+ label: string;+ value: string;+};+export const PoolDetailSheet = ({ isOpen, onOpenChange, pool }: Props) => {const { data: allGateways } = useQuery({...gatewaysQueryKeys.list(),@@ -59,7 +75,8 @@ export const PoolDetailSheet = ({ isOpen, onOpenChange, pool }: Props) => {const addGateway = useAddGatewayToPool();const removeGateway = useRemoveGatewayFromPool();const triggerHealthCheck = useTriggerGatewayV2Heartbeat();- const [isAddGatewayOpen, setIsAddGatewayOpen] = useState(false);+ const [selectedGateways, setSelectedGateways] = useState<GatewayOption[]>([]);+ const [removeConfirmation, setRemoveConfirmation] = useState("");const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["removeGateway"] as const);@@ -73,13 +90,26 @@ export const PoolDetailSheet = ({ isOpen, onOpenChange, pool }: Props) => {[allGateways, pool?.memberGatewayIds]);- const handleAdd = async (gatewayId: string) => {- if (!pool) return;+ const gatewayOptions = useMemo(+ () => availableGateways.map((gateway) => ({ label: gateway.name, value: gateway.id })),+ [availableGateways]+ );++ const handleAdd = async () => {+ if (!pool || selectedGateways.length === 0) return;try {- await addGateway.mutateAsync({ poolId: pool.id, gatewayId });- createNotification({ type: "success", text: "Gateway added to pool" });+ await Promise.all(+ selectedGateways.map(({ value: gatewayId }) =>+ addGateway.mutateAsync({ poolId: pool.id, gatewayId })+ )+ );+ createNotification({+ type: "success",+ text: `${selectedGateways.length} gateway${selectedGateways.length === 1 ? "" : "s"} added to pool`+ });+ setSelectedGateways([]);} catch (err: unknown) {- const message = err instanceof Error ? err.message : "Failed to add gateway";+ const message = err instanceof Error ? err.message : "Failed to add gateways";createNotification({ type: "error", text: message });}};@@ -143,8 +173,8 @@ export const PoolDetailSheet = ({ isOpen, onOpenChange, pool }: Props) => {</div><div>- <div className="mb-3 flex items-center justify-between">- <h4 className="text-sm font-medium text-foreground">Member Gateways</h4>+ <div className="mb-3 flex items-start justify-between gap-3">+ <h4 className="pt-2 text-sm font-medium text-foreground">Member Gateways</h4><OrgPermissionCanI={OrgGatewayPoolPermissionActions.EditGatewayPools}a={OrgPermissionSubjects.GatewayPool}@@ -152,52 +182,45 @@ export const PoolDetailSheet = ({ isOpen, onOpenChange, pool }: Props) => {{(isAllowed: boolean) => {const isDisabled = !isAllowed || availableGateways.length === 0;return (- <Popover open={isAddGatewayOpen} onOpenChange={setIsAddGatewayOpen} modal>- <PopoverTrigger asChild>- <Button- variant="outline_bg"- size="xs"- leftIcon={<FontAwesomeIcon icon={faPlus} />}- isDisabled={isDisabled}- >- Add Gateway- </Button>- </PopoverTrigger>- <PopoverContent align="end" className="z-[60] w-56 p-0">- <Command>- <CommandInput placeholder="Search gateways..." />- <CommandList>- <CommandEmpty>No gateways available.</CommandEmpty>- <CommandGroup>- {availableGateways.map((gw) => (- <CommandItem- key={gw.id}- value={gw.id}- keywords={[gw.name]}- onSelect={() => {- setIsAddGatewayOpen(false);- handleAdd(gw.id);- }}- >- {gw.name}- </CommandItem>- ))}- </CommandGroup>- </CommandList>- </Command>- </PopoverContent>- </Popover>+ <div className="flex min-w-0 items-start gap-2">+ <FilterableSelect<GatewayOption>+ isMulti+ value={selectedGateways}+ onChange={(value) =>+ setSelectedGateways(Array.isArray(value) ? [...value] : [])+ }+ options={gatewayOptions}+ placeholder="Select gateways..."+ isDisabled={isDisabled || addGateway.isPending}+ menuPosition="fixed"+ className="w-64"+ />+ <Button+ variant="outline"+ size="sm"+ className="mt-0.5"+ isDisabled={!isAllowed || selectedGateways.length === 0}+ isPending={addGateway.isPending}+ onClick={handleAdd}+ >+ Add+ </Button>+ </div>);}}</OrgPermissionCan></div>- <Table>+ <Table className="table-fixed"><TableHeader><TableRow>- <TableHead>Name</TableHead>- <TableHead>Status</TableHead>- <TableHead className="w-5" />+ <TableHead>+ <TableHeadLabel>Name</TableHeadLabel>+ </TableHead>+ <TableHead className="w-36">+ <TableHeadLabel>Status</TableHeadLabel>+ </TableHead>+ <TableHead className="w-12" /></TableRow></TableHeader><TableBody>@@ -214,9 +237,18 @@ export const PoolDetailSheet = ({ isOpen, onOpenChange, pool }: Props) => {return (<TableRow key={gw.id}><TableCell>- <div className="flex items-center gap-2">- <span>{gw.name}</span>- <Badge variant="neutral">Gateway v{gw.isV1 ? "1" : "2"}</Badge>+ <div className="flex min-w-0 items-center gap-2">+ <span className="min-w-0 flex-1 truncate">{gw.name}</span>+ {gw.isV1 && (+ <Tooltip>+ <TooltipTrigger asChild>+ <Badge variant="neutral" className="shrink-0">+ V1+ </Badge>+ </TooltipTrigger>+ <TooltipContent>Legacy</TooltipContent>+ </Tooltip>+ )}</div></TableCell><TableCell>@@ -228,8 +260,8 @@ export const PoolDetailSheet = ({ isOpen, onOpenChange, pool }: Props) => {<DropdownMenu><DropdownMenuTrigger asChild><IconButton- ariaLabel="Options"- variant="plain"+ aria-label="Gateway options"+ variant="ghost"size="sm"className="p-1.5">@@ -263,14 +295,65 @@ export const PoolDetailSheet = ({ isOpen, onOpenChange, pool }: Props) => {</div></div>- <DeleteActionModal- isOpen={popUp.removeGateway.isOpen}- title={`Remove "${(popUp.removeGateway.data as { name: string } | undefined)?.name ?? ""}" from pool?`}- onChange={(open) => handlePopUpToggle("removeGateway", open)}- deleteKey="confirm"- buttonText="Remove"- onDeleteApproved={handleRemove}- />+ <AlertDialog+ open={popUp.removeGateway.isOpen}+ onOpenChange={(open) => {+ if (!open) setRemoveConfirmation("");+ handlePopUpToggle("removeGateway", open);+ }}+ >+ <AlertDialogContent>+ <AlertDialogHeader>+ <AlertDialogTitle>Remove Gateway from Gateway Pool?</AlertDialogTitle>+ </AlertDialogHeader>+ <AlertDialogConfirmationField>+ <Field>+ <FieldLabel htmlFor="remove-gateway-confirmation" size="sm">+ <span>+ Type "+ <span className="text-foreground">+ {(popUp.removeGateway.data as { name: string } | undefined)?.name}+ </span>+ " to confirm.+ </span>+ </FieldLabel>+ <Input+ id="remove-gateway-confirmation"+ value={removeConfirmation}+ onChange={(event) => setRemoveConfirmation(event.target.value)}+ placeholder={(popUp.removeGateway.data as { name: string } | undefined)?.name}+ autoComplete="off"+ autoFocus+ />+ </Field>+ </AlertDialogConfirmationField>+ <AlertDialogDescription asChild>+ <Alert variant="warning" appearance="borderless">+ <AlertDescription>+ Removing this gateway from the pool may interrupt traffic. The gateway will not be+ deleted and can be added back.+ </AlertDescription>+ </Alert>+ </AlertDialogDescription>+ <AlertDialogFooter>+ <AlertDialogCancel isDisabled={removeGateway.isPending}>Cancel</AlertDialogCancel>+ <AlertDialogAction+ variant="danger"+ isPending={removeGateway.isPending}+ isDisabled={+ removeConfirmation !==+ (popUp.removeGateway.data as { name: string } | undefined)?.name+ }+ onClick={(event) => {+ event.preventDefault();+ handleRemove();+ }}+ >+ Remove Gateway+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog></SheetContent></Sheet>);diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolHealthBadge.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolHealthBadge.tsxindex 792b600d6c..1d2122e094 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolHealthBadge.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/PoolHealthBadge.tsx@@ -1,18 +1,23 @@+import { Badge } from "@app/components/v3";import { TGatewayPool } from "@app/hooks/api/gateway-pools/types";+export const getPoolHealthBadgeVariant = ({+ memberCount,+ healthyMemberCount+}: Pick<TGatewayPool, "memberCount" | "healthyMemberCount">) => {+ if (memberCount === 0) return "neutral" as const;+ if (healthyMemberCount === 0) return "danger" as const;+ if (healthyMemberCount === memberCount) return "success" as const;+ return "warning" as const;+};+export const PoolHealthBadge = ({ pool }: { pool: TGatewayPool }) => {if (pool.memberCount === 0) {- return <span className="text-mineshaft-400">No members</span>;- }- let colorClass = "text-yellow-500";- if (pool.healthyMemberCount === 0) {- colorClass = "text-red-400";- } else if (pool.healthyMemberCount === pool.memberCount) {- colorClass = "text-green-500";+ return <Badge variant="neutral">No members</Badge>;}return (- <span className={colorClass}>+ <Badge variant={getPoolHealthBadgeVariant(pool)}>{pool.healthyMemberCount}/{pool.memberCount} healthy- </span>+ </Badge>);};diff --git a/frontend/src/pages/organization/NetworkingPage/components/NetworkingAuthMethodForm.tsx b/frontend/src/pages/organization/NetworkingPage/components/NetworkingAuthMethodForm.tsxnew file mode 100644index 0000000000..e7f06775ae--- /dev/null+++ b/frontend/src/pages/organization/NetworkingPage/components/NetworkingAuthMethodForm.tsx@@ -0,0 +1,237 @@+import { useEffect } from "react";+import { Controller, useForm } from "react-hook-form";+import { zodResolver } from "@hookform/resolvers/zod";+import { z } from "zod";++import {+ Button,+ Field,+ FieldContent,+ FieldError,+ FieldLabel,+ FilterableSelect,+ Input+} from "@app/components/v3";+import { useOrganization } from "@app/context";++import {+ NETWORKING_AUTH_METHOD_OPTIONS,+ NetworkingAuthMethod,+ NetworkingAuthMethodOption,+ NetworkingAuthMethodSingleValue+} from "./NetworkingAuthMethodLabel";++const schema = z+ .object({+ method: z.enum(["aws", "token"]),+ stsEndpoint: z.string(),+ allowedPrincipalArns: z.string(),+ allowedAccountIds: z.string()+ })+ .superRefine((data, ctx) => {+ if (+ data.method === "aws" &&+ !data.allowedPrincipalArns.trim() &&+ !data.allowedAccountIds.trim()+ ) {+ const message = "At least one of allowed principal ARNs or allowed account IDs must be set";+ ctx.addIssue({+ code: z.ZodIssueCode.custom,+ path: ["allowedPrincipalArns"],+ message+ });+ ctx.addIssue({+ code: z.ZodIssueCode.custom,+ path: ["allowedAccountIds"],+ message+ });+ }+ });++type FormData = z.infer<typeof schema>;++type AuthMethod =+ | {+ method: "aws";+ config: {+ stsEndpoint: string;+ allowedPrincipalArns: string;+ allowedAccountIds: string;+ };+ }+ | {+ method: "token";+ config?: unknown;+ };++type Props = {+ currentMethod: AuthMethod;+ isDisabled?: boolean;+ isPending: boolean;+ onUpdate: (authMethod: FormData) => Promise<boolean>;+};++export const NetworkingAuthMethodForm = ({+ currentMethod,+ isDisabled = false,+ isPending,+ onUpdate+}: Props) => {+ const { isSubOrganization } = useOrganization();+ const initialMethod: NetworkingAuthMethod = currentMethod.method;+ const initialAws = currentMethod.method === "aws" ? currentMethod.config : undefined;+ const defaultValues: FormData = {+ method: initialMethod,+ stsEndpoint: initialAws?.stsEndpoint ?? "https://sts.amazonaws.com/",+ allowedPrincipalArns: initialAws?.allowedPrincipalArns ?? "",+ allowedAccountIds: initialAws?.allowedAccountIds ?? ""+ };++ const {+ control,+ handleSubmit,+ watch,+ reset,+ formState: { isSubmitting, isDirty }+ } = useForm<FormData>({+ resolver: zodResolver(schema),+ defaultValues+ });++ useEffect(() => {+ reset(defaultValues);+ // The individual method values below are the server-backed reset boundary.+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [+ currentMethod.method,+ initialAws?.stsEndpoint,+ initialAws?.allowedPrincipalArns,+ initialAws?.allowedAccountIds,+ reset+ ]);++ const method = watch("method");+ const isSaving = isSubmitting || isPending;++ const submit = async (form: FormData) => {+ if (await onUpdate(form)) {+ reset(form);+ }+ };++ return (+ <form onSubmit={handleSubmit(submit)} className="space-y-3">+ <Controller+ control={control}+ name="method"+ render={({ field }) => {+ const selected =+ NETWORKING_AUTH_METHOD_OPTIONS.find((option) => option.value === field.value) ??+ NETWORKING_AUTH_METHOD_OPTIONS[0];++ return (+ <FilterableSelect+ value={selected}+ onChange={(option) => {+ const next = option as { value: NetworkingAuthMethod } | null;+ if (next) field.onChange(next.value);+ }}+ options={NETWORKING_AUTH_METHOD_OPTIONS}+ isSearchable={false}+ isClearable={false}+ isDisabled={isDisabled || isSaving}+ getOptionLabel={(option) => option.label}+ getOptionValue={(option) => option.value}+ components={{+ Option: NetworkingAuthMethodOption,+ SingleValue: NetworkingAuthMethodSingleValue+ }}+ />+ );+ }}+ />++ {method === "aws" && (+ <>+ <Controller+ control={control}+ name="allowedPrincipalArns"+ render={({ field, fieldState: { error } }) => (+ <Field>+ <FieldLabel>Allowed Principal ARNs</FieldLabel>+ <FieldContent>+ <Input+ {...field}+ disabled={isDisabled || isSaving}+ isError={Boolean(error)}+ placeholder="arn:aws:iam::123456789012:role/MyRoleName, ..."+ />+ <FieldError errors={[error]} />+ </FieldContent>+ </Field>+ )}+ />+ <Controller+ control={control}+ name="allowedAccountIds"+ render={({ field, fieldState: { error } }) => (+ <Field>+ <FieldLabel>Allowed Account IDs</FieldLabel>+ <FieldContent>+ <Input+ {...field}+ disabled={isDisabled || isSaving}+ isError={Boolean(error)}+ placeholder="123456789012, ..."+ />+ <FieldError errors={[error]} />+ </FieldContent>+ </Field>+ )}+ />+ <Controller+ control={control}+ name="stsEndpoint"+ render={({ field, fieldState: { error } }) => (+ <Field>+ <FieldLabel>STS Endpoint</FieldLabel>+ <FieldContent>+ <Input+ {...field}+ disabled={isDisabled || isSaving}+ isError={Boolean(error)}+ placeholder="https://sts.amazonaws.com/"+ />+ <FieldError errors={[error]} />+ </FieldContent>+ </Field>+ )}+ />+ </>+ )}++ {isDirty && (+ <div className="flex justify-end gap-2">+ <Button+ type="button"+ size="sm"+ variant="ghost"+ isDisabled={isSaving}+ onClick={() => reset()}+ >+ Cancel+ </Button>+ <Button+ type="submit"+ size="sm"+ variant={isSubOrganization ? "sub-org" : "org"}+ isPending={isSaving}+ isDisabled={isDisabled || isSaving}+ >+ Update+ </Button>+ </div>+ )}+ </form>+ );+};diff --git a/frontend/src/pages/organization/NetworkingPage/components/NetworkingAuthMethodLabel.tsx b/frontend/src/pages/organization/NetworkingPage/components/NetworkingAuthMethodLabel.tsxnew file mode 100644index 0000000000..591fe28243--- /dev/null+++ b/frontend/src/pages/organization/NetworkingPage/components/NetworkingAuthMethodLabel.tsx@@ -0,0 +1,70 @@+import {+ components as ReactSelectComponents,+ type OptionProps,+ type SingleValueProps+} from "react-select";+import { CheckIcon, KeyIcon } from "lucide-react";++export type NetworkingAuthMethod = "aws" | "token";++export type NetworkingAuthMethodOption = {+ value: NetworkingAuthMethod;+ label: string;+};++export const NETWORKING_AUTH_METHOD_OPTIONS: NetworkingAuthMethodOption[] = [+ { value: "token", label: "Token Auth" },+ { value: "aws", label: "AWS Auth" }+];++const NetworkingAuthMethodIcon = ({ method }: { method: NetworkingAuthMethod }) =>+ method === "aws" ? (+ <img+ src="/images/integrations/Amazon Web Services.png"+ alt=""+ aria-hidden+ className="size-4 object-contain"+ />+ ) : (+ <KeyIcon className="size-4 text-accent" />+ );++export const NetworkingAuthMethodLabel = ({+ method,+ label+}: {+ method: NetworkingAuthMethod;+ label?: string;+}) => (+ <span className="flex min-w-0 items-center gap-2">+ <NetworkingAuthMethodIcon method={method} />+ <span className="truncate">+ {label ?? NETWORKING_AUTH_METHOD_OPTIONS.find(({ value }) => value === method)?.label}+ </span>+ </span>+);++export const NetworkingAuthMethodOption = (props: OptionProps<NetworkingAuthMethodOption>) => {+ const { data, isSelected } = props;++ return (+ <ReactSelectComponents.Option {...props}>+ <span className="flex items-center justify-between gap-2">+ <NetworkingAuthMethodLabel method={data.value} label={data.label} />+ {isSelected && <CheckIcon className="size-4 shrink-0" />}+ </span>+ </ReactSelectComponents.Option>+ );+};++export const NetworkingAuthMethodSingleValue = (+ props: SingleValueProps<NetworkingAuthMethodOption>+) => {+ const { data } = props;++ return (+ <ReactSelectComponents.SingleValue {...props}>+ <NetworkingAuthMethodLabel method={data.value} label={data.label} />+ </ReactSelectComponents.SingleValue>+ );+};diff --git a/frontend/src/pages/organization/NetworkingPage/components/NetworkingTabGroup/NetworkingTabGroup.tsx b/frontend/src/pages/organization/NetworkingPage/components/NetworkingTabGroup/NetworkingTabGroup.tsxindex ae4f03ebe0..c592f29008 100644--- a/frontend/src/pages/organization/NetworkingPage/components/NetworkingTabGroup/NetworkingTabGroup.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/NetworkingTabGroup/NetworkingTabGroup.tsx@@ -1,6 +1,6 @@import { useNavigate, useSearch } from "@tanstack/react-router";-import { Tab, TabList, TabPanel, Tabs } from "@app/components/v2";+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { useOrganization } from "@app/context";@@ -31,17 +31,17 @@ export const NetworkingTabGroup = () => {return (<Tabs value={selectedTab} onValueChange={updateSelectedTab}>- <TabList>+ <TabsList variant={isSubOrganization ? "sub-org" : "org"}>{tabs.map(({ key, label }) => (- <Tab variant={isSubOrganization ? "namespace" : "org"} value={key} key={`tab-${key}`}>+ <TabsTrigger value={key} key={`tab-${key}`}>{label}- </Tab>+ </TabsTrigger>))}- </TabList>+ </TabsList>{tabs.map(({ key, component: Component }) => (- <TabPanel value={key} key={`tab-panel-${key}`}>+ <TabsContent value={key} key={`tab-panel-${key}`}><Component />- </TabPanel>+ </TabsContent>))}</Tabs>);diff --git a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsxindex 7894a22090..122f54da33 100644--- a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx@@ -1,38 +1,31 @@import { useEffect, useState } from "react";-import {- faCopy,- faDoorClosed,- faEllipsisV,- faInfoCircle,- faSearch,- faTrash-} from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useNavigate, useSearch } from "@tanstack/react-router";import { formatRelative } from "date-fns";-import { PlusIcon, SearchIcon } from "lucide-react";+import {+ CopyIcon,+ DoorClosedIcon,+ InfoIcon,+ MoreHorizontalIcon,+ PlusIcon,+ SearchIcon,+ TrashIcon+} from "lucide-react";import { createNotification } from "@app/components/notifications";import { OrgPermissionCan } from "@app/components/permissions";import {- DeleteActionModal,- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- EmptyState,- IconButton,- Table,- TableContainer,- TableSkeleton,- TBody,- Td,- Th,- THead,- Tooltip,- Tr-} from "@app/components/v2";-import {+ Alert,+ AlertDescription,+ AlertDialog,+ AlertDialogAction,+ AlertDialogCancel,+ AlertDialogConfirmationField,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogTitle,+ Badge,Button,Card,CardAction,@@ -41,9 +34,32 @@ import {CardHeader,CardTitle,DocumentationLinkBadge,+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuTrigger,+ Empty,+ EmptyHeader,+ EmptyMedia,+ EmptyTitle,+ Field,+ FieldLabel,+ IconButton,+ Input,InputGroup,InputGroupAddon,- InputGroupInput+ InputGroupInput,+ Skeleton,+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableHeadLabel,+ TableRow,+ Tooltip,+ TooltipContent,+ TooltipTrigger} from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { useOrganization } from "@app/context";@@ -62,8 +78,11 @@ const RelayHealthStatus = ({ heartbeat }: { heartbeat?: string }) => {if (!heartbeatDate) {return (- <Tooltip content="No heartbeat data available">- <span className="cursor-default text-yellow-400">Unregistered</span>+ <Tooltip>+ <TooltipTrigger asChild>+ <Badge variant="warning">Unregistered</Badge>+ </TooltipTrigger>+ <TooltipContent>No heartbeat data available</TooltipContent></Tooltip>);}@@ -72,10 +91,13 @@ const RelayHealthStatus = ({ heartbeat }: { heartbeat?: string }) => {const isHealthy = heartbeatDate >= oneHourAgo;return (- <Tooltip content={`Last heartbeat: ${heartbeatDate.toLocaleString()}`}>- <span className={`cursor-default ${isHealthy ? "text-green-400" : "text-red-400"}`}>- {isHealthy ? "Healthy" : "Unreachable"}- </span>+ <Tooltip>+ <TooltipTrigger asChild>+ <Badge variant={isHealthy ? "success" : "danger"}>+ {isHealthy ? "Healthy" : "Unreachable"}+ </Badge>+ </TooltipTrigger>+ <TooltipContent>Last heartbeat: {heartbeatDate.toLocaleString()}</TooltipContent></Tooltip>);};@@ -83,6 +105,7 @@ const RelayHealthStatus = ({ heartbeat }: { heartbeat?: string }) => {export const RelayTab = withPermission(() => {const [search, setSearch] = useState("");+ const [deleteConfirmation, setDeleteConfirmation] = useState("");const { data: relays, isPending: isRelaysLoading } = useGetRelays();const { currentOrg } = useOrganization();const orgId = currentOrg?.id || "";@@ -115,13 +138,16 @@ export const RelayTab = withPermission(const handleDeleteRelay = async () => {const data = popUp.deleteRelay.data as { id: string };- await deleteRelayById.mutateAsync(data.id);-- handlePopUpToggle("deleteRelay");- createNotification({- type: "success",- text: "Successfully deleted relay"- });+ try {+ await deleteRelayById.mutateAsync(data.id);+ handlePopUpToggle("deleteRelay", false);+ createNotification({+ type: "success",+ text: "Successfully deleted relay"+ });+ } catch {+ createNotification({ type: "error", text: "Failed to delete relay" });+ }};const filteredRelays = relays?.filter((el) =>@@ -135,9 +161,7 @@ export const RelayTab = withPermission(Relays<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/gateways/relay-deployment" /></CardTitle>- <CardDescription>- Create and configure relays to securely access private network resources from Infisical- </CardDescription>+ <CardDescription>Create and manage network relays from Infisical</CardDescription><CardAction><Button variant="org" onClick={() => handlePopUpOpen("deployRelay")}><PlusIcon />@@ -156,125 +180,189 @@ export const RelayTab = withPermission(placeholder="Search relay..."/></InputGroup>- <TableContainer>- <Table>- <THead>- <Tr>- <Th className="w-1/3">Name</Th>- <Th>Host</Th>- <Th>Created</Th>- <Th>- Health Check- <Tooltip- asChild={false}- className="normal-case"- content="The last known healthcheck. Triggers every 1 hour."+ {!isRelaysLoading && !filteredRelays?.length ? (+ <Empty className="border">+ <EmptyHeader>+ <EmptyMedia variant="icon">+ {relays?.length ? <SearchIcon /> : <DoorClosedIcon />}+ </EmptyMedia>+ <EmptyTitle>+ {relays?.length ? "No relays match your search" : "No relays configured"}+ </EmptyTitle>+ </EmptyHeader>+ </Empty>+ ) : (+ <Table className="min-w-[62rem] table-fixed">+ <TableHeader>+ <TableRow>+ <TableHead className="w-80 min-w-80">+ <TableHeadLabel>Name</TableHeadLabel>+ </TableHead>+ <TableHead className="w-72">+ <TableHeadLabel>Host</TableHeadLabel>+ </TableHead>+ <TableHead className="w-44">+ <TableHeadLabel>Created</TableHeadLabel>+ </TableHead>+ <TableHead className="w-40">+ <TableHeadLabel+ trailing={+ <Tooltip>+ <TooltipTrigger asChild>+ <InfoIcon className="size-3" />+ </TooltipTrigger>+ <TooltipContent>+ The last known health check. Triggers every hour.+ </TooltipContent>+ </Tooltip>+ }>- <FontAwesomeIcon icon={faInfoCircle} className="ml-2" />- </Tooltip>- </Th>- <Th className="w-5" />- </Tr>- </THead>- <TBody>- {isRelaysLoading && (- <TableSkeleton innerKey="relay-table" columns={5} key="relay-table" />- )}+ Health Check+ </TableHeadLabel>+ </TableHead>+ <TableHead className="w-12" />+ </TableRow>+ </TableHeader>+ <TableBody>+ {isRelaysLoading &&+ ["first", "second", "third"].map((row) => (+ <TableRow key={`relay-skeleton-${row}`}>+ {["name", "address", "connected", "health", "actions"].map((cell) => (+ <TableCell key={`relay-skeleton-${row}-${cell}`}>+ <Skeleton className="h-4 w-full" />+ </TableCell>+ ))}+ </TableRow>+ ))}{filteredRelays?.map((el) => (- <Tr+ <TableRowkey={el.id}- className={el.orgId ? "cursor-pointer hover:bg-mineshaft-700" : ""}- onClick={() => {- if (el.orgId) {- navigate({- to: "/organizations/$orgId/networking/relays/$relayId",- params: { orgId, relayId: el.id }- });- }- }}+ onClick={+ el.orgId+ ? () =>+ navigate({+ to: "/organizations/$orgId/networking/relays/$relayId",+ params: { orgId, relayId: el.id }+ })+ : undefined+ }>- <Td>- <div className="flex items-center gap-2">- <span>{el.name}</span>+ <TableCell className="min-w-80">+ <div className="flex min-w-0 items-center gap-2">+ <span className="min-w-0 flex-1 truncate">{el.name}</span>{!el.orgId && (- <Tooltip content="This is a managed relay provided by Infisical">- <span className="rounded-sm bg-mineshaft-700 px-1.5 py-0.5 text-xs text-mineshaft-400">- Managed- </span>+ <Tooltip>+ <TooltipTrigger asChild>+ <Badge variant="neutral" className="shrink-0">+ Managed+ </Badge>+ </TooltipTrigger>+ <TooltipContent>This relay is managed by Infisical.</TooltipContent></Tooltip>)}</div>- </Td>- <Td>{el.host}</Td>- <Td>{formatRelative(new Date(el.createdAt), new Date())}</Td>- <Td>+ </TableCell>+ <TableCell>{el.host}</TableCell>+ <TableCell>{formatRelative(new Date(el.createdAt), new Date())}</TableCell>+ <TableCell><RelayHealthStatus heartbeat={el.heartbeat} />- </Td>- <Td className="w-5">- <Tooltip className="max-w-sm text-center" content="Options">- <DropdownMenu>- <DropdownMenuTrigger asChild>- <IconButton- ariaLabel="Options"- colorSchema="secondary"- className="w-6"- variant="plain"- >- <FontAwesomeIcon icon={faEllipsisV} />- </IconButton>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <DropdownMenuItem- icon={<FontAwesomeIcon icon={faCopy} />}- onClick={() => navigator.clipboard.writeText(el.id)}- >- Copy ID- </DropdownMenuItem>- <OrgPermissionCan- I={OrgRelayPermissionActions.DeleteRelays}- a={OrgPermissionSubjects.Relay}- >- {(isAllowed: boolean) => (- <DropdownMenuItem- isDisabled={!isAllowed || !el.orgId}- icon={<FontAwesomeIcon icon={faTrash} />}- className="text-red"- onClick={() => handlePopUpOpen("deleteRelay", el)}- >- Delete Relay- </DropdownMenuItem>- )}- </OrgPermissionCan>- </DropdownMenuContent>- </DropdownMenu>- </Tooltip>- </Td>- </Tr>+ </TableCell>+ <TableCell className="w-12" onClick={(event) => event.stopPropagation()}>+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <IconButton aria-label="Relay options" variant="ghost" size="sm">+ <MoreHorizontalIcon />+ </IconButton>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuItem onClick={() => navigator.clipboard.writeText(el.id)}>+ <CopyIcon />+ Copy ID+ </DropdownMenuItem>+ <OrgPermissionCan+ I={OrgRelayPermissionActions.DeleteRelays}+ a={OrgPermissionSubjects.Relay}+ >+ {(isAllowed: boolean) => (+ <DropdownMenuItem+ isDisabled={!isAllowed || !el.orgId}+ variant="danger"+ onClick={() => handlePopUpOpen("deleteRelay", el)}+ >+ <TrashIcon />+ Delete Relay+ </DropdownMenuItem>+ )}+ </OrgPermissionCan>+ </DropdownMenuContent>+ </DropdownMenu>+ </TableCell>+ </TableRow>))}- </TBody>+ </TableBody></Table>- {!isRelaysLoading && !filteredRelays?.length && (- <EmptyState- title={- relays?.length ? "No Relays match search..." : "No Relays have been configured"- }- icon={relays?.length ? faSearch : faDoorClosed}- />- )}- <DeleteActionModal- isOpen={popUp.deleteRelay.isOpen}- title={`Are you sure you want to delete relay ${- (popUp?.deleteRelay?.data as { name: string })?.name || ""- }?`}- onChange={(isOpen) => handlePopUpToggle("deleteRelay", isOpen)}- deleteKey="confirm"- onDeleteApproved={() => handleDeleteRelay()}- />- <RelayDeployModal- isOpen={popUp.deployRelay.isOpen}- onOpenChange={(isOpen) => handlePopUpToggle("deployRelay", isOpen)}- />- </TableContainer>+ )}+ <AlertDialog+ open={popUp.deleteRelay.isOpen}+ onOpenChange={(open) => {+ if (!open) setDeleteConfirmation("");+ handlePopUpToggle("deleteRelay", open);+ }}+ >+ <AlertDialogContent>+ <AlertDialogHeader>+ <AlertDialogTitle>Delete Relay?</AlertDialogTitle>+ <AlertDialogDescription>+ This permanently removes the relay from your organization.+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogConfirmationField>+ <Field>+ <FieldLabel htmlFor="delete-relay-confirmation" size="sm">+ <span>+ Type "+ <span className="text-foreground">+ {(popUp.deleteRelay.data as { name?: string })?.name || "relay"}+ </span>+ " to confirm.+ </span>+ </FieldLabel>+ <Input+ id="delete-relay-confirmation"+ value={deleteConfirmation}+ onChange={(event) => setDeleteConfirmation(event.target.value)}+ placeholder={(popUp.deleteRelay.data as { name?: string })?.name || "relay"}+ autoComplete="off"+ autoFocus+ />+ </Field>+ </AlertDialogConfirmationField>+ <Alert variant="danger" appearance="borderless">+ <AlertDescription>Deleting this relay cannot be undone.</AlertDescription>+ </Alert>+ <AlertDialogFooter>+ <AlertDialogCancel isDisabled={deleteRelayById.isPending}>Cancel</AlertDialogCancel>+ <AlertDialogAction+ variant="danger"+ isPending={deleteRelayById.isPending}+ isDisabled={+ deleteConfirmation !==+ ((popUp.deleteRelay.data as { name?: string })?.name || "relay")+ }+ onClick={(event) => {+ event.preventDefault();+ handleDeleteRelay();+ }}+ >+ Delete Relay+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog>+ <RelayDeployModal+ isOpen={popUp.deployRelay.isOpen}+ onOpenChange={(isOpen) => handlePopUpToggle("deployRelay", isOpen)}+ /></CardContent></Card>);diff --git a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/components/RelayDeployModal.tsx b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/components/RelayDeployModal.tsxindex 9fa8e76dd5..6da2edfa0c 100644--- a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/components/RelayDeployModal.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/components/RelayDeployModal.tsx@@ -1,8 +1,20 @@import { useState } from "react";import { useNavigate } from "@tanstack/react-router";-import { createNotification } from "@app/components/notifications";-import { Button, FormControl, Input, Modal, ModalClose, ModalContent } from "@app/components/v2";+import {+ Button,+ Dialog,+ DialogClose,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+ Field,+ FieldError,+ FieldLabel,+ Input+} from "@app/components/v3";import { useOrganization } from "@app/context";import { useCreateRelay } from "@app/hooks/api/relays";@@ -20,6 +32,7 @@ export const RelayDeployModal = ({ isOpen, onOpenChange }: Props) => {const orgId = currentOrg?.id || "";const navigate = useNavigate();const { mutateAsync: createRelay, isPending: isCreating } = useCreateRelay();+ const areRequiredFieldsProvided = Boolean(name.trim() && host.trim());const handleCreate = async () => {const errors: string[] = [];@@ -43,11 +56,8 @@ export const RelayDeployModal = ({ isOpen, onOpenChange }: Props) => {to: "/organizations/$orgId/networking/relays/$relayId",params: { orgId, relayId: relay.id }});- } catch (err: any) {- createNotification({- type: "error",- text: err?.message || "Failed to create relay"- });+ } catch {+ // The shared mutation error handler displays the API error.}};@@ -61,45 +71,59 @@ export const RelayDeployModal = ({ isOpen, onOpenChange }: Props) => {};return (- <Modal isOpen={isOpen} onOpenChange={handleClose}>- <ModalContent- className="max-w-lg"- title="Create Relay"- subTitle="Create a new relay. You can generate an enrollment token and deploy it from the relay detail page."- bodyClassName="overflow-visible"- >+ <Dialog open={isOpen} onOpenChange={handleClose}>+ <DialogContent className="max-w-lg">+ <DialogHeader>+ <DialogTitle>Create Relay</DialogTitle>+ <DialogDescription>+ Generate an enrollment token for a relay on its detail page.+ </DialogDescription>+ </DialogHeader><div className="flex flex-col gap-4">- {formErrors.length > 0 && (- <div className="rounded-md bg-red-500/10 p-3">- {formErrors.map((e) => (- <p key={e} className="text-sm text-red-400">- {e}- </p>- ))}- </div>- )}- <FormControl label="Name" isRequired>- <Input value={name} onChange={(e) => setName(e.target.value)} placeholder="my-relay" />- </FormControl>- <FormControl label="Host" isRequired>+ <Field data-invalid={formErrors.includes("Name is required")}>+ <FieldLabel htmlFor="relay-name">Name</FieldLabel>+ <Input+ id="relay-name"+ value={name}+ onChange={(e) => setName(e.target.value)}+ placeholder="my-relay"+ isError={formErrors.includes("Name is required")}+ autoFocus+ />+ <FieldError>+ {formErrors.includes("Name is required") ? "Name is required" : undefined}+ </FieldError>+ </Field>+ <Field data-invalid={formErrors.includes("Host is required")}>+ <FieldLabel htmlFor="relay-host">Host</FieldLabel><Input+ id="relay-host"value={host}onChange={(e) => setHost(e.target.value)}placeholder="10.0.0.5 or relay.example.com"+ isError={formErrors.includes("Host is required")}/>- </FormControl>- <div className="mt-2 flex items-center gap-2">- <Button onClick={handleCreate} isLoading={isCreating} isDisabled={isCreating} size="sm">- Create Relay- </Button>- <ModalClose asChild>- <Button size="sm" colorSchema="secondary">+ <FieldError>+ {formErrors.includes("Host is required") ? "Host is required" : undefined}+ </FieldError>+ </Field>+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="ghost" type="button">Cancel</Button>- </ModalClose>- </div>+ </DialogClose>+ <Button+ variant="org"+ onClick={handleCreate}+ isPending={isCreating}+ isDisabled={isCreating || !areRequiredFieldsProvided}+ >+ Create Relay+ </Button>+ </DialogFooter></div>- </ModalContent>- </Modal>+ </DialogContent>+ </Dialog>);};diff --git a/frontend/src/pages/organization/RoleByIDPage/components/OrgRoleModifySection.utils.ts b/frontend/src/pages/organization/RoleByIDPage/components/OrgRoleModifySection.utils.tsindex e15e62f552..3fc9e15413 100644--- a/frontend/src/pages/organization/RoleByIDPage/components/OrgRoleModifySection.utils.ts+++ b/frontend/src/pages/organization/RoleByIDPage/components/OrgRoleModifySection.utils.ts@@ -725,7 +725,7 @@ export const ORG_PERMISSION_OBJECT: Record<string, TOrgPermissionConfig> = {},[OrgPermissionSubjects.Gateway]: {title: "Gateways",- description: "Manage gateways used for private network access",+ description: "Manage gateways that securely connect Infisical to your infrastructure",actions: [{value: OrgGatewayPermissionActions.ListGateways,@@ -735,7 +735,8 @@ export const ORG_PERMISSION_OBJECT: Record<string, TOrgPermissionConfig> = {{value: OrgGatewayPermissionActions.CreateGateways,label: "Create Gateways",- description: "Register new gateways for private network access"+ description:+ "Register new gateways that securely proxy Infisical traffic into your infrastructure"},{value: OrgGatewayPermissionActions.EditGateways,