disable ssh access tab on http mode

This commit is contained in:
miloschwartz
2026-04-09 22:38:04 -04:00
parent 79751c208d
commit 73482c2a05
2 changed files with 108 additions and 80 deletions

View File

@@ -2673,7 +2673,7 @@
"editInternalResourceDialogAddUsers": "Add Users", "editInternalResourceDialogAddUsers": "Add Users",
"editInternalResourceDialogAddClients": "Add Clients", "editInternalResourceDialogAddClients": "Add Clients",
"editInternalResourceDialogDestinationLabel": "Destination", "editInternalResourceDialogDestinationLabel": "Destination",
"editInternalResourceDialogDestinationDescription": "Specify the destination address for the internal resource. This can be a hostname, IP address, or CIDR range depending on the selected mode. Optionally set an internal DNS alias for easier identification.", "editInternalResourceDialogDestinationDescription": "Choose where this resource runs and how clients reach it, then complete the settings that apply to your setup.",
"editInternalResourceDialogPortRestrictionsDescription": "Restrict access to specific TCP/UDP ports or allow/block all ports.", "editInternalResourceDialogPortRestrictionsDescription": "Restrict access to specific TCP/UDP ports or allow/block all ports.",
"createInternalResourceDialogHttpConfiguration": "HTTP configuration", "createInternalResourceDialogHttpConfiguration": "HTTP configuration",
"createInternalResourceDialogHttpConfigurationDescription": "Choose the domain clients will use to reach this resource over HTTP or HTTPS.", "createInternalResourceDialogHttpConfigurationDescription": "Choose the domain clients will use to reach this resource over HTTP or HTTPS.",

View File

@@ -1,6 +1,10 @@
"use client"; "use client";
import { HorizontalTabs } from "@app/components/HorizontalTabs"; import { HorizontalTabs } from "@app/components/HorizontalTabs";
import {
OptionSelect,
type OptionSelectOption
} from "@app/components/OptionSelect";
import { PaidFeaturesAlert } from "@app/components/PaidFeaturesAlert"; import { PaidFeaturesAlert } from "@app/components/PaidFeaturesAlert";
import { StrategySelect } from "@app/components/StrategySelect"; import { StrategySelect } from "@app/components/StrategySelect";
import { Tag, TagInput } from "@app/components/tags/tag-input"; import { Tag, TagInput } from "@app/components/tags/tag-input";
@@ -687,6 +691,42 @@ export function InternalResourceForm({
)} )}
/> />
)} )}
</div>
<HorizontalTabs
clientSide
items={[
{
title: t(
"editInternalResourceDialogNetworkSettings"
),
href: "#"
},
{
title: t("editInternalResourceDialogAccessPolicy"),
href: "#"
},
...(disableEnterpriseFeatures || mode !== "host"
? []
: [{ title: t("sshAccess"), href: "#" }])
]}
>
<div className="space-y-4 mt-4 p-1">
<div>
<div className="mb-8">
<label className="font-medium block">
{t(
"editInternalResourceDialogDestinationLabel"
)}
</label>
<div className="text-sm text-muted-foreground">
{t(
"editInternalResourceDialogDestinationDescription"
)}
</div>
</div>
<div className="grid grid-cols-3 gap-4 items-start mb-4">
<div className="min-w-0 col-span-1">
<FormField <FormField
control={form.control} control={form.control}
name="siteId" name="siteId"
@@ -711,7 +751,9 @@ export function InternalResourceForm({
s.siteId === s.siteId ===
field.value field.value
)?.name )?.name
: t("selectSite")} : t(
"selectSite"
)}
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" /> <ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
</Button> </Button>
</FormControl> </FormControl>
@@ -719,11 +761,21 @@ export function InternalResourceForm({
<PopoverContent className="w-full p-0"> <PopoverContent className="w-full p-0">
<SitesSelector <SitesSelector
orgId={orgId} orgId={orgId}
selectedSite={selectedSite} selectedSite={
filterTypes={["newt"]} selectedSite
onSelectSite={(site) => { }
setSelectedSite(site); filterTypes={[
field.onChange(site.siteId); "newt"
]}
onSelectSite={(
site
) => {
setSelectedSite(
site
);
field.onChange(
site.siteId
);
}} }}
/> />
</PopoverContent> </PopoverContent>
@@ -732,70 +784,46 @@ export function InternalResourceForm({
</FormItem> </FormItem>
)} )}
/> />
</div>
<div className="min-w-0 col-span-2">
<FormField <FormField
control={form.control} control={form.control}
name="mode" name="mode"
render={({ field }) => ( render={({ field }) => {
const modeOptions: OptionSelectOption<InternalResourceMode>[] =
[
{
value: "host",
label: t(modeHostKey)
},
{
value: "cidr",
label: t(modeCidrKey)
},
{
value: "http",
label: t(modeHttpKey)
}
];
return (
<FormItem> <FormItem>
<FormLabel>{t(modeLabelKey)}</FormLabel> <FormLabel>
<Select {t(modeLabelKey)}
onValueChange={field.onChange} </FormLabel>
<OptionSelect<InternalResourceMode>
options={modeOptions}
value={field.value} value={field.value}
> onChange={
<FormControl> field.onChange
<SelectTrigger> }
<SelectValue /> cols={3}
</SelectTrigger> />
</FormControl>
<SelectContent>
<SelectItem value="host">
{t(modeHostKey)}
</SelectItem>
<SelectItem value="cidr">
{t(modeCidrKey)}
</SelectItem>
<SelectItem value="http">
{t(modeHttpKey)}
</SelectItem>
</SelectContent>
</Select>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>
)} );
}}
/> />
</div> </div>
<HorizontalTabs
clientSide
items={[
{
title: t(
"editInternalResourceDialogNetworkSettings"
),
href: "#"
},
{
title: t("editInternalResourceDialogAccessPolicy"),
href: "#"
},
...(disableEnterpriseFeatures || mode === "cidr"
? []
: [{ title: t("sshAccess"), href: "#" }])
]}
>
<div className="space-y-4 mt-4 p-1">
<div>
<div className="mb-8">
<label className="font-medium block">
{t(
"editInternalResourceDialogDestinationLabel"
)}
</label>
<div className="text-sm text-muted-foreground">
{t(
"editInternalResourceDialogDestinationDescription"
)}
</div>
</div> </div>
<div <div
className={cn( className={cn(
@@ -1516,8 +1544,8 @@ export function InternalResourceForm({
)} )}
</div> </div>
{/* SSH Access tab */} {/* SSH Access tab (host mode only) */}
{!disableEnterpriseFeatures && mode !== "cidr" && ( {!disableEnterpriseFeatures && mode === "host" && (
<div className="space-y-4 mt-4 p-1"> <div className="space-y-4 mt-4 p-1">
<PaidFeaturesAlert tiers={tierMatrix.sshPam} /> <PaidFeaturesAlert tiers={tierMatrix.sshPam} />
<div className="mb-8"> <div className="mb-8">