mirror of https://github.com/kortix-ai/suna.git
rem /dashboard from routes
This commit is contained in:
parent
a873e3467c
commit
4bfadc4360
|
@ -10,7 +10,7 @@ export default async function PersonalAccountBillingPage() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<AccountBillingStatus accountId={personalAccount.account_id} returnUrl={`${returnUrl}/dashboard/settings/billing`} />
|
<AccountBillingStatus accountId={personalAccount.account_id} returnUrl={`${returnUrl}/settings/billing`} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
|
@ -7,9 +7,9 @@ import { usePathname } from "next/navigation";
|
||||||
export default function PersonalAccountSettingsPage({children}: {children: React.ReactNode}) {
|
export default function PersonalAccountSettingsPage({children}: {children: React.ReactNode}) {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const items = [
|
const items = [
|
||||||
{ name: "Profile", href: "/dashboard/settings" },
|
{ name: "Profile", href: "/settings" },
|
||||||
{ name: "Teams", href: "/dashboard/settings/teams" },
|
{ name: "Teams", href: "/settings/teams" },
|
||||||
{ name: "Billing", href: "/dashboard/settings/billing" },
|
{ name: "Billing", href: "/settings/billing" },
|
||||||
]
|
]
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6 w-full">
|
<div className="space-y-6 w-full">
|
|
@ -16,5 +16,5 @@ export default function AccountRedirect({
|
||||||
const { accountSlug } = unwrappedParams;
|
const { accountSlug } = unwrappedParams;
|
||||||
|
|
||||||
// Redirect to the settings page
|
// Redirect to the settings page
|
||||||
redirect(`/dashboard/${accountSlug}/settings`);
|
redirect(`/${accountSlug}/settings`);
|
||||||
}
|
}
|
|
@ -69,7 +69,7 @@ export default function TeamBillingPage({ params }: { params: Promise<AccountPar
|
||||||
|
|
||||||
<AccountBillingStatus
|
<AccountBillingStatus
|
||||||
accountId={teamAccount.account_id}
|
accountId={teamAccount.account_id}
|
||||||
returnUrl={`${returnUrl}/dashboard/${accountSlug}/settings/billing`}
|
returnUrl={`${returnUrl}/${accountSlug}/settings/billing`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
|
@ -20,9 +20,9 @@ export default function TeamSettingsLayout({
|
||||||
const { accountSlug } = unwrappedParams;
|
const { accountSlug } = unwrappedParams;
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const items = [
|
const items = [
|
||||||
{ name: "Account", href: `/dashboard/${accountSlug}/settings` },
|
{ name: "Account", href: `/${accountSlug}/settings` },
|
||||||
{ name: "Members", href: `/dashboard/${accountSlug}/settings/members` },
|
{ name: "Members", href: `/${accountSlug}/settings/members` },
|
||||||
{ name: "Billing", href: `/dashboard/${accountSlug}/settings/billing` },
|
{ name: "Billing", href: `/${accountSlug}/settings/billing` },
|
||||||
]
|
]
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6 w-full">
|
<div className="space-y-6 w-full">
|
|
@ -1110,7 +1110,7 @@ export default function ThreadPage({ params }: { params: Promise<ThreadParams> }
|
||||||
<div className="flex w-full max-w-md flex-col items-center gap-4 rounded-lg border bg-card p-6 text-center">
|
<div className="flex w-full max-w-md flex-col items-center gap-4 rounded-lg border bg-card p-6 text-center">
|
||||||
<h2 className="text-lg font-semibold text-destructive">Error</h2>
|
<h2 className="text-lg font-semibold text-destructive">Error</h2>
|
||||||
<p className="text-sm text-muted-foreground">{error}</p>
|
<p className="text-sm text-muted-foreground">{error}</p>
|
||||||
<Button variant="outline" onClick={() => router.push(`/dashboard/projects/${project?.id || ''}`)}>
|
<Button variant="outline" onClick={() => router.push(`/projects/${project?.id || ''}`)}>
|
||||||
Back to Project
|
Back to Project
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
|
@ -80,7 +80,7 @@ export default function AgentsPage() {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Button asChild>
|
<Button asChild>
|
||||||
<Link href="/dashboard/agents/new">
|
<Link href="/agents/new">
|
||||||
<PlusCircle className="mr-2 h-4 w-4" />
|
<PlusCircle className="mr-2 h-4 w-4" />
|
||||||
New Agent
|
New Agent
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -110,7 +110,7 @@ export default function AgentsPage() {
|
||||||
Create your first agent to start automating tasks and getting help from AI.
|
Create your first agent to start automating tasks and getting help from AI.
|
||||||
</p>
|
</p>
|
||||||
<Button asChild>
|
<Button asChild>
|
||||||
<Link href="/dashboard/agents/new">
|
<Link href="/agents/new">
|
||||||
<PlusCircle className="mr-2 h-4 w-4" />
|
<PlusCircle className="mr-2 h-4 w-4" />
|
||||||
Create your first agent
|
Create your first agent
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -133,7 +133,7 @@ export default function AgentsPage() {
|
||||||
<Link
|
<Link
|
||||||
href={
|
href={
|
||||||
agent.threadId
|
agent.threadId
|
||||||
? `/dashboard/agents/${agent.threadId}`
|
? `/agents/${agent.threadId}`
|
||||||
: `/dashboard`
|
: `/dashboard`
|
||||||
}
|
}
|
||||||
>
|
>
|
|
@ -48,7 +48,7 @@ function DashboardContent() {
|
||||||
localStorage.removeItem(PENDING_PROMPT_KEY);
|
localStorage.removeItem(PENDING_PROMPT_KEY);
|
||||||
|
|
||||||
// 5. Navigate to the new agent's thread page
|
// 5. Navigate to the new agent's thread page
|
||||||
router.push(`/dashboard/agents/${thread.thread_id}`);
|
router.push(`/agents/${thread.thread_id}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error creating agent:", error);
|
console.error("Error creating agent:", error);
|
||||||
setIsSubmitting(false);
|
setIsSubmitting(false);
|
|
@ -58,10 +58,10 @@ export default function ClientUserAccountButton({
|
||||||
<Link href="/dashboard" className="flex w-full h-full text-foreground/90">My Account</Link>
|
<Link href="/dashboard" className="flex w-full h-full text-foreground/90">My Account</Link>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem asChild className="rounded-md hover:bg-hover-bg cursor-pointer">
|
<DropdownMenuItem asChild className="rounded-md hover:bg-hover-bg cursor-pointer">
|
||||||
<Link href="/dashboard/settings" className="flex w-full h-full text-foreground/90">Settings</Link>
|
<Link href="/settings" className="flex w-full h-full text-foreground/90">Settings</Link>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem asChild className="rounded-md hover:bg-hover-bg cursor-pointer">
|
<DropdownMenuItem asChild className="rounded-md hover:bg-hover-bg cursor-pointer">
|
||||||
<Link href="/dashboard/settings/teams" className="flex w-full h-full text-foreground/90">Teams</Link>
|
<Link href="/settings/teams" className="flex w-full h-full text-foreground/90">Teams</Link>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuGroup>
|
</DropdownMenuGroup>
|
||||||
<DropdownMenuSeparator className="border-subtle dark:border-white/10" />
|
<DropdownMenuSeparator className="border-subtle dark:border-white/10" />
|
||||||
|
|
|
@ -39,7 +39,7 @@ export default async function ManageTeams() {
|
||||||
asChild
|
asChild
|
||||||
className="rounded-lg h-9 border-subtle dark:border-white/10 hover:bg-hover-bg dark:hover:bg-hover-bg-dark"
|
className="rounded-lg h-9 border-subtle dark:border-white/10 hover:bg-hover-bg dark:hover:bg-hover-bg-dark"
|
||||||
>
|
>
|
||||||
<Link href={`/dashboard/${team.slug}`}>View</Link>
|
<Link href={`/${team.slug}`}>View</Link>
|
||||||
</Button>
|
</Button>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
|
@ -79,7 +79,7 @@ export default function NewTeamForm() {
|
||||||
<p>
|
<p>
|
||||||
This will be used for your team URL:
|
This will be used for your team URL:
|
||||||
<span className="block text-primary font-medium mt-0.5">
|
<span className="block text-primary font-medium mt-0.5">
|
||||||
yourapp.com/dashboard/{slugValue || "team-name"}
|
yourapp.com/{slugValue || "team-name"}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -47,10 +47,10 @@ export default async function UserAccountButton() {
|
||||||
<Link href="/dashboard">My Account</Link>
|
<Link href="/dashboard">My Account</Link>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem asChild>
|
<DropdownMenuItem asChild>
|
||||||
<Link href="/dashboard/settings">Settings</Link>
|
<Link href="/settings">Settings</Link>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem asChild>
|
<DropdownMenuItem asChild>
|
||||||
<Link href="/dashboard/settings/teams">Teams</Link>
|
<Link href="/settings/teams">Teams</Link>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuGroup>
|
</DropdownMenuGroup>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
|
|
|
@ -118,7 +118,7 @@ export function HeroSection() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// 5. Navigate to the new agent's thread page
|
// 5. Navigate to the new agent's thread page
|
||||||
router.push(`/dashboard/agents/${thread.thread_id}`);
|
router.push(`/agents/${thread.thread_id}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error creating agent:", error);
|
console.error("Error creating agent:", error);
|
||||||
setIsSubmitting(false);
|
setIsSubmitting(false);
|
||||||
|
|
|
@ -104,7 +104,7 @@ export function NavAgents() {
|
||||||
threadId: thread.thread_id,
|
threadId: thread.thread_id,
|
||||||
projectId: projectId,
|
projectId: projectId,
|
||||||
projectName: project.name || 'Unnamed Project',
|
projectName: project.name || 'Unnamed Project',
|
||||||
url: `/dashboard/agents/${thread.thread_id}`,
|
url: `/agents/${thread.thread_id}`,
|
||||||
updatedAt: thread.updated_at || project.updated_at || new Date().toISOString()
|
updatedAt: thread.updated_at || project.updated_at || new Date().toISOString()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ export function NavUserWithTeams({
|
||||||
if (team.personal_account) {
|
if (team.personal_account) {
|
||||||
router.push('/dashboard')
|
router.push('/dashboard')
|
||||||
} else {
|
} else {
|
||||||
router.push(`/dashboard/${team.slug}`)
|
router.push(`/${team.slug}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,13 +268,13 @@ export function NavUserWithTeams({
|
||||||
{/* User Settings Section */}
|
{/* User Settings Section */}
|
||||||
<DropdownMenuGroup>
|
<DropdownMenuGroup>
|
||||||
<DropdownMenuItem asChild>
|
<DropdownMenuItem asChild>
|
||||||
<Link href="/dashboard/settings/billing">
|
<Link href="/settings/billing">
|
||||||
<CreditCard className="mr-2 h-4 w-4" />
|
<CreditCard className="mr-2 h-4 w-4" />
|
||||||
Billing
|
Billing
|
||||||
</Link>
|
</Link>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem asChild>
|
<DropdownMenuItem asChild>
|
||||||
<Link href="/dashboard/settings">
|
<Link href="/settings">
|
||||||
<Settings className="mr-2 h-4 w-4" />
|
<Settings className="mr-2 h-4 w-4" />
|
||||||
Settings
|
Settings
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
@ -25,7 +25,7 @@ export async function createInvitation(prevState: any, formData: FormData): Prom
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
revalidatePath(`/dashboard/[accountSlug]/settings/members/page`);
|
revalidatePath(`/[accountSlug]/settings/members/page`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
token: data.token as string
|
token: data.token as string
|
||||||
|
@ -69,6 +69,6 @@ export async function acceptInvitation(prevState: any, formData: FormData) {
|
||||||
message: error.message
|
message: error.message
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
redirect(`/dashboard/${data.slug}`);
|
redirect(`/${data.slug}`);
|
||||||
|
|
||||||
};
|
};
|
|
@ -21,7 +21,7 @@ export async function createTeam(prevState: any, formData: FormData) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect(`/dashboard/${data.slug}`);
|
redirect(`/${data.slug}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,5 +62,5 @@ export async function editTeamSlug(prevState: any, formData: FormData) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect(`/dashboard/${data.slug}/settings`);
|
redirect(`/${data.slug}/settings`);
|
||||||
};
|
};
|
Loading…
Reference in New Issue