import{j as e,r as g}from"./vendor-codemirror-C7mXSpXt.js";import{C as F,b as B,c as K,a as z}from"./card-B-RtdR4H.js";import{S as Z}from"./stat-strip-BPzU38xY.js";import{B as q}from"./index-LZWfu62c.js";import{B as G}from"./badge-B0F5ZNtn.js";import{T as J,a as Q,b as D,c as $}from"./tabs-kmtfM2I-.js";import{S as ee,a as se,b as te,c as ae,d as M}from"./select-4xU_9B3_.js";import{d as ce}from"./dashboard-7Sl2aero.js";import{s as ie}from"./server-BUAZv7ZV.js";import{a as H}from"./alert-C4MMKcUL.js";import{H as X,L as _,D as ne,a4 as Y,av as re,aw as oe,A as le,ax as de,u as pe,l as L,aa as W,ay as me,g as xe,az as he,N as ye,s as ve,aA as Ae}from"./vendor-icons-Aso0-eeY.js";import"./index-CYARH0Cq.js";function ue({forecasts:c,loading:i}){return e.jsxs(F,{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:14:5",className:"bg-slate-800 border-slate-700",children:[e.jsx(B,{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:15:7",className:"pb-3",children:e.jsxs("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:16:9",className:"flex items-center justify-between",children:[e.jsxs(K,{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:17:11",className:"text-slate-100 flex items-center gap-2",children:[e.jsx(X,{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:18:13",className:"h-5 w-5 text-amber-400"}),"容量规划预警"]}),e.jsx("span",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:21:11",className:"text-xs text-slate-500",children:"基于日均增长率推算阈值触及时间"})]})}),e.jsx(z,{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:24:7",children:i?e.jsxs("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:26:11",className:"flex items-center justify-center py-12 text-slate-500",children:[e.jsx(_,{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:27:13",className:"h-5 w-5 animate-spin mr-2"})," 加载容量数据..."]}):c.length===0?e.jsx("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:30:11",className:"text-center py-12 text-slate-500",children:"暂无容量数据"}):e.jsx("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:32:11",className:"space-y-4",children:c.map((a,p)=>e.jsxs("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:34:15",className:"p-4 rounded-lg border border-slate-700 bg-slate-800/50",children:[e.jsxs("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:35:17",className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:36:19",className:"flex items-center gap-2",children:[e.jsx(ne,{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:37:21",className:"h-5 w-5 text-blue-400"}),e.jsx("span",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:38:21",className:"font-medium text-slate-200",children:a.resource})]}),e.jsx(G,{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:40:19",variant:"outline",className:a.daysUntilThreshold<=7?"border-red-500/30 text-red-400 bg-red-500/10":a.daysUntilThreshold<=14?"border-amber-500/30 text-amber-400 bg-amber-500/10":"border-emerald-500/30 text-emerald-400 bg-emerald-500/10",children:a.daysUntilThreshold<=7?"紧急":a.daysUntilThreshold<=14?"警告":"正常"})]}),e.jsxs("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:58:17",className:"mb-4",children:[e.jsxs("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:59:19",className:"flex items-center justify-between text-sm mb-1",children:[e.jsx("span",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:60:21",className:"text-slate-400",children:"7天使用率预测"}),e.jsx("span",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:61:21",className:"text-slate-400",children:a.daysUntilThreshold>=999?"增长平缓,暂无触顶风险":e.jsxs(e.Fragment,{children:["预计"," ",e.jsxs("span",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:67:27",className:"text-amber-400 font-medium",children:[a.daysUntilThreshold,"天"]})," ","后达到阈值"]})})]}),e.jsx("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:73:19",className:"h-3 bg-slate-700 rounded-full overflow-hidden",children:e.jsxs("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:74:21",className:"flex h-full",children:[e.jsx("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:75:23",className:"bg-blue-500",style:{width:`${a.currentUsage}%`}}),e.jsx("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:76:23",className:"bg-gradient-to-r from-blue-500/50 to-amber-500",style:{width:`${Math.max(0,a.predictedUsage-a.currentUsage)}%`}})]})}),e.jsxs("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:84:19",className:"flex items-center justify-between text-xs mt-1",children:[e.jsxs("span",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:85:21",className:"text-slate-500",children:["当前 ",a.currentUsage,"%"]}),e.jsxs("span",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:86:21",className:"text-amber-400",children:["预测 ",a.predictedUsage,"%"]}),e.jsxs("span",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:87:21",className:"text-red-400",children:["阈值 ",a.threshold,"%"]})]})]}),e.jsx("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:91:17",className:"p-3 bg-slate-900 rounded-lg border border-slate-700",children:e.jsxs("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:92:19",className:"flex items-start gap-2",children:[e.jsx(Y,{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:93:21",className:"h-4 w-4 text-emerald-400 mt-0.5"}),e.jsxs("div",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:94:21",children:[e.jsx("span",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:95:23",className:"text-sm text-slate-400",children:"AI建议:"}),e.jsx("p",{"code-path":"src/components/aiops/PredictiveCapacityTab.tsx:96:23",className:"text-sm text-slate-300 mt-1",children:a.recommendation})]})]})})]},p))})})]})}const T=[{key:"cpu",label:"CPU使用率",exprKey:"cpu_usage",threshold:85},{key:"memory",label:"内存使用率",exprKey:"memory_usage",threshold:85},{key:"disk",label:"磁盘使用率",exprKey:"disk_usage",threshold:90}],be={"1h":"1小时后","24h":"24小时后","7d":"7天后","30d":"30天后"},je={"1h":1,"24h":24,"7d":168,"30d":720};function R(c){const i=c.length;if(i<2)return{slope:0,r2:0};const a=c.map((r,h)=>h),p=a.reduce((r,h)=>r+h,0)/i,y=c.reduce((r,h)=>r+h,0)/i;let b=0,N=0,I=0,C=0;for(let r=0;ra.name===i).sort((a,p)=>new Date(a.timestamp).getTime()-new Date(p.timestamp).getTime()).map(a=>Number(a.value)||0)}function Pe(c){const i=c.match(/[><=]\s*([\d.]+)/);return i?parseFloat(i[1]):null}function ge(c,i){const a=i<=7?"urgent":i<=14?"warning":"normal";return{urgent:{cpu:"CPU增长趋势明显,建议尽快扩容计算资源或优化高负载进程",memory:"内存增长趋势明显,建议增加内存或排查内存泄漏",disk:"磁盘空间即将耗尽,建议立即扩容或清理历史数据与日志"},warning:{cpu:"CPU使用率呈上升趋势,建议持续监控并准备扩容计划",memory:"内存使用率呈上升趋势,建议优化应用内存使用",disk:"磁盘使用率持续增长,建议规划数据归档和清理策略"},normal:{cpu:"CPU使用正常,建议持续监控",memory:"内存使用正常,建议持续监控",disk:"磁盘空间充足,建议持续监控"}}[a]?.[c]||"建议持续监控资源使用趋势"}function O(c){return{cpu:"检查高负载进程,优化CPU密集型任务,考虑横向扩容",memory:"排查内存泄漏,优化进程内存配置,考虑增加节点",disk:"清理历史数据和日志,实施数据归档策略,扩容磁盘",service:"检查服务健康状态与依赖组件,查看服务日志",pod:"检查Pod重启原因,查看容器日志,排查OOM或健康检查失败"}[c]||"建议检查相关服务状态并持续监控"}function Ne(c){const{rawMetrics:i,serverStats:a,alertEvents:p,alertRules:y,selectedTimeRange:b}=c,N=je[b]||24,I=be[b]||"24小时后",C=T.map(t=>{const n=U(i,t.key),{slope:m,r2:x}=R(n),o=t.key==="cpu"?a.avg_cpu:t.key==="memory"?a.avg_memory:a.avg_disk,l=n.length>0?n[n.length-1]:o||0;let A=l+m*N;A=Math.max(0,Math.min(100,A));const s=m>.05?"up":m<-.05?"down":"stable",d=Math.round(60+x*35);return{name:t.label,current:Math.round(l),predicted:Math.round(A),unit:"%",trend:s,confidence:d,timeRange:I}}),j=T.map(t=>{const n=U(i,t.key),{slope:m}=R(n),x=t.key==="cpu"?a.avg_cpu:t.key==="memory"?a.avg_memory:a.avg_disk,o=Math.round(n.length>0?n[n.length-1]:x||0),l=m*24,A=Math.round(Math.min(100,o+l*7)),s=t.threshold;let d=999;return l>.01&&(d=Math.round((s-o)/l),d=d<1?1:d),{resource:{cpu:"服务器CPU算力",memory:"服务器内存",disk:"存储磁盘空间"}[t.key]||t.label,metricKey:t.key,currentUsage:o,predictedUsage:A,threshold:s,daysUntilThreshold:d,recommendation:ge(t.key,d)}}).filter(t=>t.currentUsage>0),f=[];for(const t of y){if(!t.enabled)continue;const n=Pe(t.expression||""),m=(t.expression||"").toLowerCase(),x=T.find(o=>m.includes(o.exprKey));if(x&&n){const o=U(i,x.key),{slope:l}=R(o),A=x.key==="cpu"?a.avg_cpu:x.key==="memory"?a.avg_memory:a.avg_disk,s=o.length>0?o[o.length-1]:A||0,d=n>0?s/n:0;let u=Math.round(d*55);l>.05&&(u+=15);const S=p.filter(v=>v.rule_id===t.id||v.rule_name===t.name).length;u+=Math.min(20,S*3),u=Math.max(5,Math.min(90,u));let P="未来24小时";if(l>.01&&n>s){const v=(n-s)/l;v<4?P="未来4小时":v<12?P="未来12小时":v<24?P="未来24小时":P=`未来${Math.ceil(v/24)}天`}f.push({metric:t.name,predictedAnomaly:t.description||`${t.name}可能触发`,probability:u,timeframe:P,suggestedAction:O(x.key)})}else{const o=p.filter(l=>l.rule_id===t.id||l.rule_name===t.name).length;if(o>0){const l=m.includes("service")?"service":m.includes("pod")?"pod":"service";f.push({metric:t.name,predictedAnomaly:t.description||`${t.name}可能再次发生`,probability:Math.min(60,20+o*5),timeframe:"未来24小时",suggestedAction:O(l)})}}}const w=f.sort((t,n)=>n.probability-t.probability).filter((t,n,m)=>m.findIndex(x=>x.metric===t.metric)===n),r=T.length>0?T.reduce((t,n)=>t+R(U(i,n.key)).r2,0)/T.length:0,h=Math.round(78+r*17),k=w.filter(t=>t.probability>=50).length,E=j.filter(t=>t.daysUntilThreshold<=14).length;return{predictions:C,capacityForecasts:j,dedupedAnomalies:w,accuracy:h,predictedAlertCount:k,capacityWarningCount:E}}function V(c){switch(c){case"up":return"text-red-400";case"down":return"text-emerald-400";default:return"text-slate-400"}}function De(){const[c,i]=g.useState("24h"),[a,p]=g.useState(!1),[y,b]=g.useState(!0),[N,I]=g.useState([]),[C,j]=g.useState({}),[f,w]=g.useState([]),[r,h]=g.useState([]);g.useEffect(()=>{k()},[]);const k=async()=>{b(!0);try{const[s,d,u,S]=await Promise.all([ce.getMetrics(72),ie.getServerStats(),H.getAlerts({page:1,page_size:100}),H.getRules()]);I(Array.isArray(s)?s:[]),j(d||{});const P=u?.list||u||[];w(Array.isArray(P)?P:[]);const v=S?.list||S||[];h(Array.isArray(v)?v:[])}catch{}finally{b(!1)}},E=async()=>{p(!0),await k(),p(!1)},{predictions:t,capacityForecasts:n,dedupedAnomalies:m,accuracy:x,predictedAlertCount:o,capacityWarningCount:l}=Ne({rawMetrics:N,serverStats:C,alertEvents:f,alertRules:r,selectedTimeRange:c}),A=s=>{switch(s){case"up":return e.jsx(W,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:99:16",className:"h-4 w-4 text-red-400"});case"down":return e.jsx(Ae,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:101:16",className:"h-4 w-4 text-emerald-400"});default:return e.jsx(ve,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:103:16",className:"h-4 w-4 text-slate-400"})}};return e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:108:5",className:"space-y-6",children:[e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:110:7",className:"flex items-center justify-between",children:[e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:111:9",className:"flex items-center gap-3",children:[e.jsx("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:112:11",className:"w-10 h-10 rounded-lg bg-gradient-to-br from-indigo-500 to-purple-500 flex items-center justify-center",children:e.jsx(re,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:113:13",className:"h-5 w-5 text-white"})}),e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:115:11",children:[e.jsx("h1",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:116:13",className:"text-2xl font-bold text-slate-100",children:"AI 预测分析"}),e.jsx("p",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:117:13",className:"text-sm text-slate-500",children:"基于实时指标时序数据的线性回归预测与容量规划"})]})]}),e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:120:9",className:"flex items-center gap-2",children:[e.jsxs(ee,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:121:11",value:c,onValueChange:i,children:[e.jsxs(se,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:122:13",className:"w-32 bg-slate-800 border-slate-700 text-slate-100",children:[e.jsx(oe,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:123:15",className:"h-4 w-4 mr-2"}),e.jsx(te,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:124:15"})]}),e.jsxs(ae,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:126:13",className:"bg-slate-800 border-slate-700",children:[e.jsx(M,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:127:15",value:"1h",children:"1小时"}),e.jsx(M,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:128:15",value:"24h",children:"24小时"}),e.jsx(M,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:129:15",value:"7d",children:"7天"}),e.jsx(M,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:130:15",value:"30d",children:"30天"})]})]}),e.jsx(q,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:133:11",variant:"outline",className:"border-slate-700 text-slate-300",onClick:E,children:a||y?e.jsx(_,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:134:39",className:"h-4 w-4 animate-spin"}):e.jsx(le,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:134:86",className:"h-4 w-4"})})]})]}),e.jsx(Z,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:140:7",items:[{label:"置信度",value:`${x}%`,color:"emerald"},{label:"高风险",value:o,color:"amber"},{label:"容量预警",value:l,color:"red"},{label:"指标",value:t.length,color:"purple"}]}),e.jsxs(J,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:149:7",defaultValue:"metrics",className:"space-y-4",children:[e.jsxs(Q,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:150:9",className:"bg-slate-800 border border-slate-700",children:[e.jsxs(D,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:151:11",value:"metrics",className:"data-[state=active]:bg-slate-700",children:[e.jsx(de,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:152:13",className:"h-4 w-4 mr-2"}),"指标预测"]}),e.jsxs(D,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:155:11",value:"capacity",className:"data-[state=active]:bg-slate-700",children:[e.jsx(pe,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:156:13",className:"h-4 w-4 mr-2"}),"容量规划"]}),e.jsxs(D,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:159:11",value:"anomaly",className:"data-[state=active]:bg-slate-700",children:[e.jsx(L,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:160:13",className:"h-4 w-4 mr-2"}),"异常预测"]})]}),e.jsx($,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:165:9",value:"metrics",className:"space-y-4",children:e.jsxs(F,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:166:11",className:"bg-slate-800 border-slate-700",children:[e.jsx(B,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:167:13",className:"pb-3",children:e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:168:15",className:"flex items-center justify-between",children:[e.jsxs(K,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:169:17",className:"text-slate-100 flex items-center gap-2",children:[e.jsx(W,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:170:19",className:"h-5 w-5 text-blue-400"}),"关键指标预测"]}),e.jsxs(G,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:173:17",variant:"outline",className:"border-purple-500/30 text-purple-400 bg-purple-500/10",children:[e.jsx(me,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:174:19",className:"h-3 w-3 mr-1"}),"线性回归预测"]})]})}),e.jsx(z,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:179:13",children:y?e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:181:17",className:"flex items-center justify-center py-12 text-slate-500",children:[e.jsx(_,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:182:19",className:"h-5 w-5 animate-spin mr-2"})," 加载指标数据..."]}):t.length===0?e.jsx("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:185:17",className:"text-center py-12 text-slate-500",children:"暂无指标数据"}):e.jsx("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:187:17",className:"grid grid-cols-2 gap-4",children:t.map((s,d)=>e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:189:21",className:"p-4 rounded-lg border border-slate-700 bg-slate-800/50",children:[e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:190:23",className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:191:25",className:"flex items-center gap-2",children:[s.name.includes("CPU")&&e.jsx(xe,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:192:63",className:"h-4 w-4 text-blue-400"}),s.name.includes("内存")&&e.jsx(he,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:193:62",className:"h-4 w-4 text-emerald-400"}),s.name.includes("磁盘")&&e.jsx(X,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:194:62",className:"h-4 w-4 text-amber-400"}),s.name.includes("网络")&&e.jsx(ye,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:195:62",className:"h-4 w-4 text-purple-400"}),e.jsx("span",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:196:27",className:"font-medium text-slate-200",children:s.name})]}),e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:198:25",className:"flex items-center gap-1",children:[A(s.trend),e.jsx("span",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:200:27",className:`text-sm ${V(s.trend)}`,children:s.trend==="up"?"上升":s.trend==="down"?"下降":"平稳"})]})]}),e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:206:23",className:"grid grid-cols-2 gap-4 mb-3",children:[e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:207:25",children:[e.jsx("p",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:208:27",className:"text-xs text-slate-500 mb-1",children:"当前值"}),e.jsxs("p",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:209:27",className:"text-lg font-bold text-slate-100",children:[s.current,s.unit]})]}),e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:214:25",children:[e.jsxs("p",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:215:27",className:"text-xs text-slate-500 mb-1",children:["预测值 (",s.timeRange,")"]}),e.jsxs("p",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:216:27",className:`text-lg font-bold ${V(s.trend)}`,children:[s.predicted,s.unit]})]})]}),e.jsx("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:223:23",className:"flex items-center justify-between",children:e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:224:25",className:"flex items-center gap-2",children:[e.jsx("span",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:225:27",className:"text-xs text-slate-400",children:"置信度"}),e.jsx("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:226:27",className:"w-16 h-1.5 bg-slate-700 rounded-full overflow-hidden",children:e.jsx("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:227:29",className:"h-full bg-gradient-to-r from-blue-500 to-purple-500",style:{width:`${s.confidence}%`}})}),e.jsxs("span",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:232:27",className:"text-xs text-purple-400",children:[s.confidence,"%"]})]})})]},d))})})]})}),e.jsx($,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:243:9",value:"capacity",className:"space-y-4",children:e.jsx(ue,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:244:11",forecasts:n,loading:y})}),e.jsx($,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:247:9",value:"anomaly",className:"space-y-4",children:e.jsxs(F,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:248:11",className:"bg-slate-800 border-slate-700",children:[e.jsx(B,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:249:13",className:"pb-3",children:e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:250:15",className:"flex items-center justify-between",children:[e.jsxs(K,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:251:17",className:"text-slate-100 flex items-center gap-2",children:[e.jsx(L,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:252:19",className:"h-5 w-5 text-red-400"}),"异常事件预测"]}),e.jsx("span",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:255:17",className:"text-xs text-slate-500",children:"基于告警规则阈值与实时趋势概率推算"})]})}),e.jsx(z,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:258:13",children:y?e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:260:17",className:"flex items-center justify-center py-12 text-slate-500",children:[e.jsx(_,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:261:19",className:"h-5 w-5 animate-spin mr-2"})," 加载异常预测..."]}):m.length===0?e.jsx("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:264:17",className:"text-center py-12 text-slate-500",children:"暂无异常预测数据"}):e.jsx("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:266:17",className:"space-y-3",children:m.map((s,d)=>e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:268:21",className:"p-4 rounded-lg border border-slate-700 bg-slate-800/50",children:[e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:269:23",className:"flex items-start justify-between",children:[e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:270:25",className:"flex items-start gap-3",children:[e.jsx("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:271:27",className:`w-10 h-10 rounded-lg flex items-center justify-center ${s.probability>=70?"bg-red-500/20":s.probability>=50?"bg-amber-500/20":"bg-blue-500/20"}`,children:e.jsx(L,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:280:29",className:`h-5 w-5 ${s.probability>=70?"text-red-400":s.probability>=50?"text-amber-400":"text-blue-400"}`})}),e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:290:27",children:[e.jsx("h4",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:291:29",className:"font-medium text-slate-200",children:s.metric}),e.jsx("p",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:292:29",className:"text-sm text-slate-400 mt-1",children:s.predictedAnomaly}),e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:293:29",className:"flex items-center gap-4 mt-2",children:[e.jsx("span",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:294:31",className:"text-xs text-slate-500",children:s.timeframe}),e.jsxs("span",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:295:31",className:"text-xs text-slate-500",children:["概率:"," ",e.jsxs("span",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:297:33",className:s.probability>=70?"text-red-400":"text-amber-400",children:[s.probability,"%"]})]})]})]})]}),e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:304:25",className:"w-16 h-16 relative shrink-0",children:[e.jsxs("svg",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:305:27",className:"w-full h-full transform -rotate-90",children:[e.jsx("circle",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:306:29",cx:"32",cy:"32",r:"28",stroke:"currentColor",strokeWidth:"4",fill:"transparent",className:"text-slate-700"}),e.jsx("circle",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:315:29",cx:"32",cy:"32",r:"28",stroke:"currentColor",strokeWidth:"4",fill:"transparent",strokeDasharray:`${s.probability*1.76} 176`,className:s.probability>=70?"text-red-400":s.probability>=50?"text-amber-400":"text-blue-400"})]}),e.jsx("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:332:27",className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("span",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:333:29",className:"text-sm font-bold text-slate-200",children:[s.probability,"%"]})})]})]}),e.jsx("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:337:23",className:"mt-3 p-3 bg-slate-900 rounded-lg border border-slate-700",children:e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:338:25",className:"flex items-start gap-2",children:[e.jsx(Y,{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:339:27",className:"h-4 w-4 text-emerald-400 mt-0.5"}),e.jsxs("div",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:340:27",children:[e.jsx("span",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:341:29",className:"text-sm text-slate-400",children:"建议操作:"}),e.jsx("p",{"code-path":"src/components/aiops/AIPredictiveAnalytics.tsx:342:29",className:"text-sm text-slate-300 mt-1",children:s.suggestedAction})]})]})})]},d))})})]})})]})]})}export{De as AIPredictiveAnalytics};