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:
attacker committed 2026-06-25 20:16:30 +08:00
1 parent e57718998a
commit 77c234b060
314 files changed
+10050 -4065

No files matched your search

@@ -0,0 +1 @@
import{g as bs,j as e,L as w,a3 as B,r as n,a as Js,k as Hs,h as fe,B as p,x as W,a0 as E,a7 as I,q as ye,v as ne,N as ue,S as Qs,I as g,O as ve,a4 as Ks,n as be,D as ds,b as ps,c as is,d as xs}from"./index-DfyorCky.js";import{C as ms,a as hs}from"./card-C55cvSHg.js";import{B as y}from"./badge-xNW8x0G1.js";import{T as Us}from"./textarea-NXY8u32k.js";import{L as d}from"./label-BK0h2apY.js";import{S as Z,a as ee,b as se,c as ae,d as v}from"./select-D5qUzdAs.js";import{d as je,p as P}from"./deploy-B3Sg3N1U.js";import{t as x}from"./index-a3ybMjbR.js";import{C as D}from"./circle-x-DK79Dhg2.js";import{P as Pe}from"./plus-CUG-9kpu.js";import{A as R}from"./arrow-right-DyIltvNZ.js";import{L as Xs}from"./layers-FW4KKJMi.js";import{S as js}from"./shield-check-Dcx486cW.js";import{C as Ys}from"./code-L62jFLTC.js";import{C as Me}from"./circle-stop-s4wxdTEV.js";import{P as Zs}from"./play-cdPayOtJ.js";import{H as ea}from"./history-D_9jPUQg.js";import{T as gs}from"./trash-2-Dx32pOzT.js";import{B as sa}from"./box-TTGA1p57.js";import{T as ys}from"./tag-0HCfq8kH.js";import{F as us}from"./file-text-C9G5abwR.js";import"./index-CWVNW_qu.js";const aa=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],ta=bs("package",aa);const na=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],vs=bs("workflow",na);function oa(c){return c.toLowerCase().replace(/[^a-z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||`pipeline-${Date.now()}`}function ca(c){switch(c){case"success":return e.jsxs(y,{"code-path":"src/components/deploy/pipeline-helpers.tsx:49:9",variant:"outline",className:"border-emerald-500/30 text-emerald-400 bg-emerald-500/10",children:[e.jsx(B,{"code-path":"src/components/deploy/pipeline-helpers.tsx:50:11",className:"h-3 w-3 mr-1"}),"成功"]});case"failed":return e.jsxs(y,{"code-path":"src/components/deploy/pipeline-helpers.tsx:56:9",variant:"outline",className:"border-red-500/30 text-red-400 bg-red-500/10",children:[e.jsx(D,{"code-path":"src/components/deploy/pipeline-helpers.tsx:57:11",className:"h-3 w-3 mr-1"}),"失败"]});case"running":return e.jsxs(y,{"code-path":"src/components/deploy/pipeline-helpers.tsx:63:9",variant:"outline",className:"border-blue-500/30 text-blue-400 bg-blue-500/10 animate-pulse",children:[e.jsx(w,{"code-path":"src/components/deploy/pipeline-helpers.tsx:64:11",className:"h-3 w-3 mr-1 animate-spin"}),"运行中"]});default:return e.jsx(y,{"code-path":"src/components/deploy/pipeline-helpers.tsx:70:9",variant:"outline",className:"border-[var(--dg-border)] text-[var(--dg-text-secondary)]",children:"从未运行"})}}const te=[{key:"checkout",label:"代码检出",icon:E,color:"#6366F1",order:1,needs:["repo"],desc:"从 Git 仓库拉取代码"},{key:"build",label:"构建",icon:sa,color:"#F59E0B",order:2,needs:[],desc:"编译/打包项目"},{key:"test",label:"测试",icon:B,color:"#10B981",order:3,needs:[],desc:"运行单元/集成测试"},{key:"image",label:"镜像打包",icon:ne,color:"#06B6D4",order:4,needs:["registry"],desc:"Docker 构建 & 推送"},{key:"deploy",label:"部署",icon:I,color:"#EF4444",order:5,needs:[],desc:"部署到目标环境"},{key:"verify",label:"验证",icon:js,color:"#3B82F6",order:6,needs:[],desc:"部署后健康检查"}].sort((c,b)=>c.order-b.order);function Ne(c){if(!c)return"-";if(c<60)return`${c}s`;const b=Math.floor(c/60),i=c%60;return i>0?`${b}分${i}秒`:`${b}分`}function ra(c){if(!c)return[];try{const b=typeof c=="string"?JSON.parse(c):c;return Array.isArray(b)?b:[]}catch{return[]}}function La(){const[c,b]=n.useState(""),[i,q]=n.useState([]),[J,L]=n.useState(!0),[M,k]=n.useState({}),[H,T]=n.useState({}),[N,A]=n.useState({}),[F,$]=n.useState("all"),[r,we]=n.useState({}),[Ps,z]=n.useState(!1),[Q,ke]=n.useState(""),[_,_e]=n.useState(""),[Ce,Se]=n.useState(""),[oe,Re]=n.useState(""),[Ee,Be]=n.useState("main"),[De,Le]=n.useState(""),[m,Te]=n.useState(["checkout","build","image","deploy"]),[,Ms]=n.useState(""),[,Ns]=n.useState(""),[ce,Ae]=n.useState("branch"),[Fe,$e]=n.useState("ssh"),[re,ze]=n.useState(""),[le,Oe]=n.useState(!1),[fs,ws]=n.useState([]),[ks,_s]=n.useState([]),[K,Ve]=n.useState(""),[C,Ge]=n.useState(""),[O,Ie]=n.useState("manual"),[We,qe]=n.useState(""),[Je,He]=n.useState(""),[Qe,de]=n.useState(""),[Ke,Ue]=n.useState(""),[j,S]=n.useState([]),[Xe,Ye]=n.useState(""),[Ze,Cs]=n.useState(2),[,Ss]=n.useState([]),[,Rs]=n.useState([]),[Es,Bs]=n.useState([]),[,da]=n.useState([]),[,pa]=n.useState([]),[Ds,es]=n.useState(!1),[V,Ls]=n.useState(null),[ss,as]=n.useState([]),ts=Js(),ns=Hs(),Ts=[{key:"all",label:"全部",icon:Xs,color:"#6B7280"},{key:"production",label:"生产",icon:js,color:"#EF4444"},{key:"testLine truncated