move edit resource to proxy subpath

This commit is contained in:
miloschwartz
2025-12-04 21:18:17 -05:00
parent 54670e150d
commit 2bad9daaea
11 changed files with 20 additions and 20 deletions

View File

@@ -466,7 +466,7 @@ export default function GeneralPage() {
cell: ({ row }) => { cell: ({ row }) => {
return ( return (
<Link <Link
href={`/${row.original.orgId}/settings/resources/${row.original.resourceNiceId}`} href={`/${row.original.orgId}/settings/resources/proxy/${row.original.resourceNiceId}`}
> >
<Button <Button
variant="outline" variant="outline"

View File

@@ -499,7 +499,7 @@ export default function GeneralPage() {
cell: ({ row }) => { cell: ({ row }) => {
return ( return (
<Link <Link
href={`/${row.original.orgId}/settings/resources/${row.original.resourceNiceId}`} href={`/${row.original.orgId}/settings/resources/proxy/${row.original.resourceNiceId}`}
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<Button <Button
@@ -793,4 +793,4 @@ export default function GeneralPage() {
/> />
</> </>
); );
} }

View File

@@ -27,9 +27,9 @@ import {
} from "@app/components/ui/form"; } from "@app/components/ui/form";
import { ListUsersResponse } from "@server/routers/user"; import { ListUsersResponse } from "@server/routers/user";
import { Binary, Key, Bot } from "lucide-react"; import { Binary, Key, Bot } from "lucide-react";
import SetResourcePasswordForm from "../../../../../../components/SetResourcePasswordForm"; import SetResourcePasswordForm from "components/SetResourcePasswordForm";
import SetResourcePincodeForm from "../../../../../../components/SetResourcePincodeForm"; import SetResourcePincodeForm from "@app/components/SetResourcePincodeForm";
import SetResourceHeaderAuthForm from "../../../../../../components/SetResourceHeaderAuthForm"; import SetResourceHeaderAuthForm from "@app/components/SetResourceHeaderAuthForm";
import { createApiClient } from "@app/lib/api"; import { createApiClient } from "@app/lib/api";
import { useEnvContext } from "@app/hooks/useEnvContext"; import { useEnvContext } from "@app/hooks/useEnvContext";
import { import {

View File

@@ -54,7 +54,7 @@ import DomainPicker from "@app/components/DomainPicker";
import { Globe } from "lucide-react"; import { Globe } from "lucide-react";
import { build } from "@server/build"; import { build } from "@server/build";
import { finalizeSubdomainSanitize } from "@app/lib/subdomain-utils"; import { finalizeSubdomainSanitize } from "@app/lib/subdomain-utils";
import { DomainRow } from "../../../../../../components/DomainsTable"; import { DomainRow } from "@app/components/DomainsTable";
import { toASCII, toUnicode } from "punycode"; import { toASCII, toUnicode } from "punycode";
import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext"; import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext";
import { useSubscriptionStatusContext } from "@app/hooks/useSubscriptionStatusContext"; import { useSubscriptionStatusContext } from "@app/hooks/useSubscriptionStatusContext";
@@ -235,7 +235,7 @@ export default function GeneralForm() {
}); });
if (data.niceId && data.niceId !== resource?.niceId) { if (data.niceId && data.niceId !== resource?.niceId) {
router.replace(`/${updated.orgId}/settings/resources/${data.niceId}/general`); router.replace(`/${updated.orgId}/settings/resources/proxy/${data.niceId}/general`);
} else { } else {
router.refresh(); router.refresh();
} }

View File

@@ -12,7 +12,7 @@ import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
import { GetOrgResponse } from "@server/routers/org"; import { GetOrgResponse } from "@server/routers/org";
import OrgProvider from "@app/providers/OrgProvider"; import OrgProvider from "@app/providers/OrgProvider";
import { cache } from "react"; import { cache } from "react";
import ResourceInfoBox from "../../../../../components/ResourceInfoBox"; import ResourceInfoBox from "@app/components/ResourceInfoBox";
import { GetSiteResponse } from "@server/routers/site"; import { GetSiteResponse } from "@server/routers/site";
import { getTranslations } from 'next-intl/server'; import { getTranslations } from 'next-intl/server';
@@ -77,22 +77,22 @@ export default async function ResourceLayout(props: ResourceLayoutProps) {
const navItems = [ const navItems = [
{ {
title: t('general'), title: t('general'),
href: `/{orgId}/settings/resources/{niceId}/general` href: `/{orgId}/settings/resources/proxy/{niceId}/general`
}, },
{ {
title: t('proxy'), title: t('proxy'),
href: `/{orgId}/settings/resources/{niceId}/proxy` href: `/{orgId}/settings/resources/proxy/{niceId}/proxy`
} }
]; ];
if (resource.http) { if (resource.http) {
navItems.push({ navItems.push({
title: t('authentication'), title: t('authentication'),
href: `/{orgId}/settings/resources/{niceId}/authentication` href: `/{orgId}/settings/resources/proxy/{niceId}/authentication`
}); });
navItems.push({ navItems.push({
title: t('rules'), title: t('rules'),
href: `/{orgId}/settings/resources/{niceId}/rules` href: `/{orgId}/settings/resources/proxy/{niceId}/rules`
}); });
} }

View File

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

View File

@@ -604,7 +604,7 @@ export default function Page() {
} }
if (isHttp) { if (isHttp) {
router.push(`/${orgId}/settings/resources/${niceId}`); router.push(`/${orgId}/settings/resources/proxy/${niceId}`);
} else { } else {
const tcpUdpData = tcpUdpForm.getValues(); const tcpUdpData = tcpUdpForm.getValues();
// Only show config snippets if enableProxy is explicitly true // Only show config snippets if enableProxy is explicitly true
@@ -613,7 +613,7 @@ export default function Page() {
router.refresh(); router.refresh();
// } else { // } else {
// // If enableProxy is false or undefined, go directly to resource page // // If enableProxy is false or undefined, go directly to resource page
// router.push(`/${orgId}/settings/resources/${id}`); // router.push(`/${orgId}/settings/resources/proxy/${id}`);
// } // }
} }
} }
@@ -1898,7 +1898,7 @@ export default function Page() {
type="button" type="button"
onClick={() => onClick={() =>
router.push( router.push(
`/${orgId}/settings/resources/${niceId}/proxy` `/${orgId}/settings/resources/proxy/${niceId}/proxy`
) )
} }
> >

View File

@@ -493,7 +493,7 @@ export default function ProxyResourcesTable({
<DropdownMenuContent align="end"> <DropdownMenuContent align="end">
<Link <Link
className="block w-full" className="block w-full"
href={`/${resourceRow.orgId}/settings/resources/${resourceRow.nice}`} href={`/${resourceRow.orgId}/settings/resources/proxy/${resourceRow.nice}`}
> >
<DropdownMenuItem> <DropdownMenuItem>
{t("viewSettings")} {t("viewSettings")}
@@ -512,7 +512,7 @@ export default function ProxyResourcesTable({
</DropdownMenuContent> </DropdownMenuContent>
</DropdownMenu> </DropdownMenu>
<Link <Link
href={`/${resourceRow.orgId}/settings/resources/${resourceRow.nice}`} href={`/${resourceRow.orgId}/settings/resources/proxy/${resourceRow.nice}`}
> >
<Button variant={"outline"}> <Button variant={"outline"}>
{t("edit")} {t("edit")}

View File

@@ -124,7 +124,7 @@ export default function ShareLinksTable({
cell: ({ row }) => { cell: ({ row }) => {
const r = row.original; const r = row.original;
return ( return (
<Link href={`/${orgId}/settings/resources/${r.resourceNiceId}`}> <Link href={`/${orgId}/settings/resources/proxy/${r.resourceNiceId}`}>
<Button variant="outline"> <Button variant="outline">
{r.resourceName} {r.resourceName}
<ArrowUpRight className="ml-2 h-4 w-4" /> <ArrowUpRight className="ml-2 h-4 w-4" />