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 ✅
This commit is contained in:
1 parent
e57718998a
commit
77c234b060
314 files changed
+10050
-4065
No files matched your search
@@ -0,0 +1 @@
|
||||
import{g as Qe,j as e,w as Ze,T as te,$ as De,a3 as re,a8 as Xe,D as q,b as B,c as P,d as U,e as V,f as le,B as a,a9 as be,n as Ke,r as o,I as T,a as Ye,S as et,U as tt,a7 as rt}from"./index-DfyorCky.js";import{B as u}from"./badge-xNW8x0G1.js";import{C as y,a as w,b as Ne,c as ye}from"./card-C55cvSHg.js";import{S as ne,a as se,b as oe,c as ce,d as v}from"./select-D5qUzdAs.js";import{T as nt,a as st,b as M,c as F}from"./tabs-CIh_yD4s.js";import{S as ot}from"./switch-CGiGgOnh.js";import{t as m}from"./index-a3ybMjbR.js";import{a as D,b as z}from"./monitor-BAaBXIsC.js";import{a as K}from"./agent-DqqIRCQX.js";import{Z as ke}from"./zap-D2uWSK32.js";import{L as h}from"./label-BK0h2apY.js";import{A as ct}from"./AlertRuleDialog-DnF-_Zoj.js";import{T as at}from"./textarea-NXY8u32k.js";import{R as Y}from"./refresh-cw-DUB_tAG-.js";import{P as ee}from"./plus-CUG-9kpu.js";import"./index-CWVNW_qu.js";import"./message-square-DyxabBvb.js";import"./phone-DgvWDdJl.js";const lt=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],Se=Qe("volume-x",lt);function it(r){return{id:String(r.id),title:r.rule_name||r.title||`告警 #${r.id}`,description:r.message||r.description||"",severity:r.severity||"info",status:r.status||"firing",source:r.target||r.source||"",service:r.service||"",metric:r.metric||"",value:r.value||0,threshold:r.threshold||0,startedAt:r.started_at||r.startedAt||r.created_at||new Date().toISOString(),resolvedAt:r.resolved_at||r.resolvedAt,labels:typeof r.labels=="string"?(()=>{try{return JSON.parse(r.labels||"{}")}catch{return{}}})():r.labels||{},annotations:typeof r.annotations=="string"?(()=>{try{return JSON.parse(r.annotations||"{}")}catch{return{}}})():r.annotations||{}}}function ae(r){switch(r){case"critical":return e.jsxs(u,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:106:14",variant:"destructive",className:"gap-1",children:[e.jsx(De,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:106:61",className:"w-3 h-3"}),"严重"]});case"warning":return e.jsxs(u,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:108:14",variant:"default",className:"bg-orange-500 gap-1",children:[e.jsx(te,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:108:71",className:"w-3 h-3"}),"警告"]});case"info":return e.jsxs(u,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:110:14",variant:"default",className:"bg-blue-500 gap-1",children:[e.jsx(Ze,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:110:69",className:"w-3 h-3"}),"信息"]});default:return e.jsx(u,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:112:14",variant:"secondary",children:"未知"})}}function mt(r){switch(r){case"firing":return e.jsxs(u,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:120:14",variant:"destructive",className:"gap-1 animate-pulse",children:[e.jsx(ke,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:120:75",className:"w-3 h-3"}),"触发中"]});case"acknowledged":return e.jsxs(u,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:122:14",variant:"default",className:"bg-yellow-500 gap-1",children:[e.jsx(Xe,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:122:71",className:"w-3 h-3"}),"已确认"]});case"resolved":return e.jsxs(u,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:124:14",variant:"default",className:"bg-green-500 gap-1",children:[e.jsx(re,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:124:70",className:"w-3 h-3"}),"已解决"]});case"suppressed":return e.jsxs(u,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:126:14",variant:"secondary",className:"gap-1",children:[e.jsx(Se,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:126:59",className:"w-3 h-3"}),"已静默"]});default:return e.jsx(u,{"code-path":"src/components/monitor/alert-center/alert-center-helpers.tsx:128:14",variant:"secondary",children:"未知"})}}function dt(r){return{dingtalk:"钉钉",wechat:"企业微信",feishu:"飞书",email:"邮件",sms:"短信",webhook:"Webhook"}[r]||r}function pt({alert:r,open:C,onOpenChange:c,onAcknowledge:A}){return e.jsx(q,{"code-path":"src/components/monitor/alert-center/AlertCenterDetail.tsx:22:5",open:C,onOpenChange:c,children:e.jsxs(B,{"code-path":"src/components/monitor/alert-center/AlertCenterDetail.tsx:23:7",className:"max-w-3xl",children:[e.jsxs(P,{"code-path":"src/components/monitor/alert-center/AlertCenterDetail.tsx:24:9",children:[e.jsxs(U,{"code-path":"src/components/monitor/alert-center/AlertCenterDetail.tsx:Line truncated
|
||||
Reference in new issue
Block a user