mirror of
https://github.com/fosrl/pangolin.git
synced 2026-10-05 20:29:06 +02:00
Can create gateway resource
This commit is contained in:
@@ -108,15 +108,19 @@ export function PrivateResourceInfoSections({
|
||||
tcpPortRangeString: siteResource.tcpPortRangeString ?? "*",
|
||||
udpPortRangeString: siteResource.udpPortRangeString ?? "*"
|
||||
});
|
||||
const showAccess = siteResource.mode !== "gateway";
|
||||
const showAlias =
|
||||
siteResource.mode !== "cidr" &&
|
||||
siteResource.mode !== "http" &&
|
||||
siteResource.mode !== "inference";
|
||||
siteResource.mode !== "inference" &&
|
||||
siteResource.mode !== "gateway";
|
||||
const showDestination =
|
||||
!(
|
||||
siteResource.mode === "ssh" &&
|
||||
siteResource.authDaemonMode === "native"
|
||||
) && siteResource.mode !== "inference";
|
||||
) &&
|
||||
siteResource.mode !== "inference" &&
|
||||
siteResource.mode !== "gateway";
|
||||
const showCertificate = !!(
|
||||
(siteResource.mode === "http" || siteResource.mode === "inference") &&
|
||||
siteResource.ssl &&
|
||||
@@ -129,7 +133,8 @@ export function PrivateResourceInfoSections({
|
||||
siteResource.mode !== "inference";
|
||||
|
||||
const numSections =
|
||||
2 +
|
||||
1 +
|
||||
(showAccess ? 1 : 0) +
|
||||
(showDestination ? 1 : 0) +
|
||||
(showAlias ? 1 : 0) +
|
||||
(showCertificate ? 1 : 0) +
|
||||
@@ -144,17 +149,19 @@ export function PrivateResourceInfoSections({
|
||||
</InfoSectionContent>
|
||||
</InfoSection>
|
||||
|
||||
<InfoSection>
|
||||
<InfoSectionTitle>{t("access")}</InfoSectionTitle>
|
||||
<InfoSectionContent>
|
||||
<AccessMethodContent
|
||||
accessDisplay={access.accessDisplay}
|
||||
accessCopyValue={access.accessCopyValue}
|
||||
accessUrl={access.accessUrl}
|
||||
className={accessClassName}
|
||||
/>
|
||||
</InfoSectionContent>
|
||||
</InfoSection>
|
||||
{showAccess ? (
|
||||
<InfoSection>
|
||||
<InfoSectionTitle>{t("access")}</InfoSectionTitle>
|
||||
<InfoSectionContent>
|
||||
<AccessMethodContent
|
||||
accessDisplay={access.accessDisplay}
|
||||
accessCopyValue={access.accessCopyValue}
|
||||
accessUrl={access.accessUrl}
|
||||
className={accessClassName}
|
||||
/>
|
||||
</InfoSectionContent>
|
||||
</InfoSection>
|
||||
) : null}
|
||||
|
||||
{showDestination ? (
|
||||
<InfoSection>
|
||||
|
||||
@@ -421,7 +421,14 @@ export function createCreateFormSchema(t: TranslateFn) {
|
||||
.min(1, t("createInternalResourceDialogNameRequired"))
|
||||
.max(255, t("createInternalResourceDialogNameMaxLength")),
|
||||
siteIds: z.array(z.number().int().positive()).optional(),
|
||||
mode: z.enum(["host", "cidr", "http", "ssh", "inference"]),
|
||||
mode: z.enum([
|
||||
"host",
|
||||
"cidr",
|
||||
"http",
|
||||
"ssh",
|
||||
"inference",
|
||||
"gateway"
|
||||
]),
|
||||
destination: z.string().nullish(),
|
||||
alias: z.string().nullish(),
|
||||
destinationPort: z
|
||||
@@ -468,6 +475,7 @@ export function createCreateFormSchema(t: TranslateFn) {
|
||||
if (
|
||||
data.mode !== "ssh" &&
|
||||
data.mode !== "inference" &&
|
||||
data.mode !== "gateway" &&
|
||||
(!trimmedDestination || trimmedDestination.length < 1)
|
||||
) {
|
||||
ctx.addIssue({
|
||||
|
||||
Reference in New Issue
Block a user