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 Z,j as e,r as a,D as ee,b as se,c as le,d as oe,e as te,I as j,f as ce,B as m,L as R,a as ye,T as De,J as M}from"./index-DfyorCky.js";import{L as r}from"./label-BK0h2apY.js";import{C as A,a as V}from"./card-C55cvSHg.js";import{B as Re}from"./badge-xNW8x0G1.js";import{S as ne}from"./switch-CGiGgOnh.js";import{S as w,a as S,b as k,c as _,d as h}from"./select-D5qUzdAs.js";import{t as p}from"./index-a3ybMjbR.js";import{b as g}from"./cloud-Dzoer-2i.js";import{T as ae}from"./trending-up-CdusV6gc.js";import{T as we}from"./trending-down-BGTWG_dA.js";import{R as J}from"./refresh-cw-DUB_tAG-.js";import{P as U}from"./plus-CUG-9kpu.js";import{P as G}from"./pencil-BqUotcjf.js";import{T as K}from"./trash-2-Dx32pOzT.js";import"./index-CWVNW_qu.js";const Se=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],ke=Z("calendar-days",Se);const _e=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Q=Z("wallet",_e),v={aliyun:"阿里云",tencent:"腾讯云",aws:"AWS",huawei:"华为云",azure:"Azure"},O={aliyun:"bg-orange-500",tencent:"bg-blue-500",aws:"bg-amber-500",huawei:"bg-red-500",azure:"bg-sky-500"};function u(d){return`¥${d.toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function E({icon:d,label:i,value:t,trend:c,trendLabel:o,alert:n}){return e.jsxs("div",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:35:5",className:`rounded-lg border p-4 ${n?"border-amber-500/30 bg-amber-500/5":"border-slate-800 bg-slate-900/50"}`,children:[e.jsxs("div",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:36:7",className:"flex items-center justify-between mb-2",children:[e.jsx("span",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:37:9",className:"text-slate-400 text-sm",children:i}),e.jsx("span",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:38:9",className:n?"text-amber-400":"text-slate-500",children:d})]}),e.jsx("div",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:40:7",className:`text-2xl font-bold ${n?"text-amber-300":"text-slate-100"}`,children:t}),o&&e.jsxs("div",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:42:9",className:"flex items-center gap-1 mt-1 text-xs",children:[c!==void 0&&c>0&&e.jsx(ae,{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:43:48",className:"h-3 w-3 text-red-400"}),c!==void 0&&c<0&&e.jsx(we,{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:44:48",className:"h-3 w-3 text-green-400"}),e.jsx("span",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:45:11",className:"text-slate-500",children:o})]})]})}function He({data:d}){if(d.length===0)return e.jsx("p",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:54:12",className:"text-sm text-slate-500 py-8 text-center",children:"暂无数据"});const i=Math.max(...d.map(c=>c.cost),1),t=d.slice(-30);return e.jsxs("div",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:60:5",children:[e.jsx("div",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:61:7",className:"flex items-end gap-0.5 h-40",children:t.map((c,o)=>{const n=Math.max(c.cost/i*100,2);return e.jsxs("div",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:65:13",className:"flex-1 group relative",style:{height:"100%"},children:[e.jsx("div",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:70:15",className:"absolute bottom-0 w-full rounded-t-sm bg-gradient-to-t from-blue-600/60 to-blue-400/80 group-hover:from-blue-500 group-hover:to-blue-300 transition-colors",style:{height:`${n}%`}}),e.jsxs("div",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:74:15",className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 hidden group-hover:block whitespace-nowrap text-xs bg-slate-800 text-slate-200 px-2 py-1 rounded border border-slate-700 z-10",children:[c.date,": ",u(c.cost)]})]},o)})}),e.jsxs("div",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:81:7",className:"flex justify-between mt-2 text-xs text-slate-500",children:[e.jsx("span",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:82:9",children:t[0]?.date}),e.jsx("span",{"code-path":"src/components/cloud/CloudBillingHelpers.tsx:83:9",children:t[t.length-1]?.date})]})]})}const X={provider:"aliyun",billing_date:"",cost:"",service:"",region:"",account_name:"",description:""};function ze({open:d,onOpenChange:i,editingRecord:t,onSuccess:c}){const[o,n]=a.useState(X),[B,C]=a.useState(!1);a.useEffect(()=>{d&&n(t?{provider:t.provider,billing_date:t.billing_date,cost:tLine truncated
|
||||
Reference in new issue
Block a user