refactor: 清理站内导航死代码 (删除孤立NavigationPage组件+navigationApi+导航mock数据)
- 删除 frontend/src/components/navigation/NavigationPage.tsx (359行, 菜单/路由移除后遗留的孤立组件) - 移除 services/api.ts 中 navigationApi (唯一消费者已删除) - 移除 mocks/modules/misc.ts 中 navigationGroups/navigationLinks 死数据 (252行) - 清理 mocks/data.ts barrel 中导航 re-export - 修正 cloud.ts 误导性注释 (站内导航→云平台/账号/区域/域名数据) - 后端 navigation.go 保留不动 (菜单已移除但后端代码保留) - tsc --noEmit 零错误 + npm run build 通过
This commit is contained in:
1 parent
9af0890bc6
commit
d13f5b8fa1
5 files changed
+2
-646
No files matched your search
@@ -12,7 +12,7 @@ export * from './modules/monitor';
|
||||
export * from './modules/misc';
|
||||
|
||||
// Aggregate mockData object (cross-module references)
|
||||
import { sqlAuditRecords, sqlAuditRules, resourceModels, modelInstances, navigationGroups, navigationLinks } from './modules/misc';
|
||||
import { sqlAuditRecords, sqlAuditRules, resourceModels, modelInstances } from './modules/misc';
|
||||
import { ansiblePlaybooks, ansibleJobs, ansibleInventories, cronJobsList, cronJobExecutions, scripts } from './modules/automation';
|
||||
import { logMonitorEntries, logSources, traces, serviceMetrics, traceSpans, grafanaDashboards, datasources } from './modules/monitor';
|
||||
import { alertCenterAlerts, alertCenterRules, notificationChannels, recentAlerts, alertEvents } from './modules/alerts';
|
||||
@@ -75,6 +75,4 @@ export const mockData = {
|
||||
approvalFlows,
|
||||
approvalInstances,
|
||||
alertEvents,
|
||||
navigationGroups,
|
||||
navigationLinks,
|
||||
};
|
||||
@@ -279,7 +279,7 @@ export const platforms = [
|
||||
},
|
||||
];
|
||||
|
||||
// ==================== 站内导航数据 ====================
|
||||
// ==================== 云平台/账号/区域/域名数据 ====================
|
||||
|
||||
export const cloudProvidersList = [
|
||||
{ id: 'aliyun', name: '阿里云', icon: 'aliyun', regions: ['cn-beijing', 'cn-shanghai'] },
|
||||
|
||||
@@ -132,258 +132,6 @@ export const modelInstances: ModelInstance[] = [
|
||||
},
|
||||
];
|
||||
|
||||
// ==================== 机房机柜数据 ====================
|
||||
|
||||
export const navigationGroups = [
|
||||
{
|
||||
id: 'group-001',
|
||||
name: '运维工具',
|
||||
description: '日常运维常用工具',
|
||||
linkCount: 5,
|
||||
},
|
||||
{
|
||||
id: 'group-002',
|
||||
name: '监控告警',
|
||||
description: '监控系统和告警平台',
|
||||
linkCount: 4,
|
||||
},
|
||||
{
|
||||
id: 'group-003',
|
||||
name: '开发工具',
|
||||
description: '开发相关工具和平台',
|
||||
linkCount: 6,
|
||||
},
|
||||
{
|
||||
id: 'group-004',
|
||||
name: '文档知识库',
|
||||
description: '技术文档和知识库',
|
||||
linkCount: 3,
|
||||
},
|
||||
{
|
||||
id: 'group-005',
|
||||
name: '云平台',
|
||||
description: '各大云厂商控制台',
|
||||
linkCount: 5,
|
||||
},
|
||||
];
|
||||
|
||||
export const navigationLinks = [
|
||||
// 运维工具
|
||||
{
|
||||
id: 'link-001',
|
||||
name: 'Jenkins',
|
||||
url: 'https://jenkins.company.com',
|
||||
description: 'CI/CD流水线平台',
|
||||
groupId: 'group-001',
|
||||
isFavorite: true,
|
||||
tags: ['CI/CD', 'DevOps'],
|
||||
},
|
||||
{
|
||||
id: 'link-002',
|
||||
name: 'GitLab',
|
||||
url: 'https://gitlab.company.com',
|
||||
description: '代码仓库管理平台',
|
||||
groupId: 'group-001',
|
||||
isFavorite: true,
|
||||
tags: ['Git', '代码仓库'],
|
||||
},
|
||||
{
|
||||
id: 'link-003',
|
||||
name: 'Harbor',
|
||||
url: 'https://harbor.company.com',
|
||||
description: 'Docker镜像仓库',
|
||||
groupId: 'group-001',
|
||||
isFavorite: false,
|
||||
tags: ['Docker', '镜像'],
|
||||
},
|
||||
{
|
||||
id: 'link-004',
|
||||
name: 'Nexus',
|
||||
url: 'https://nexus.company.com',
|
||||
description: 'Maven/npm仓库',
|
||||
groupId: 'group-001',
|
||||
isFavorite: false,
|
||||
tags: ['Maven', 'npm'],
|
||||
},
|
||||
{
|
||||
id: 'link-005',
|
||||
name: 'Confluence',
|
||||
url: 'https://confluence.company.com',
|
||||
description: '团队协作文档平台',
|
||||
groupId: 'group-001',
|
||||
isFavorite: true,
|
||||
tags: ['文档', 'Wiki'],
|
||||
},
|
||||
// 监控告警
|
||||
{
|
||||
id: 'link-006',
|
||||
name: 'Prometheus',
|
||||
url: 'https://prometheus.company.com',
|
||||
description: '监控指标采集和查询',
|
||||
groupId: 'group-002',
|
||||
isFavorite: true,
|
||||
tags: ['监控', '指标'],
|
||||
},
|
||||
{
|
||||
id: 'link-007',
|
||||
name: 'Grafana',
|
||||
url: 'https://grafana.company.com',
|
||||
description: '可视化监控大盘',
|
||||
groupId: 'group-002',
|
||||
isFavorite: true,
|
||||
tags: ['监控', '可视化'],
|
||||
},
|
||||
{
|
||||
id: 'link-008',
|
||||
name: 'AlertManager',
|
||||
url: 'https://alertmanager.company.com',
|
||||
description: '告警管理和通知',
|
||||
groupId: 'group-002',
|
||||
isFavorite: false,
|
||||
tags: ['告警', '通知'],
|
||||
},
|
||||
{
|
||||
id: 'link-009',
|
||||
name: 'ELK Stack',
|
||||
url: 'https://kibana.company.com',
|
||||
description: '日志收集和分析平台',
|
||||
groupId: 'group-002',
|
||||
isFavorite: false,
|
||||
tags: ['日志', 'ELK'],
|
||||
},
|
||||
// 开发工具
|
||||
{
|
||||
id: 'link-010',
|
||||
name: 'Jira',
|
||||
url: 'https://jira.company.com',
|
||||
description: '项目管理和任务跟踪',
|
||||
groupId: 'group-003',
|
||||
isFavorite: true,
|
||||
tags: ['项目管理', '敏捷'],
|
||||
},
|
||||
{
|
||||
id: 'link-011',
|
||||
name: 'SonarQube',
|
||||
url: 'https://sonarqube.company.com',
|
||||
description: '代码质量分析平台',
|
||||
groupId: 'group-003',
|
||||
isFavorite: false,
|
||||
tags: ['代码质量', '扫描'],
|
||||
},
|
||||
{
|
||||
id: 'link-012',
|
||||
name: 'Nexus',
|
||||
url: 'https://nexus.company.com',
|
||||
description: '制品仓库管理',
|
||||
groupId: 'group-003',
|
||||
isFavorite: false,
|
||||
tags: ['制品', '仓库'],
|
||||
},
|
||||
{
|
||||
id: 'link-013',
|
||||
name: 'Swagger UI',
|
||||
url: 'https://swagger.company.com',
|
||||
description: 'API文档和测试',
|
||||
groupId: 'group-003',
|
||||
isFavorite: false,
|
||||
tags: ['API', '文档'],
|
||||
},
|
||||
{
|
||||
id: 'link-014',
|
||||
name: 'YApi',
|
||||
url: 'https://yapi.company.com',
|
||||
description: 'API接口管理平台',
|
||||
groupId: 'group-003',
|
||||
isFavorite: false,
|
||||
tags: ['API', '接口管理'],
|
||||
},
|
||||
{
|
||||
id: 'link-015',
|
||||
name: 'Postman',
|
||||
url: 'https://web.postman.co',
|
||||
description: 'API测试工具',
|
||||
groupId: 'group-003',
|
||||
isFavorite: true,
|
||||
tags: ['API', '测试'],
|
||||
},
|
||||
// 文档知识库
|
||||
{
|
||||
id: 'link-016',
|
||||
name: 'Confluence',
|
||||
url: 'https://confluence.company.com',
|
||||
description: '团队知识库',
|
||||
groupId: 'group-004',
|
||||
isFavorite: true,
|
||||
tags: ['文档', '知识库'],
|
||||
},
|
||||
{
|
||||
id: 'link-017',
|
||||
name: 'Notion',
|
||||
url: 'https://notion.so',
|
||||
description: '个人和团队笔记',
|
||||
groupId: 'group-004',
|
||||
isFavorite: true,
|
||||
tags: ['笔记', '文档'],
|
||||
},
|
||||
{
|
||||
id: 'link-018',
|
||||
name: '语雀',
|
||||
url: 'https://yuque.com',
|
||||
description: '阿里知识库平台',
|
||||
groupId: 'group-004',
|
||||
isFavorite: false,
|
||||
tags: ['文档', '知识库'],
|
||||
},
|
||||
// 云平台
|
||||
{
|
||||
id: 'link-019',
|
||||
name: '阿里云控制台',
|
||||
url: 'https://ecs.console.aliyun.com',
|
||||
description: '阿里云ECS管理',
|
||||
groupId: 'group-005',
|
||||
isFavorite: true,
|
||||
tags: ['阿里云', 'ECS'],
|
||||
},
|
||||
{
|
||||
id: 'link-020',
|
||||
name: '腾讯云控制台',
|
||||
url: 'https://console.cloud.tencent.com',
|
||||
description: '腾讯云CVM管理',
|
||||
groupId: 'group-005',
|
||||
isFavorite: false,
|
||||
tags: ['腾讯云', 'CVM'],
|
||||
},
|
||||
{
|
||||
id: 'link-021',
|
||||
name: 'AWS控制台',
|
||||
url: 'https://console.aws.amazon.com',
|
||||
description: 'AWS EC2管理',
|
||||
groupId: 'group-005',
|
||||
isFavorite: true,
|
||||
tags: ['AWS', 'EC2'],
|
||||
},
|
||||
{
|
||||
id: 'link-022',
|
||||
name: '华为云控制台',
|
||||
url: 'https://console.huaweicloud.com',
|
||||
description: '华为云ECS管理',
|
||||
groupId: 'group-005',
|
||||
isFavorite: false,
|
||||
tags: ['华为云', 'ECS'],
|
||||
},
|
||||
{
|
||||
id: 'link-023',
|
||||
name: 'Azure门户',
|
||||
url: 'https://portal.azure.com',
|
||||
description: 'Azure虚拟机管理',
|
||||
groupId: 'group-005',
|
||||
isFavorite: false,
|
||||
tags: ['Azure', 'VM'],
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
|
||||
// ============ SQL审计数据 ============
|
||||
export const sqlAuditRecords = [
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user