feat(sidebar): open API docs navigation link in new window
This commit is contained in:
@ -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: '数据库管理台',
|
||||||
|
|||||||
@ -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"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user