fix create private resource ports default to blocked

This commit is contained in:
miloschwartz
2026-07-09 10:27:45 -04:00
parent b6ed762724
commit 7a0a877dc0
3 changed files with 13 additions and 6 deletions
+2 -1
View File
@@ -2393,6 +2393,7 @@
"createInternalResourceDialogClose": "Close", "createInternalResourceDialogClose": "Close",
"createInternalResourceDialogCreateClientResource": "Create Private Resource", "createInternalResourceDialogCreateClientResource": "Create Private Resource",
"createInternalResourceDialogCreateClientResourceDescription": "Create a new resource that will only be accessible to clients connected to the organization", "createInternalResourceDialogCreateClientResourceDescription": "Create a new resource that will only be accessible to clients connected to the organization",
"privateResourceGeneralDescription": "Configure the name, identifier, and other general resource settings.",
"privateResourceCreatePageSeeAll": "See All Private Resources", "privateResourceCreatePageSeeAll": "See All Private Resources",
"privateResourceAllowIcmpPing": "Allow ICMP Ping", "privateResourceAllowIcmpPing": "Allow ICMP Ping",
"privateResourceNetworkAccess": "Network Access", "privateResourceNetworkAccess": "Network Access",
@@ -3269,7 +3270,7 @@
"editInternalResourceDialogAddUsers": "Add Users", "editInternalResourceDialogAddUsers": "Add Users",
"editInternalResourceDialogAddClients": "Add Clients", "editInternalResourceDialogAddClients": "Add Clients",
"editInternalResourceDialogDestinationLabel": "Destination", "editInternalResourceDialogDestinationLabel": "Destination",
"editInternalResourceDialogDestinationDescription": "Choose where this resource runs and how clients reach it", "editInternalResourceDialogDestinationDescription": "Configure how clients reach this resource.",
"internalResourceFormMultiSiteRoutingHelp": "Selecting multiple sites enables resilient routing and failover for high availability.", "internalResourceFormMultiSiteRoutingHelp": "Selecting multiple sites enables resilient routing and failover for high availability.",
"internalResourceFormMultiSiteRoutingHelpLearnMore": "Learn more", "internalResourceFormMultiSiteRoutingHelpLearnMore": "Learn more",
"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.",
@@ -106,17 +106,23 @@ export function PrivateResourceNetworkAccessFields({
embedInParentGrid = false embedInParentGrid = false
}: PrivateResourceNetworkAccessFieldsProps) { }: PrivateResourceNetworkAccessFieldsProps) {
const t = useTranslations(); const t = useTranslations();
const resolvedInitialTcp = initialTcp !== undefined ? initialTcp : "*";
const resolvedInitialUdp = initialUdp !== undefined ? initialUdp : "*";
const [tcpPortMode, setTcpPortMode] = useState<PortMode>(() => const [tcpPortMode, setTcpPortMode] = useState<PortMode>(() =>
getPortModeFromString(initialTcp) getPortModeFromString(resolvedInitialTcp)
); );
const [udpPortMode, setUdpPortMode] = useState<PortMode>(() => const [udpPortMode, setUdpPortMode] = useState<PortMode>(() =>
getPortModeFromString(initialUdp) getPortModeFromString(resolvedInitialUdp)
); );
const [tcpCustomPorts, setTcpCustomPorts] = useState(() => const [tcpCustomPorts, setTcpCustomPorts] = useState(() =>
initialTcp && initialTcp !== "*" ? initialTcp : "" resolvedInitialTcp && resolvedInitialTcp !== "*"
? resolvedInitialTcp
: ""
); );
const [udpCustomPorts, setUdpCustomPorts] = useState(() => const [udpCustomPorts, setUdpCustomPorts] = useState(() =>
initialUdp && initialUdp !== "*" ? initialUdp : "" resolvedInitialUdp && resolvedInitialUdp !== "*"
? resolvedInitialUdp
: ""
); );
useEffect(() => { useEffect(() => {
@@ -64,7 +64,7 @@ export default function PrivateResourceGeneralPage() {
{t("resourceGeneral")} {t("resourceGeneral")}
</SettingsSectionTitle> </SettingsSectionTitle>
<SettingsSectionDescription> <SettingsSectionDescription>
{t("resourceGeneralDescription")} {t("privateResourceGeneralDescription")}
</SettingsSectionDescription> </SettingsSectionDescription>
</SettingsSectionHeader> </SettingsSectionHeader>