diff --git a/src/components/InternalResourceForm.tsx b/src/components/InternalResourceForm.tsx index b7800b9ed..ee216f493 100644 --- a/src/components/InternalResourceForm.tsx +++ b/src/components/InternalResourceForm.tsx @@ -802,129 +802,53 @@ export function InternalResourceForm({
-
-
- ( - - - {t("sites")} - - - - - - - - - { - setSelectedSites( - sites - ); - field.onChange( - sites.map( - ( - s - ) => - s.siteId - ) - ); - }} - /> - - - - - )} - /> -
-
- { - const modeOptions: OptionSelectOption[] = - [ - { - value: "host", - label: t( - modeHostKey - ) - }, - { - value: "cidr", - label: t( - modeCidrKey - ) - }, - ...(!disableEnterpriseFeatures - ? [ - { - value: "http" as const, - label: t( - modeHttpKey - ) - }, - { - value: "ssh" as const, - label: t( - modeSshKey - ) - } - ] - : []) - ]; - return ( - - - {t(modeLabelKey)} - - - options={ - modeOptions - } - value={field.value} - onChange={ - field.onChange - } - cols={3} - /> - - - ); - }} - /> -
-
+ { + const modeOptions: OptionSelectOption[] = + [ + { + value: "host", + label: t(modeHostKey) + }, + { + value: "cidr", + label: t(modeCidrKey) + }, + ...(!disableEnterpriseFeatures + ? [ + { + value: "http" as const, + label: t( + modeHttpKey + ) + }, + { + value: "ssh" as const, + label: t( + modeSshKey + ) + } + ] + : []) + ]; + return ( + + + {t(modeLabelKey)} + + + options={modeOptions} + value={field.value} + onChange={field.onChange} + cols={4} + /> + + + ); + }} + /> {selectedSites.length > 1 && (

{t( @@ -948,11 +872,74 @@ export function InternalResourceForm({

+
+ ( + + + {t("sites")} + + + + + + + + + { + setSelectedSites( + sites + ); + field.onChange( + sites.map( + (s) => + s.siteId + ) + ); + }} + /> + + + + + )} + /> +
{mode === "http" && (
@@ -1025,7 +1014,7 @@ export function InternalResourceForm({ )} />
- {mode === "host" && ( + {(mode === "host" || mode === "ssh") && (
) : (
-
- -
- {t( - "editInternalResourceDialogPortRestrictionsDescription" - )} -
-
-
-
- - {t("editInternalResourceDialogTcp")} - -
-
- ( - -
- - {tcpPortMode === - "custom" ? ( - - +
+ +
+ {t( + "editInternalResourceDialogPortRestrictionsDescription" + )} +
+
+
+
+ + {t( + "editInternalResourceDialogTcp" + )} + +
+
+ ( + +
+ - )} -
- -
+ > + + + + + + + + {t( + "allPorts" + )} + + + {t( + "blocked" + )} + + + {t( + "custom" + )} + + + + {tcpPortMode === + "custom" ? ( + + + setTcpCustomPorts( + e + .target + .value + ) + } + /> + + ) : ( + + )} +
+ + + )} + /> +
+
+
-
-
-
-
- - {t("editInternalResourceDialogUdp")} - -
-
- ( - -
- - {udpPortMode === - "custom" ? ( - - +
+ + {t( + "editInternalResourceDialogUdp" + )} + +
+
+ ( + +
+ + + + + + + + + {t( + "allPorts" + )} + + + {t( + "blocked" + )} + + + {t( + "custom" + )} + + + + {udpPortMode === + "custom" ? ( + + + setUdpCustomPorts( + e + .target + .value + ) + } + /> + + ) : ( + + )} +
+ +
+ )} + /> +
+
+
+
+ + {t( + "editInternalResourceDialogIcmp" + )} + +
+
+ ( + +
+ + + field.onChange( + !checked + ) + } + /> + + + {field.value ? t( - "allPortsAllowed" + "blocked" ) : t( - "allPortsBlocked" - ) - } - /> - )} -
- -
- )} - /> -
-
-
-
- - {t( - "editInternalResourceDialogIcmp" - )} - -
-
- ( - -
- - - field.onChange( - !checked - ) - } - /> - - - {field.value - ? t("blocked") - : t("allowed")} - -
- -
- )} - /> -
-
+ "allowed" + )} + +
+ + + )} + /> +
+
+ + )}
)}