diff --git a/messages/en-US.json b/messages/en-US.json index ba9e4e57..608dd000 100644 --- a/messages/en-US.json +++ b/messages/en-US.json @@ -181,7 +181,7 @@ "baseDomain": "Base Domain", "subdomnainDescription": "The subdomain where the resource will be accessible.", "resourceRawSettings": "TCP/UDP Settings", - "resourceRawSettingsDescription": "Configure how the resource will be accessed over TCP/UDP. You map the resource to a port on the host Pangolin server, so you can access the resource from server-public-ip:mapped-port.", + "resourceRawSettingsDescription": "Configure how the resource will be accessed over TCP/UDP", "protocol": "Protocol", "protocolSelect": "Select a protocol", "resourcePortNumber": "Port Number", @@ -499,7 +499,7 @@ "proxyUpdatedDescription": "Proxy settings have been updated successfully", "proxyErrorUpdate": "Failed to update proxy settings", "proxyErrorUpdateDescription": "An error occurred while updating proxy settings", - "targetAddr": "IP / Hostname", + "targetAddr": "Host", "targetPort": "Port", "targetProtocol": "Protocol", "targetTlsSettings": "Secure Connection Configuration", diff --git a/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx b/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx index ba3499b5..5ca36513 100644 --- a/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx +++ b/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx @@ -123,10 +123,9 @@ const addTargetSchema = z ip: z.string().refine(isTargetValid), method: z.string().nullable(), port: z.coerce.number().int().positive(), - siteId: z.int() - .positive({ - error: "You must select a site for a target." - }), + siteId: z.int().positive({ + error: "You must select a site for a target." + }), path: z.string().optional().nullable(), pathMatchType: z .enum(["exact", "prefix", "regex"]) @@ -546,11 +545,11 @@ export default function ReverseProxyTargets(props: { prev.map((t) => t.targetId === target.targetId ? { - ...t, - targetId: response.data.data.targetId, - new: false, - updated: false - } + ...t, + targetId: response.data.data.targetId, + new: false, + updated: false + } : t ) ); @@ -607,16 +606,16 @@ export default function ReverseProxyTargets(props: { const newTarget: LocalTarget = { ...data, - path: isHttp ? (data.path || null) : null, - pathMatchType: isHttp ? (data.pathMatchType || null) : null, - rewritePath: isHttp ? (data.rewritePath || null) : null, - rewritePathType: isHttp ? (data.rewritePathType || null) : null, + path: isHttp ? data.path || null : null, + pathMatchType: isHttp ? data.pathMatchType || null : null, + rewritePath: isHttp ? data.rewritePath || null : null, + rewritePathType: isHttp ? data.rewritePathType || null : null, siteType: site?.type || null, enabled: true, targetId: new Date().getTime(), new: true, resourceId: resource.resourceId, - priority: isHttp ? (data.priority || 100) : 100, + priority: isHttp ? data.priority || 100 : 100, hcEnabled: false, hcPath: null, hcMethod: null, @@ -631,7 +630,7 @@ export default function ReverseProxyTargets(props: { hcStatus: null, hcMode: null, hcUnhealthyInterval: null, - hcTlsServerName: null, + hcTlsServerName: null }; setTargets([...targets, newTarget]); @@ -653,11 +652,11 @@ export default function ReverseProxyTargets(props: { targets.map((target) => target.targetId === targetId ? { - ...target, - ...data, - updated: true, - siteType: site ? site.type : target.siteType - } + ...target, + ...data, + updated: true, + siteType: site ? site.type : target.siteType + } : target ) ); @@ -668,10 +667,10 @@ export default function ReverseProxyTargets(props: { targets.map((target) => target.targetId === targetId ? { - ...target, - ...config, - updated: true - } + ...target, + ...config, + updated: true + } : target ) ); @@ -733,7 +732,7 @@ export default function ReverseProxyTargets(props: { hcStatus: target.hcStatus || null, hcUnhealthyInterval: target.hcUnhealthyInterval || null, hcMode: target.hcMode || null, - hcTlsServerName: target.hcTlsServerName, + hcTlsServerName: target.hcTlsServerName }; // Only include path-related fields for HTTP resources @@ -833,7 +832,7 @@ export default function ReverseProxyTargets(props: { const priorityColumn: ColumnDef = { id: "priority", header: () => ( -
+
{t("priority")} @@ -877,7 +876,7 @@ export default function ReverseProxyTargets(props: { const healthCheckColumn: ColumnDef = { accessorKey: "healthCheck", - header: () => ({t("healthCheck")}), + header: () => {t("healthCheck")}, cell: ({ row }) => { const status = row.original.hcHealth || "unknown"; const isEnabled = row.original.hcEnabled; @@ -923,18 +922,16 @@ export default function ReverseProxyTargets(props: { {row.original.siteType === "newt" ? ( ) : ( - @@ -949,7 +946,7 @@ export default function ReverseProxyTargets(props: { const matchPathColumn: ColumnDef = { accessorKey: "path", - header: () => ({t("matchPath")}), + header: () => {t("matchPath")}, cell: ({ row }) => { const hasPathMatch = !!( row.original.path || row.original.pathMatchType @@ -1011,7 +1008,7 @@ export default function ReverseProxyTargets(props: { const addressColumn: ColumnDef = { accessorKey: "address", - header: () => ({t("address")}), + header: () => {t("address")}, cell: ({ row }) => { const selectedSite = sites.find( (site) => site.siteId === row.original.siteId @@ -1064,7 +1061,7 @@ export default function ReverseProxyTargets(props: { className={cn( "w-[180px] justify-between text-sm border-r pr-4 rounded-none h-8 hover:bg-transparent", !row.original.siteId && - "text-muted-foreground" + "text-muted-foreground" )} > @@ -1132,8 +1129,12 @@ export default function ReverseProxyTargets(props: { {row.original.method || "http"} - http - https + + http + + + https + h2c @@ -1147,7 +1148,7 @@ export default function ReverseProxyTargets(props: { { const input = e.target.value.trim(); @@ -1225,7 +1226,7 @@ export default function ReverseProxyTargets(props: { const rewritePathColumn: ColumnDef = { accessorKey: "rewritePath", - header: () => ({t("rewritePath")}), + header: () => {t("rewritePath")}, cell: ({ row }) => { const hasRewritePath = !!( row.original.rewritePath || row.original.rewritePathType @@ -1295,7 +1296,7 @@ export default function ReverseProxyTargets(props: { const enabledColumn: ColumnDef = { accessorKey: "enabled", - header: () => ({t("enabled")}), + header: () => {t("enabled")}, cell: ({ row }) => (
= { id: "actions", - header: () => ({t("actions")}), + header: () => {t("actions")}, cell: ({ row }) => (
) : ( -
+

{t("targetNoOne")}

@@ -1721,7 +1738,9 @@ export default function ReverseProxyTargets(props: { defaultChecked={ field.value || false } - onCheckedChange={(val) => { + onCheckedChange={( + val + ) => { field.onChange(val); }} /> @@ -1730,19 +1749,37 @@ export default function ReverseProxyTargets(props: { )} /> - {proxySettingsForm.watch("proxyProtocol") && ( + {proxySettingsForm.watch( + "proxyProtocol" + ) && ( <> ( - {t("proxyProtocolVersion")} + + {t( + "proxyProtocolVersion" + )} + - {t("versionDescription")} + {t( + "versionDescription" + )} )} @@ -1768,7 +1811,10 @@ export default function ReverseProxyTargets(props: { - {t("warning")}: {t("proxyProtocolWarning")} + + {t("warning")}: + {" "} + {t("proxyProtocolWarning")} @@ -1835,8 +1881,9 @@ export default function ReverseProxyTargets(props: { hcUnhealthyInterval: selectedTargetForHealthCheck.hcUnhealthyInterval || 30, - hcTlsServerName: selectedTargetForHealthCheck.hcTlsServerName || - undefined, + hcTlsServerName: + selectedTargetForHealthCheck.hcTlsServerName || + undefined }} onChanges={async (config) => { if (selectedTargetForHealthCheck) { diff --git a/src/app/[orgId]/settings/resources/proxy/create/page.tsx b/src/app/[orgId]/settings/resources/proxy/create/page.tsx index 5fe98c95..94021320 100644 --- a/src/app/[orgId]/settings/resources/proxy/create/page.tsx +++ b/src/app/[orgId]/settings/resources/proxy/create/page.tsx @@ -432,16 +432,16 @@ export default function Page() { const newTarget: LocalTarget = { ...data, - path: isHttp ? (data.path || null) : null, - pathMatchType: isHttp ? (data.pathMatchType || null) : null, - rewritePath: isHttp ? (data.rewritePath || null) : null, - rewritePathType: isHttp ? (data.rewritePathType || null) : null, + path: isHttp ? data.path || null : null, + pathMatchType: isHttp ? data.pathMatchType || null : null, + rewritePath: isHttp ? data.rewritePath || null : null, + rewritePathType: isHttp ? data.rewritePathType || null : null, siteType: site?.type || null, enabled: true, targetId: new Date().getTime(), new: true, resourceId: 0, // Will be set when resource is created - priority: isHttp ? (data.priority || 100) : 100, // Default priority + priority: isHttp ? data.priority || 100 : 100, // Default priority hcEnabled: false, hcPath: null, hcMethod: null, @@ -507,7 +507,7 @@ export default function Page() { try { const payload = { name: baseData.name, - http: baseData.http, + http: baseData.http }; let sanitizedSubdomain: string | undefined; @@ -577,7 +577,8 @@ export default function Page() { hcFollowRedirects: target.hcFollowRedirects || null, hcStatus: target.hcStatus || null, - hcUnhealthyInterval: target.hcUnhealthyInterval || null, + hcUnhealthyInterval: + target.hcUnhealthyInterval || null, hcMode: target.hcMode || null, hcTlsServerName: target.hcTlsServerName }; @@ -737,7 +738,7 @@ export default function Page() { const priorityColumn: ColumnDef = { id: "priority", header: () => ( -
+
{t("priority")} @@ -780,7 +781,7 @@ export default function Page() { const healthCheckColumn: ColumnDef = { accessorKey: "healthCheck", - header: () => ({t("healthCheck")}), + header: () => {t("healthCheck")}, cell: ({ row }) => { const status = row.original.hcHealth || "unknown"; const isEnabled = row.original.hcEnabled; @@ -826,18 +827,16 @@ export default function Page() { {row.original.siteType === "newt" ? ( ) : ( - @@ -852,7 +851,7 @@ export default function Page() { const matchPathColumn: ColumnDef = { accessorKey: "path", - header: () => ({t("matchPath")}), + header: () => {t("matchPath")}, cell: ({ row }) => { const hasPathMatch = !!( row.original.path || row.original.pathMatchType @@ -914,7 +913,7 @@ export default function Page() { const addressColumn: ColumnDef = { accessorKey: "address", - header: () => ({t("address")}), + header: () => {t("address")}, cell: ({ row }) => { const selectedSite = sites.find( (site) => site.siteId === row.original.siteId @@ -1035,8 +1034,12 @@ export default function Page() { {row.original.method || "http"} - http - https + + http + + + https + h2c @@ -1050,7 +1053,7 @@ export default function Page() { { const input = e.target.value.trim(); @@ -1128,7 +1131,7 @@ export default function Page() { const rewritePathColumn: ColumnDef = { accessorKey: "rewritePath", - header: () => ({t("rewritePath")}), + header: () => {t("rewritePath")}, cell: ({ row }) => { const hasRewritePath = !!( row.original.rewritePath || row.original.rewritePathType @@ -1198,7 +1201,7 @@ export default function Page() { const enabledColumn: ColumnDef = { accessorKey: "enabled", - header: () => ({t("enabled")}), + header: () => {t("enabled")}, cell: ({ row }) => (
= { id: "actions", - header: () => ({t("actions")}), + header: () => {t("actions")}, cell: ({ row }) => (
) : ( -
+

{t("targetNoOne")}

diff --git a/src/components/DomainPicker.tsx b/src/components/DomainPicker.tsx index 24f510dc..2d17e39f 100644 --- a/src/components/DomainPicker.tsx +++ b/src/components/DomainPicker.tsx @@ -809,15 +809,6 @@ export default function DomainPicker2({ )}
)} - - {loadingDomains && ( -
-
-
- {t("domainPickerLoadingDomains")} -
-
- )}
); }