Move proxy and client to public and private

This commit is contained in:
Owen
2026-05-31 17:30:31 -07:00
parent b99e9a6468
commit 08a2923cfc
25 changed files with 53 additions and 81 deletions

View File

@@ -22,7 +22,21 @@ const nextConfig: NextConfig = {
reactCompiler: true,
transpilePackages: ["@novnc/novnc"],
output: "standalone",
allowedDevOrigins
allowedDevOrigins,
async redirects() {
return [
{
source: "/:orgId/settings/resources/proxy/:path*",
destination: "/:orgId/settings/resources/public/:path*",
permanent: true
},
{
source: "/:orgId/settings/resources/client/:path*",
destination: "/:orgId/settings/resources/private/:path*",
permanent: true
}
];
}
};
export default withNextIntl(nextConfig);

View File

@@ -343,8 +343,8 @@ export default function GeneralPage() {
<Link
href={
row.original.type === "ssh"
? `/${row.original.orgId}/settings/resources/client?query=${row.original.resourceNiceId}`
: `/${row.original.orgId}/settings/resources/proxy/${row.original.resourceNiceId}`
? `/${row.original.orgId}/settings/resources/private?query=${row.original.resourceNiceId}`
: `/${row.original.orgId}/settings/resources/public/${row.original.resourceNiceId}`
}
>
<Button variant="outline" size="sm">

View File

@@ -325,7 +325,7 @@ export default function ConnectionLogsPage() {
if (row.original.resourceName && row.original.resourceNiceId) {
return (
<Link
href={`/${row.original.orgId}/settings/resources/client/?query=${row.original.resourceNiceId}`}
href={`/${row.original.orgId}/settings/resources/private/?query=${row.original.resourceNiceId}`}
>
<Button variant="outline" size="sm">
{row.original.resourceName}

View File

@@ -400,8 +400,8 @@ export default function GeneralPage() {
<Link
href={
row.original.reason == 108 // for now the client will only have reason 108 so we know where to go
? `/${row.original.orgId}/settings/resources/client?query=${row.original.resourceNiceId}`
: `/${row.original.orgId}/settings/resources/proxy/${row.original.resourceNiceId}`
? `/${row.original.orgId}/settings/resources/private?query=${row.original.resourceNiceId}`
: `/${row.original.orgId}/settings/resources/public/${row.original.resourceNiceId}`
}
onClick={(e) => e.stopPropagation()}
>

View File

@@ -11,5 +11,5 @@ export interface ResourcesPageProps {
export default async function ResourcesPage(props: ResourcesPageProps) {
const params = await props.params;
redirect(`/${params.orgId}/settings/resources/proxy`);
redirect(`/${params.orgId}/settings/resources/public`);
}

View File

@@ -1,5 +1,5 @@
import type { InternalResourceRow } from "@app/components/ClientResourcesTable";
import PrivateResourcesTable from "@app/components/ClientResourcesTable";
import type { InternalResourceRow } from "@app/components/PrivateResourcesTable";
import PrivateResourcesTable from "@app/components/PrivateResourcesTable";
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
import PrivateResourcesBanner from "@app/components/PrivateResourcesBanner";
import { internal } from "@app/lib/api";

View File

@@ -548,7 +548,7 @@ export default function GeneralForm() {
if (data.niceId && data.niceId !== resource?.niceId) {
router.replace(
`/${updated.orgId}/settings/resources/proxy/${data.niceId}/general`
`/${updated.orgId}/settings/resources/public/${data.niceId}/general`
);
}

View File

@@ -39,69 +39,27 @@ import {
FormLabel,
FormMessage
} from "@app/components/ui/form";
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow
} from "@app/components/ui/table";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger
} from "@app/components/ui/tooltip";
import type { ResourceContextType } from "@app/contexts/resourceContext";
import { useEnvContext } from "@app/hooks/useEnvContext";
import { useResourceContext } from "@app/hooks/useResourceContext";
import { toast } from "@app/hooks/useToast";
import { createApiClient } from "@app/lib/api";
import { formatAxiosError } from "@app/lib/api/formatAxiosError";
import { DockerManager, DockerState } from "@app/lib/docker";
import { orgQueries, resourceQueries } from "@app/lib/queries";
import { resourceQueries } from "@app/lib/queries";
import { zodResolver } from "@hookform/resolvers/zod";
import { build } from "@server/build";
import { tlsNameSchema } from "@server/lib/schemas";
import { type GetResourceResponse } from "@server/routers/resource";
import type { ListSitesResponse } from "@server/routers/site";
import { CreateTargetResponse } from "@server/routers/target";
import { ListTargetsResponse } from "@server/routers/target/listTargets";
import { ArrayElement } from "@server/types/ArrayElement";
import { useQuery } from "@tanstack/react-query";
import {
LocalTarget,
ProxyResourceTargetsForm
} from "@app/app/[orgId]/settings/resources/proxy/ProxyResourceTargetsForm";
import {
ColumnDef,
flexRender,
getCoreRowModel,
getFilteredRowModel,
getPaginationRowModel,
getSortedRowModel,
useReactTable
} from "@tanstack/react-table";
import { AxiosResponse } from "axios";
} from "@app/app/[orgId]/settings/resources/public/ProxyResourceTargetsForm";
import {
AlertTriangle,
CircleCheck,
CircleX,
ExternalLink,
Info,
Plus,
Settings
} from "lucide-react";
import { useTranslations } from "next-intl";
import { useRouter } from "next/navigation";
import {
use,
useActionState,
useCallback,
useEffect,
useMemo,
useState
} from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";

View File

@@ -83,22 +83,22 @@ export default async function ResourceLayout(props: ResourceLayoutProps) {
const navItems = [
{
title: t("general"),
href: `/{orgId}/settings/resources/proxy/{niceId}/general`
href: `/{orgId}/settings/resources/public/{niceId}/general`
},
{
title: t(`${resource.mode}Settings`),
href: `/{orgId}/settings/resources/proxy/{niceId}/${resource.mode}`
href: `/{orgId}/settings/resources/public/{niceId}/${resource.mode}`
}
];
if (["http", "ssh", "rdp", "vnc"].includes(resource.mode)) {
navItems.push({
title: t("authentication"),
href: `/{orgId}/settings/resources/proxy/{niceId}/authentication`
href: `/{orgId}/settings/resources/public/{niceId}/authentication`
});
// navItems.push({
// title: t("rules"),
// href: `/{orgId}/settings/resources/proxy/{niceId}/rules`
// href: `/{orgId}/settings/resources/public/{niceId}/rules`
// });
}

View File

@@ -10,6 +10,6 @@ export default async function ResourcePage(props: {
}) {
const params = await props.params;
redirect(
`/${params.orgId}/settings/resources/proxy/${params.niceId}/general`
`/${params.orgId}/settings/resources/public/${params.niceId}/general`
);
}

View File

@@ -89,7 +89,7 @@ import { useQuery } from "@tanstack/react-query";
import {
LocalTarget,
ProxyResourceTargetsForm
} from "@app/app/[orgId]/settings/resources/proxy/ProxyResourceTargetsForm";
} from "@app/app/[orgId]/settings/resources/public/ProxyResourceTargetsForm";
import {
ColumnDef,
flexRender,
@@ -514,7 +514,7 @@ export default function Page() {
}
}
router.push(
`/${orgId}/settings/resources/proxy/${newNiceId}`
`/${orgId}/settings/resources/public/${newNiceId}`
);
} else if (resourceType === "ssh") {
if (isNative) {
@@ -550,7 +550,7 @@ export default function Page() {
}
router.push(
`/${orgId}/settings/resources/proxy/${newNiceId}`
`/${orgId}/settings/resources/public/${newNiceId}`
);
} else if (resourceType === "rdp" || resourceType === "vnc") {
for (const site of bgSelectedSites) {
@@ -566,7 +566,7 @@ export default function Page() {
}
router.push(
`/${orgId}/settings/resources/proxy/${newNiceId}`
`/${orgId}/settings/resources/public/${newNiceId}`
);
} else {
// TCP / UDP — create targets then show snippets
@@ -1308,7 +1308,7 @@ export default function Page() {
type="button"
onClick={() =>
router.push(
`/${orgId}/settings/resources/proxy/${niceId}`
`/${orgId}/settings/resources/public/${niceId}`
)
}
>

View File

@@ -71,12 +71,12 @@ export const orgNavSections = (
items: [
{
title: "sidebarProxyResources",
href: "/{orgId}/settings/resources/proxy",
href: "/{orgId}/settings/resources/public",
icon: <Globe className="size-4 flex-none" />
},
{
title: "sidebarClientResources",
href: "/{orgId}/settings/resources/client",
href: "/{orgId}/settings/resources/private",
icon: <GlobeLock className="size-4 flex-none" />
}
]

View File

@@ -406,7 +406,7 @@ export default function HealthChecksTable({
}
return (
<Link
href={`/${orgId}/settings/resources/proxy/${r.resourceNiceId}`}
href={`/${orgId}/settings/resources/public/${r.resourceNiceId}`}
>
<Button variant="outline" size="sm">
{r.resourceName}
@@ -627,7 +627,7 @@ export default function HealthChecksTable({
</DropdownMenu>
{r.resourceId && r.resourceName && r.resourceNiceId ? (
<Link
href={`/${orgId}/settings/resources/proxy/${r.resourceNiceId}`}
href={`/${orgId}/settings/resources/public/${r.resourceNiceId}`}
>
<Button variant="outline" disabled={!isPaid}>
{t("edit")}

View File

@@ -609,7 +609,7 @@ export default function ProxyResourcesTable({
<DropdownMenuContent align="end">
<Link
className="block w-full"
href={`/${resourceRow.orgId}/settings/resources/proxy/${resourceRow.nice}`}
href={`/${resourceRow.orgId}/settings/resources/public/${resourceRow.nice}`}
>
<DropdownMenuItem>
{t("viewSettings")}
@@ -628,7 +628,7 @@ export default function ProxyResourcesTable({
</DropdownMenuContent>
</DropdownMenu>
<Link
href={`/${resourceRow.orgId}/settings/resources/proxy/${resourceRow.nice}`}
href={`/${resourceRow.orgId}/settings/resources/public/${resourceRow.nice}`}
>
<Button variant={"outline"}>
{t("edit")}
@@ -744,7 +744,9 @@ export default function ProxyResourcesTable({
onPaginationChange={handlePaginationChange}
onAdd={() =>
startNavigation(() =>
router.push(`/${orgId}/settings/resources/proxy/create`)
router.push(
`/${orgId}/settings/resources/public/create`
)
)
}
addButtonText={t("resourceAdd")}

View File

@@ -145,7 +145,7 @@ export default function ShareLinksTable({
const r = row.original;
return (
<Link
href={`/${orgId}/settings/resources/proxy/${r.resourceNiceId}`}
href={`/${orgId}/settings/resources/public/${r.resourceNiceId}`}
>
<Button variant="outline" size="sm">
{r.resourceName}
@@ -328,9 +328,7 @@ export default function ShareLinksTable({
onConfirm={async () =>
deleteSharelink(selectedLink.accessTokenId)
}
string={
selectedLink.title || selectedLink.resourceName
}
string={selectedLink.title || selectedLink.resourceName}
title={t("shareDelete")}
/>
)}

View File

@@ -421,15 +421,15 @@ export default function SiteResourcesOverview({
publicList.length === 0 &&
privateList.length === 0;
const publicViewAllHref = `/${orgId}/settings/resources/proxy?siteId=${siteId}`;
const privateViewAllHref = `/${orgId}/settings/resources/client?siteId=${siteId}`;
const publicViewAllHref = `/${orgId}/settings/resources/public?siteId=${siteId}`;
const privateViewAllHref = `/${orgId}/settings/resources/private?siteId=${siteId}`;
const publicRows = publicList.map((r) => ({
key: r.resourceId,
meta: <PublicResourceMeta resource={r} />,
name: r.name,
access: <PublicAccessMethod resource={r} />,
editHref: `/${orgId}/settings/resources/proxy/${r.niceId}`
editHref: `/${orgId}/settings/resources/public/${r.niceId}`
}));
const privateRows = privateList.map((row) => {
@@ -442,7 +442,7 @@ export default function SiteResourcesOverview({
meta: <PrivateResourceMeta row={row} />,
name: row.name,
access: <PrivateAccessMethod row={row} />,
editHref: `/${orgId}/settings/resources/client?${qs.toString()}`
editHref: `/${orgId}/settings/resources/private?${qs.toString()}`
};
});

View File

@@ -506,7 +506,7 @@ export default function SitesTable({
</Link>
<Link
className="block w-full"
href={`/${siteRow.orgId}/settings/resources/proxy?siteId=${siteRow.id}`}
href={`/${siteRow.orgId}/settings/resources/public?siteId=${siteRow.id}`}
>
<DropdownMenuItem>
{t("sitesTableViewPublicResources")}
@@ -514,7 +514,7 @@ export default function SitesTable({
</Link>
<Link
className="block w-full"
href={`/${siteRow.orgId}/settings/resources/client?siteId=${siteRow.id}`}
href={`/${siteRow.orgId}/settings/resources/private?siteId=${siteRow.id}`}
>
<DropdownMenuItem>
{t(