feat(sidebar): open API docs navigation link in new window
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
+2
View File
@@ -34,6 +34,7 @@ export interface NavItem {
icon: LucideIcon icon: LucideIcon
/** hide when the user lacks this permission (super-admin always passes) */ /** hide when the user lacks this permission (super-admin always passes) */
permission?: string permission?: string
target?: string
} }
export interface NavGroup { export interface NavGroup {
@@ -110,6 +111,7 @@ export const NAV_GROUPS: NavGroup[] = [
to: '/api-docs', to: '/api-docs',
icon: FileJson, icon: FileJson,
permission: 'auth:api-docs:read', permission: 'auth:api-docs:read',
target: '_blank',
}, },
{ {
label: '数据库管理台', label: '数据库管理台',
+1
View File
@@ -99,6 +99,7 @@ function AuthedLayout() {
<Link <Link
key={item.to} key={item.to}
to={item.to} to={item.to}
target={item.target}
activeOptions={{ exact: item.to === '/categories' }} 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" 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"
> >