mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-10 20:02:26 +00:00
improvements to create private resource modal
This commit is contained in:
@@ -2391,5 +2391,6 @@
|
|||||||
"maintenanceModeDisabledTooltip": "This feature requires a valid license to enable.",
|
"maintenanceModeDisabledTooltip": "This feature requires a valid license to enable.",
|
||||||
"maintenanceScreenTitle": "Service Temporarily Unavailable",
|
"maintenanceScreenTitle": "Service Temporarily Unavailable",
|
||||||
"maintenanceScreenMessage": "We are currently experiencing technical difficulties. Please check back soon.",
|
"maintenanceScreenMessage": "We are currently experiencing technical difficulties. Please check back soon.",
|
||||||
"maintenanceScreenEstimatedCompletion": "Estimated Completion:"
|
"maintenanceScreenEstimatedCompletion": "Estimated Completion:",
|
||||||
|
"createInternalResourceDialogDestinationRequired": "Destination is required"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,7 +170,9 @@ export default function CreateInternalResourceDialog({
|
|||||||
mode: z.enum(["host", "cidr"]),
|
mode: z.enum(["host", "cidr"]),
|
||||||
// protocol: z.enum(["tcp", "udp"]).nullish(),
|
// protocol: z.enum(["tcp", "udp"]).nullish(),
|
||||||
// proxyPort: z.int().positive().min(1, t("createInternalResourceDialogProxyPortMin")).max(65535, t("createInternalResourceDialogProxyPortMax")).nullish(),
|
// proxyPort: z.int().positive().min(1, t("createInternalResourceDialogProxyPortMin")).max(65535, t("createInternalResourceDialogProxyPortMax")).nullish(),
|
||||||
destination: z.string().min(1),
|
destination: z.string().min(1, {
|
||||||
|
message: t("createInternalResourceDialogDestinationRequired")
|
||||||
|
}),
|
||||||
// destinationPort: z.int().positive().min(1, t("createInternalResourceDialogDestinationPortMin")).max(65535, t("createInternalResourceDialogDestinationPortMax")).nullish(),
|
// destinationPort: z.int().positive().min(1, t("createInternalResourceDialogDestinationPortMin")).max(65535, t("createInternalResourceDialogDestinationPortMax")).nullish(),
|
||||||
alias: z.string().nullish(),
|
alias: z.string().nullish(),
|
||||||
tcpPortRangeString: createPortRangeStringSchema(t),
|
tcpPortRangeString: createPortRangeStringSchema(t),
|
||||||
@@ -341,10 +343,10 @@ export default function CreateInternalResourceDialog({
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (open && availableSites.length > 0) {
|
if (open) {
|
||||||
form.reset({
|
form.reset({
|
||||||
name: "",
|
name: "",
|
||||||
siteId: availableSites[0].siteId,
|
siteId: availableSites[0]?.siteId || 0,
|
||||||
mode: "host",
|
mode: "host",
|
||||||
// protocol: "tcp",
|
// protocol: "tcp",
|
||||||
// proxyPort: undefined,
|
// proxyPort: undefined,
|
||||||
@@ -467,30 +469,6 @@ export default function CreateInternalResourceDialog({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (availableSites.length === 0) {
|
|
||||||
return (
|
|
||||||
<Credenza open={open} onOpenChange={setOpen}>
|
|
||||||
<CredenzaContent className="max-w-md">
|
|
||||||
<CredenzaHeader>
|
|
||||||
<CredenzaTitle>
|
|
||||||
{t("createInternalResourceDialogNoSitesAvailable")}
|
|
||||||
</CredenzaTitle>
|
|
||||||
<CredenzaDescription>
|
|
||||||
{t(
|
|
||||||
"createInternalResourceDialogNoSitesAvailableDescription"
|
|
||||||
)}
|
|
||||||
</CredenzaDescription>
|
|
||||||
</CredenzaHeader>
|
|
||||||
<CredenzaFooter>
|
|
||||||
<Button onClick={() => setOpen(false)}>
|
|
||||||
{t("createInternalResourceDialogClose")}
|
|
||||||
</Button>
|
|
||||||
</CredenzaFooter>
|
|
||||||
</CredenzaContent>
|
|
||||||
</Credenza>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Credenza open={open} onOpenChange={setOpen}>
|
<Credenza open={open} onOpenChange={setOpen}>
|
||||||
<CredenzaContent className="max-w-3xl">
|
<CredenzaContent className="max-w-3xl">
|
||||||
|
|||||||
Reference in New Issue
Block a user