mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-04 15:06:37 +08:00
[重构] 资源路径使用单数
This commit is contained in:
@@ -7,56 +7,56 @@ export const dashboardNavigation: NavigationItem[] = [
|
||||
shortLabel: '总览',
|
||||
description: '查看阶段推进情况、系统入口与模块骨架状态。',
|
||||
},
|
||||
{
|
||||
href: '/proxy-routes',
|
||||
{
|
||||
href: '/proxy-route',
|
||||
label: '反代规则',
|
||||
shortLabel: '规则',
|
||||
description: '已接入列表、表单、证书匹配与发布动作。',
|
||||
},
|
||||
{
|
||||
href: '/config-versions',
|
||||
{
|
||||
href: '/config-version',
|
||||
label: '配置版本',
|
||||
shortLabel: '版本',
|
||||
description: '已接入版本预览、发布前 diff 与重新激活。',
|
||||
},
|
||||
{
|
||||
href: '/nodes',
|
||||
{
|
||||
href: '/node',
|
||||
label: '节点管理',
|
||||
shortLabel: '节点',
|
||||
description: '已接入状态标签、部署命令、心跳与更新动作。',
|
||||
},
|
||||
{
|
||||
href: '/apply-logs',
|
||||
href: '/apply-log',
|
||||
label: '应用记录',
|
||||
shortLabel: '记录',
|
||||
description: '已接入 node_id 筛选、结果状态展示与单条详情查看。',
|
||||
},
|
||||
{
|
||||
href: '/managed-domains',
|
||||
href: '/managed-domain',
|
||||
label: '域名管理',
|
||||
shortLabel: '域名',
|
||||
description: '已接入列表、证书绑定、启停控制与编辑删除。',
|
||||
},
|
||||
{
|
||||
href: '/tls-certificates',
|
||||
href: '/tls-certificate',
|
||||
label: 'TLS 证书',
|
||||
shortLabel: '证书',
|
||||
description: '已接入 PEM 导入、文件上传、到期展示与删除。',
|
||||
},
|
||||
{
|
||||
href: '/files',
|
||||
{
|
||||
href: '/file',
|
||||
label: '文件管理',
|
||||
shortLabel: '文件',
|
||||
description: '已接入上传、下载、复制链接、搜索与删除动作。',
|
||||
},
|
||||
{
|
||||
href: '/users',
|
||||
{
|
||||
href: '/user',
|
||||
label: '用户管理',
|
||||
shortLabel: '用户',
|
||||
description: '已接入搜索、创建、编辑、封禁与权限调整。',
|
||||
},
|
||||
{
|
||||
href: '/settings',
|
||||
{
|
||||
href: '/setting',
|
||||
label: '设置',
|
||||
shortLabel: '设置',
|
||||
description: '已接入个人、运维、系统与关于内容维护。',
|
||||
|
||||
@@ -3,13 +3,13 @@ import { describe, expect, it } from 'vitest';
|
||||
import { getCurrentNavigationItem, isPathActive } from '@/lib/utils/navigation';
|
||||
|
||||
describe('navigation utils', () => {
|
||||
it('marks root path as active only for home', () => {
|
||||
expect(isPathActive('/', '/')).toBe(true);
|
||||
expect(isPathActive('/nodes', '/')).toBe(false);
|
||||
});
|
||||
|
||||
it('resolves current navigation item for nested paths', () => {
|
||||
expect(getCurrentNavigationItem('/nodes/abc')?.label).toBe('节点管理');
|
||||
expect(getCurrentNavigationItem('/settings')?.label).toBe('设置');
|
||||
});
|
||||
it('marks root path as active only for home', () => {
|
||||
expect(isPathActive('/', '/')).toBe(true);
|
||||
expect(isPathActive('/node', '/')).toBe(false);
|
||||
});
|
||||
|
||||
it('resolves current navigation item for nested paths', () => {
|
||||
expect(getCurrentNavigationItem('/node/abc')?.label).toBe('节点管理');
|
||||
expect(getCurrentNavigationItem('/setting')?.label).toBe('设置');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user