refactor: 全局代码模块化重构 — 所有文件<700行
后端 handler 拆分: - automation.go(1067→4文件), server.go(1011→5文件), ldap.go(815→3文件), user.go(704→2文件) 前端组件拆分: - SystemManager(1782→569), AlertManager(1133→220), K8sClusters(1062→4文件) - Dashboard(941→4文件), ServerManager(905→640), ApprovalFlow(830→548) - AlertCenter(775→693), AIPredictiveAnalytics(760→670) - CloudBilling(728→663), GrafanaDashboard(717→643), sidebar(726→689) Mock 数据模块化: - mocks/data.ts(2552行→barrel+11个domain模块) 新增 CLAUDE.md 项目全局开发规范 修复: AlertCenter/LogManager ListResponse.data→.list 类型不匹配 验证: go build ✅ + tsc --noEmit ✅ + npm run build ✅
This commit is contained in:
1 parent
e8dbe65955
commit
73b5a48df9
37 files changed
+5148
-5237
No files matched your search
@@ -0,0 +1,118 @@
|
||||
import type {
|
||||
Server,
|
||||
K8sCluster,
|
||||
K8sNode,
|
||||
K8sPod,
|
||||
AlertRule,
|
||||
AlertEvent,
|
||||
Ticket,
|
||||
ApprovalFlow,
|
||||
ApprovalInstance,
|
||||
AppRelease,
|
||||
User,
|
||||
Role,
|
||||
OperationLog,
|
||||
CronJob,
|
||||
Script,
|
||||
DashboardData,
|
||||
ResourceModel,
|
||||
ModelInstance,
|
||||
Cabinet,
|
||||
Device,
|
||||
TopologyNode,
|
||||
TopologyEdge,
|
||||
MetricData,
|
||||
LogEntry,
|
||||
} from '@/types';
|
||||
|
||||
// 仪表盘数据
|
||||
|
||||
export const pipelines = [
|
||||
{ id: 'pipe-001', name: 'user-service-pipeline', description: '用户服务CI/CD流水线', template: 'nodejs', stages: [{ name: '检出代码', status: 'success', duration: 15 }, { name: '构建', status: 'success', duration: 120 }, { name: '单元测试', status: 'success', duration: 60 }], createdAt: '2025-03-01', lastRun: '2025-04-14 10:00:00' },
|
||||
{ id: 'pipe-002', name: 'order-service-pipeline', description: '订单服务CI/CD流水线', template: 'java', stages: [{ name: '检出代码', status: 'success', duration: 12 }, { name: '编译', status: 'success', duration: 180 }, { name: '集成测试', status: 'running', duration: 0 }], createdAt: '2025-03-05', lastRun: '2025-04-14 11:00:00' }
|
||||
];
|
||||
|
||||
export const pipelineExecutions = [
|
||||
{ id: 'exec-001', pipelineId: 'pipe-001', pipelineName: 'user-service-pipeline', status: 'success', branch: 'main', commitId: 'a1b2c3d', triggeredBy: '张工程师', startedAt: '2025-04-14 10:00:00', duration: 510 },
|
||||
{ id: 'exec-002', pipelineId: 'pipe-001', pipelineName: 'user-service-pipeline', status: 'failed', branch: 'feature/new-ui', commitId: 'e4f5g6h', triggeredBy: '王开发', startedAt: '2025-04-14 09:00:00', duration: 245 },
|
||||
{ id: 'exec-003', pipelineId: 'pipe-002', pipelineName: 'order-service-pipeline', status: 'running', branch: 'main', commitId: 'i7j8k9l', triggeredBy: '李运维', startedAt: '2025-04-14 11:00:00', duration: 0 }
|
||||
];
|
||||
|
||||
// ============ 发布数据 ============
|
||||
export const appReleases: AppRelease[] = [
|
||||
{
|
||||
id: 'release-001',
|
||||
appName: '用户中心服务',
|
||||
version: 'v2.5.1',
|
||||
environment: 'prod',
|
||||
status: 'success',
|
||||
pipeline: 'user-service-pipeline',
|
||||
commitId: 'a1b2c3d',
|
||||
branch: 'main',
|
||||
deployer: 'user-002',
|
||||
startedAt: '2025-03-30T06:00:00Z',
|
||||
completedAt: '2025-03-30T06:15:00Z',
|
||||
duration: 900,
|
||||
},
|
||||
{
|
||||
id: 'release-002',
|
||||
appName: '订单服务',
|
||||
version: 'v3.2.0',
|
||||
environment: 'staging',
|
||||
status: 'deploying',
|
||||
pipeline: 'order-service-pipeline',
|
||||
commitId: 'e4f5g6h',
|
||||
branch: 'release/v3.2.0',
|
||||
deployer: 'user-002',
|
||||
startedAt: '2025-03-30T10:00:00Z',
|
||||
},
|
||||
{
|
||||
id: 'release-003',
|
||||
appName: '支付网关',
|
||||
version: 'v1.8.5',
|
||||
environment: 'prod',
|
||||
status: 'failed',
|
||||
pipeline: 'payment-gateway-pipeline',
|
||||
commitId: 'i7j8k9l',
|
||||
branch: 'hotfix/payment-bug',
|
||||
deployer: 'user-003',
|
||||
startedAt: '2025-03-29T20:00:00Z',
|
||||
completedAt: '2025-03-29T20:05:00Z',
|
||||
duration: 300,
|
||||
},
|
||||
{
|
||||
id: 'release-004',
|
||||
appName: '消息推送服务',
|
||||
version: 'v2.1.0',
|
||||
environment: 'prod',
|
||||
status: 'rolled_back',
|
||||
pipeline: 'notification-service-pipeline',
|
||||
commitId: 'm0n1o2p',
|
||||
branch: 'main',
|
||||
deployer: 'user-002',
|
||||
startedAt: '2025-03-28T14:00:00Z',
|
||||
completedAt: '2025-03-28T14:30:00Z',
|
||||
duration: 1800,
|
||||
},
|
||||
{
|
||||
id: 'release-005',
|
||||
appName: '数据分析平台',
|
||||
version: 'v4.0.0-beta',
|
||||
environment: 'test',
|
||||
status: 'building',
|
||||
pipeline: 'analytics-platform-pipeline',
|
||||
commitId: 'q3r4s5t',
|
||||
branch: 'feature/new-dashboard',
|
||||
deployer: 'user-004',
|
||||
startedAt: '2025-03-30T09:30:00Z',
|
||||
},
|
||||
];
|
||||
|
||||
// 用户数据
|
||||
export const releases = [
|
||||
{ id: 'rel-001', appName: '用户中心服务', version: 'v2.5.1', environment: 'prod', status: 'success', pipeline: 'user-service-pipeline', commitId: 'a1b2c3d', branch: 'main', deployer: '张工程师', startedAt: '2025-04-14 06:00:00', completedAt: '2025-04-14 06:15:00', duration: 900 },
|
||||
{ id: 'rel-002', appName: '订单服务', version: 'v3.2.0', environment: 'staging', status: 'deploying', pipeline: 'order-service-pipeline', commitId: 'e4f5g6h', branch: 'release/v3.2.0', deployer: '李运维', startedAt: '2025-04-14 10:00:00' },
|
||||
{ id: 'rel-003', appName: '支付网关', version: 'v1.8.5', environment: 'prod', status: 'failed', pipeline: 'payment-gateway-pipeline', commitId: 'i7j8k9l', branch: 'hotfix/payment-bug', deployer: '张工程师', startedAt: '2025-04-13 20:00:00', completedAt: '2025-04-13 20:05:00', duration: 300 }
|
||||
];
|
||||
|
||||
// ============ 定时任务数据 ============
|
||||
Reference in new issue
Block a user