feat(sidebar): open API docs navigation link in new window
Some checks failed
CI / Typecheck, test & build (push) Failing after 5m6s
CI / Deploy to Cloudflare Workers (push) Has been skipped

This commit is contained in:
2026-08-16 20:18:47 +08:00
parent 6ebf21ddd6
commit 2c6fed7149
2 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,7 @@ export interface NavItem {
icon: LucideIcon
/** hide when the user lacks this permission (super-admin always passes) */
permission?: string
target?: string
}
export interface NavGroup {
@ -110,6 +111,7 @@ export const NAV_GROUPS: NavGroup[] = [
to: '/api-docs',
icon: FileJson,
permission: 'auth:api-docs:read',
target: '_blank',
},
{
label: '数据库管理台',

View File

@ -99,6 +99,7 @@ function AuthedLayout() {
<Link
key={item.to}
to={item.to}
target={item.target}
activeOptions={{ exact: item.to === '/categories' }}
className="flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [&.active]:bg-sidebar-accent [&.active]:font-medium [&.active]:text-sidebar-accent-foreground"
>