chore: 重新编译前端产物(补装CodeMirror依赖)

This commit is contained in:
attacker committed 2026-06-26 23:29:08 +08:00
1 parent 23e9e3da62
commit 4e384ca401
115 files changed
+147 -147

No files matched your search

@@ -0,0 +1,14 @@
import{j as e,r as x}from"./vendor-codemirror-B1SGo4xl.js";import{D as v,a as k,b as w,c as S,d as _,e as C,B as A}from"./index-Dungj95X.js";import{I as h}from"./input-CXoUQQLm.js";import{L as c}from"./label-CMpUoC87.js";import{T as L}from"./textarea-BxfjmLq5.js";import{S as E}from"./switch-Bxiq4EHp.js";import{a as j}from"./alert-v1WaPeEX.js";import{t as F,ap as P,aq as I,ar as q,L as B}from"./vendor-icons-DmqcWdzX.js";function b(o){if(!o)return[];if(Array.isArray(o))return o;if(typeof o=="string"){try{const r=JSON.parse(o);if(Array.isArray(r))return r}catch{}return o.split(",").map(r=>r.trim()).filter(Boolean)}return[]}const T=["email","sms","dingtalk","wechat","webhook"],H={dingtalk:"钉钉",wechat:"企业微信",email:"邮件",sms:"短信",webhook:"Webhook"};function z(o,r){if(!o)return null;const a=r.find(i=>String(i.id)===String(o));return a?{type:a.type||"unknown",name:a.name||a.type||"未命名",isLegacy:!1}:T.includes(o)?{type:o,name:H[o]||o,isLegacy:!0}:null}const W=[{key:"dingtalk",label:"钉钉",placeholder:`{
"webhook": "https://oapi.dingtalk.com/robot/send?access_token=***",
"secret": "SECxxx"
}`},{key:"wechat",label:"企业微信",placeholder:`{
"webhook": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=***"
}`},{key:"email",label:"邮件",placeholder:`{
"to": "ops@ezops.io",
"subject": "告警通知"
}`},{key:"sms",label:"短信",placeholder:`{
"phones": "13800138000",
"sign": "AIOps"
}`},{key:"webhook",label:"Webhook",placeholder:`{
"url": "https://example.com/alert"
}`}];function y(o){return W.find(r=>r.key===o)?.label||o}function f(o){switch(o){case"email":return q;case"sms":return I;case"dingtalk":case"wechat":return P;default:return F}}function Z(o,r){const a=b(o.notify_channels);return a.length===0?e.jsx("span",{"code-path":"src/components/monitor/alertShared.tsx:76:33",className:"text-xs text-slate-600",children:"--"}):e.jsx("div",{"code-path":"src/components/monitor/alertShared.tsx:78:5",className:"flex flex-wrap gap-1",children:a.map(i=>{const m=z(i,r);if(!m)return null;const p=f(m.type);return e.jsxs("span",{"code-path":"src/components/monitor/alertShared.tsx:84:11",title:`${m.name} (${y(m.type)})`,className:"inline-flex items-center gap-1 text-xs px-1.5 py-0.5 rounded bg-slate-800 text-slate-300",children:[e.jsx(p,{"code-path":"src/components/monitor/alertShared.tsx:89:13",className:"h-3 w-3 text-slate-400"}),m.name]},i)})})}const D={name:"",description:"",type:"metric",source:"prometheus",expression:"",severity:"warning",duration:300,notify_channels:[]};function G({open:o,onOpenChange:r,editingRule:a,notifyChannels:i,onSaved:m,defaultType:p="metric"}){const[s,l]=x.useState({...D}),[u,g]=x.useState(!1);x.useEffect(()=>{if(o)if(a)l({name:a.name||"",description:a.description||"",type:a.type||"metric",source:a.source||"prometheus",expression:a.expression||"",severity:a.severity||"warning",duration:a.duration||300,notify_channels:b(a.notify_channels)});else{const t={...D,type:p};p==="log"&&(t.source="loki"),l(t)}},[o,a,p]);const N=t=>{l(n=>({...n,notify_channels:n.notify_channels.includes(t)?n.notify_channels.filter(d=>d!==t):[...n.notify_channels,t]}))},R=async()=>{if(!(!s.name.trim()||!s.expression.trim())){g(!0);try{const t={name:s.name.trim(),description:s.description.trim(),type:s.type,source:s.source,expression:s.expression.trim(),severity:s.severity,duration:Number(s.duration)||0,notify_channels:s.notify_channels};a?await j.updateRule(a.id,t):await j.createRule(t),r(!1),m()}catch(t){console.error("Failed to save rule:",t)}finally{g(!1)}}};return e.jsx(v,{"code-path":"src/components/monitor/AlertRuleDialog.tsx:111:5",open:o,onOpenChange:r,children:e.jsxs(k,{"code-path":"src/components/monitor/AlertRuleDialog.tsx:112:7",className:"bg-slate-900 border-slate-700 text-slate-100 max-w-lg",children:[e.jsxs(w,{"code-path":"src/components/monitor/AlertRuleDialog.tsx:113:9",children:[e.jsx(S,{"code-path":"src/components/monitor/AlertRuleDialog.tsx:114:11",className:"text-slate-100",children:a?"编辑告警规则":"新建告警规则"}),e.jsx(_,{"code-path":"src/components/monitor/AlertRuleDialog.tsx:117:11",className:"text-slate-500",children:a?"修改告警规则的触发条件和通知方式":"配置监控指标的告警触发条件"})]}),e.jsxs("div",{"code-path":"src/components/monitor/AlertRuleDialog.tsx:122:9",className:"space-y-4 max-h-[60vh] overflow-y-auto pr-1",children:[e.jsxs("div",{"code-path":"src/components/monitor/AlertRuleDialog.tsx:123:11",className:"space-y-1.5",children:[e.jsxs(c,{"code-path":"src/components/monitor/AlertRuleDialog.tsx:124:13",className:"text-slate-300",children:["规则名称 ",e.jsx("span",{"code-path":"src/components/monitor/AlertRuleDialog.tsx:124:52",className:"text-red-400",children:"*"})]}),e.jsx(h,{"code-path":"src/components/monitor/AlertRuleDialog.tsx:125:13",value:s.name,onChange:t=>l({...s,name:t.target.value}),placeholder:"如:CPU 使用率告警",className:"bg-slate-800/50 border-slate-700 text-slate-200 placeholder:text-slate-600"})]}),e.jsxs("div",{"code-path":"src/components/monitor/AlertRuleDialog.tsx:133:11",className:"space-y-1.5",children:[e.jsx(c,{"code-path":"src/components/monitor/AlertRuleDialog.tsx:134:13",className:"text-slate-300",children:"描述"}),e.jsx(L,{"code-path":"src/components/monitor/AlertRuleDialog.tsx:135:13",value:s.description,onChange:t=>l({...s,description:t.target.value}),placeholder:"规则说明",rows:2,className:"bg-slate-800/50 border-slate-700 text-slate-200 placeholder:text-slate-600 resize-none"})]}),e.jsxs("div",{"code-path":"src/components/monitor/AlertRuleDialog.tsx:144:11",className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{"code-path":"src/components/monitor/AlertRuleDialog.tsx:145:13",className:"space-y-1.5",children:[e.jsx(c,{"code-path":"src/components/monitor/AlertRuleDialog.tsx:146:15",className:"text-slate-300",children:"规则类型"}),e.jsxs("select",{"code-path":"src/components/monitor/AlertRuleDialog.tsx:147:15",value:s.type,onChange:t=>{const n=t.target.value;l({...s,type:n,source:n==="log"?"loki":"prometheus"})},className:"w-full h-9 px-3 rounded-md bg-slate-800/50 border border-slate-700 text-slate-200 text-sm",children:[e.jsx("option",{"code-path":"src/components/monitor/AlertRuleDialog.tsx:156:17",value:"metric",children:"指标监控"}),e.jsx("option",{"code-path":"src/components/monitor/AlertRuleDialog.tsx:157:17",value:"log",children:"日志告警"}),e.jsx("option",{"code-path":"src/components/monitor/AlertRuleDialog.tsx:158:17",value:"event",chi Line truncated