Files
aiops/frontend/src/pages/ApprovalResourcePage.tsx
T
attacker 77c234b060 feat(audit): F1+F2 告警静默规则标记完成 + 审计日志CSV导出实现
F1 告警静默规则 [done]:
- 后端 alert_silence.go: CRUD + Toggle (onetime/daily/weekly 三模式)
- 告警引擎 isSilenced 集成 (alert_engine.go)
- 前端 SilenceRuleTab + SilenceDialog
- 路由 /alerts/silences 已注册

F2 审计日志导出 [done]:
- 重写 ExportAuditLogs: 真正的 CSV 导出 (encoding/csv + UTF-8 BOM)
- 支持 module/action/username/startTime/endTime 筛选
- 导出限制 10000 条防溢出,自动记录审计日志
- JSON 格式向后兼容 (format=json)
- 前端 exportLogs 传递查询参数

同时包含累积的前期工作:
- 目录重构 internal/ -> controller/model/router (v0.55-v0.57)
- 后端分层架构 dto/repository/service/utils
- 审计模块全功能 (终端审计/操作审计/登录日志)
- asciicast v2 录制格式
- SFTP 文件浏览器
- StatStrip 紧凑统计条
- 在线会话自动刷新
- LiveMonitor WebSocket 诊断修复

验证: go build ✅ | npm run build ✅ | Docker 部署 ✅ | 10 回归端点 ✅ | CSV 导出 ✅ | 静默 CRUD ✅
2026-06-25 20:16:30 +08:00

25 lines
1.2 KiB
TypeScript

// 资源申请子页面 — 云服务器、存储、网络等资源申请
import { ApprovalCategoryPage, type FormField } from './ApprovalCategoryPage';
const RESOURCE_FIELDS: FormField[] = [
{ key: 'provider', label: '云厂商', type: 'select', options: ['阿里云', '腾讯云', '华为云', 'AWS'], required: true },
{ key: 'region', label: '地域', type: 'text', placeholder: '如 cn-hangzhou', required: true },
{ key: 'spec', label: '规格', type: 'select', options: ['2C4G', '4C8G', '8C16G', '16C32G', '32C64G'], required: true },
{ key: 'disk', label: '系统盘(GB)', type: 'number', defaultValue: 40, required: true },
{ key: 'count', label: '数量(台)', type: 'number', defaultValue: 1, required: true },
{ key: 'duration', label: '时长', type: 'select', options: ['1个月', '3个月', '6个月', '1年'], required: true },
{ key: 'purpose', label: '用途说明', type: 'textarea', required: true },
];
export function ApprovalResourcePage() {
return (
<ApprovalCategoryPage
category="resource"
title="资源申请"
description="申请云服务器、存储、网络等基础设施资源"
fields={RESOURCE_FIELDS}
templateCode="server_apply"
/>
);
}