Complete removal of http and protocol from public

This commit is contained in:
Owen
2026-05-27 17:19:04 -07:00
parent 6d491b7bb9
commit 0ff0e83c9f
24 changed files with 169 additions and 131 deletions

View File

@@ -146,7 +146,7 @@ function MaintenanceSectionForm({
}
}
if (!resource.http) {
if (!["http", "ssh", "rdp", "vnc"].includes(resource.mode)) {
return null;
}
@@ -176,7 +176,9 @@ function MaintenanceSectionForm({
render={({ field }) => {
const isDisabled =
!isPaidUser(tierMatrix.maintencePage) ||
resource.http === false;
!["http", "ssh", "rdp", "vnc"].includes(
resource.mode
);
return (
<FormItem>
@@ -462,14 +464,14 @@ export default function GeneralForm() {
.refine(
(data) => {
// For non-HTTP resources, proxyPort should be defined
if (!resource.http) {
if (!["http", "ssh", "rdp", "vnc"].includes(resource.mode)) {
return data.proxyPort !== undefined;
}
// For HTTP resources, proxyPort should be undefined
return data.proxyPort === undefined;
},
{
message: !resource.http
message: !["http", "ssh", "rdp", "vnc"].includes(resource.mode)
? "Port number is required for non-HTTP resources"
: "Port number should not be set for HTTP resources",
path: ["proxyPort"]
@@ -623,7 +625,9 @@ export default function GeneralForm() {
/>
</div>
{!resource.http && (
{!["http", "ssh", "rdp", "vnc"].includes(
resource.mode
) && (
<>
<FormField
control={form.control}
@@ -672,7 +676,9 @@ export default function GeneralForm() {
</>
)}
{resource.http && (
{["http", "ssh", "rdp", "vnc"].includes(
resource.mode
) && (
<div className="space-y-4">
<div id="resource-domain-picker">
<DomainPicker

View File

@@ -130,20 +130,20 @@ export default function ReverseProxyTargetsPage(props: {
<SettingsContainer>
<ProxyResourceTargetsForm
orgId={params.orgId}
isHttp={resource.http}
isHttp={["http", "ssh", "rdp", "vnc"].includes(resource.mode)}
initialTargets={remoteTargets}
resource={resource}
updateResource={updateResource}
/>
{resource.http && (
{["http", "ssh", "rdp", "vnc"].includes(resource.mode) && (
<ProxyResourceHttpForm
resource={resource}
updateResource={updateResource}
/>
)}
{!resource.http && resource.protocol == "tcp" && (
{resource.mode == "tcp" && (
<ProxyResourceProtocolForm
resource={resource}
updateResource={updateResource}

View File

@@ -91,7 +91,7 @@ export default async function ResourceLayout(props: ResourceLayoutProps) {
}
];
if (resource.http) {
if (["http", "ssh", "rdp", "vnc"].includes(resource.mode)) {
navItems.push({
title: t("authentication"),
href: `/{orgId}/settings/resources/proxy/{niceId}/authentication`

View File

@@ -149,7 +149,7 @@ export default function ResourceRules(props: {
resolver: zodResolver(addRuleSchema),
defaultValues: {
action: "ACCEPT",
match: resource.http && resource.mode == "http" ? "PATH" : "IP",
match: resource.mode == "http" ? "PATH" : "IP",
value: ""
}
});
@@ -577,7 +577,7 @@ export default function ResourceRules(props: {
<SelectValue />
</SelectTrigger>
<SelectContent>
{resource.http && resource.mode == "http" && (
{resource.mode == "http" && (
<SelectItem value="PATH">
{RuleMatch.PATH}
</SelectItem>
@@ -1037,15 +1037,14 @@ export default function ResourceRules(props: {
<SelectValue />
</SelectTrigger>
<SelectContent>
{resource.http &&
resource.mode ==
"http" && (
<SelectItem value="PATH">
{
RuleMatch.PATH
}
</SelectItem>
)}
{resource.mode ==
"http" && (
<SelectItem value="PATH">
{
RuleMatch.PATH
}
</SelectItem>
)}
<SelectItem value="IP">
{RuleMatch.IP}
</SelectItem>

View File

@@ -108,11 +108,11 @@ export default async function ProxyResourcesPage(
orgId: params.orgId,
nice: resource.niceId,
domain: `${resource.ssl ? "https://" : "http://"}${toUnicode(resource.fullDomain || "")}`,
protocol: resource.protocol,
proxyPort: resource.proxyPort,
http: resource.http,
labels: resource.labels,
authState: !resource.http
authState: !["http", "ssh", "rdp", "vnc"].includes(
resource.mode || ""
)
? "none"
: resource.sso ||
resource.pincodeId !== null ||