mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +00:00
move edit resource to proxy subpath
This commit is contained in:
@@ -466,7 +466,7 @@ export default function GeneralPage() {
|
||||
cell: ({ row }) => {
|
||||
return (
|
||||
<Link
|
||||
href={`/${row.original.orgId}/settings/resources/${row.original.resourceNiceId}`}
|
||||
href={`/${row.original.orgId}/settings/resources/proxy/${row.original.resourceNiceId}`}
|
||||
>
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
@@ -499,7 +499,7 @@ export default function GeneralPage() {
|
||||
cell: ({ row }) => {
|
||||
return (
|
||||
<Link
|
||||
href={`/${row.original.orgId}/settings/resources/${row.original.resourceNiceId}`}
|
||||
href={`/${row.original.orgId}/settings/resources/proxy/${row.original.resourceNiceId}`}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<Button
|
||||
@@ -793,4 +793,4 @@ export default function GeneralPage() {
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ import {
|
||||
} from "@app/components/ui/form";
|
||||
import { ListUsersResponse } from "@server/routers/user";
|
||||
import { Binary, Key, Bot } from "lucide-react";
|
||||
import SetResourcePasswordForm from "../../../../../../components/SetResourcePasswordForm";
|
||||
import SetResourcePincodeForm from "../../../../../../components/SetResourcePincodeForm";
|
||||
import SetResourceHeaderAuthForm from "../../../../../../components/SetResourceHeaderAuthForm";
|
||||
import SetResourcePasswordForm from "components/SetResourcePasswordForm";
|
||||
import SetResourcePincodeForm from "@app/components/SetResourcePincodeForm";
|
||||
import SetResourceHeaderAuthForm from "@app/components/SetResourceHeaderAuthForm";
|
||||
import { createApiClient } from "@app/lib/api";
|
||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||
import {
|
||||
@@ -54,7 +54,7 @@ import DomainPicker from "@app/components/DomainPicker";
|
||||
import { Globe } from "lucide-react";
|
||||
import { build } from "@server/build";
|
||||
import { finalizeSubdomainSanitize } from "@app/lib/subdomain-utils";
|
||||
import { DomainRow } from "../../../../../../components/DomainsTable";
|
||||
import { DomainRow } from "@app/components/DomainsTable";
|
||||
import { toASCII, toUnicode } from "punycode";
|
||||
import { useLicenseStatusContext } from "@app/hooks/useLicenseStatusContext";
|
||||
import { useSubscriptionStatusContext } from "@app/hooks/useSubscriptionStatusContext";
|
||||
@@ -235,7 +235,7 @@ export default function GeneralForm() {
|
||||
});
|
||||
|
||||
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 {
|
||||
router.refresh();
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
||||
import { GetOrgResponse } from "@server/routers/org";
|
||||
import OrgProvider from "@app/providers/OrgProvider";
|
||||
import { cache } from "react";
|
||||
import ResourceInfoBox from "../../../../../components/ResourceInfoBox";
|
||||
import ResourceInfoBox from "@app/components/ResourceInfoBox";
|
||||
import { GetSiteResponse } from "@server/routers/site";
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
@@ -77,22 +77,22 @@ export default async function ResourceLayout(props: ResourceLayoutProps) {
|
||||
const navItems = [
|
||||
{
|
||||
title: t('general'),
|
||||
href: `/{orgId}/settings/resources/{niceId}/general`
|
||||
href: `/{orgId}/settings/resources/proxy/{niceId}/general`
|
||||
},
|
||||
{
|
||||
title: t('proxy'),
|
||||
href: `/{orgId}/settings/resources/{niceId}/proxy`
|
||||
href: `/{orgId}/settings/resources/proxy/{niceId}/proxy`
|
||||
}
|
||||
];
|
||||
|
||||
if (resource.http) {
|
||||
navItems.push({
|
||||
title: t('authentication'),
|
||||
href: `/{orgId}/settings/resources/{niceId}/authentication`
|
||||
href: `/{orgId}/settings/resources/proxy/{niceId}/authentication`
|
||||
});
|
||||
navItems.push({
|
||||
title: t('rules'),
|
||||
href: `/{orgId}/settings/resources/{niceId}/rules`
|
||||
href: `/{orgId}/settings/resources/proxy/{niceId}/rules`
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@ export default async function ResourcePage(props: {
|
||||
}) {
|
||||
const params = await props.params;
|
||||
redirect(
|
||||
`/${params.orgId}/settings/resources/${params.niceId}/proxy`
|
||||
`/${params.orgId}/settings/resources/proxy/${params.niceId}/proxy`
|
||||
);
|
||||
}
|
||||
@@ -604,7 +604,7 @@ export default function Page() {
|
||||
}
|
||||
|
||||
if (isHttp) {
|
||||
router.push(`/${orgId}/settings/resources/${niceId}`);
|
||||
router.push(`/${orgId}/settings/resources/proxy/${niceId}`);
|
||||
} else {
|
||||
const tcpUdpData = tcpUdpForm.getValues();
|
||||
// Only show config snippets if enableProxy is explicitly true
|
||||
@@ -613,7 +613,7 @@ export default function Page() {
|
||||
router.refresh();
|
||||
// } else {
|
||||
// // 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"
|
||||
onClick={() =>
|
||||
router.push(
|
||||
`/${orgId}/settings/resources/${niceId}/proxy`
|
||||
`/${orgId}/settings/resources/proxy/${niceId}/proxy`
|
||||
)
|
||||
}
|
||||
>
|
||||
|
||||
@@ -493,7 +493,7 @@ export default function ProxyResourcesTable({
|
||||
<DropdownMenuContent align="end">
|
||||
<Link
|
||||
className="block w-full"
|
||||
href={`/${resourceRow.orgId}/settings/resources/${resourceRow.nice}`}
|
||||
href={`/${resourceRow.orgId}/settings/resources/proxy/${resourceRow.nice}`}
|
||||
>
|
||||
<DropdownMenuItem>
|
||||
{t("viewSettings")}
|
||||
@@ -512,7 +512,7 @@ export default function ProxyResourcesTable({
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
<Link
|
||||
href={`/${resourceRow.orgId}/settings/resources/${resourceRow.nice}`}
|
||||
href={`/${resourceRow.orgId}/settings/resources/proxy/${resourceRow.nice}`}
|
||||
>
|
||||
<Button variant={"outline"}>
|
||||
{t("edit")}
|
||||
|
||||
@@ -124,7 +124,7 @@ export default function ShareLinksTable({
|
||||
cell: ({ row }) => {
|
||||
const r = row.original;
|
||||
return (
|
||||
<Link href={`/${orgId}/settings/resources/${r.resourceNiceId}`}>
|
||||
<Link href={`/${orgId}/settings/resources/proxy/${r.resourceNiceId}`}>
|
||||
<Button variant="outline">
|
||||
{r.resourceName}
|
||||
<ArrowUpRight className="ml-2 h-4 w-4" />
|
||||
|
||||
Reference in New Issue
Block a user