import{g as kt,j as t,X as m,ab as U,_ as x,aU as rt,r as A,o as ot,A as wt,G as Rt,k as le,B as se,a2 as nt,T as ct,t as Be,a7 as Ke,q as Ae,s as Se,x as At,J as St}from"./index-DfyorCky.js";import{d as pe}from"./dashboard-BjQPIG2G.js";import{s as Ot}from"./server-CjDPBaTN.js";import{k as _t}from"./kubernetes-J8O09fK7.js";import{C as I,a as F,b as z,c as V,d as q}from"./card-C55cvSHg.js";import{T as Pt}from"./trending-up-CdusV6gc.js";import{T as Et}from"./trending-down-BGTWG_dA.js";import{M as Tt}from"./minus-UVrx3jLc.js";import{B as $}from"./badge-xNW8x0G1.js";import{H as Lt}from"./hard-drive-BbPmnARR.js";import{b as C,r as dt,s as $t,t as it,v as It,n as Z,w as Ie,x as B,L,y as lt,z as Fe,E as ht,D as Ft,c as Mt,e as ae,o as Y,S as Bt,A as Kt,F as Ut,d as Ue,j as zt,i as Q,l as Vt,u as qt,G as Ht,H as ue,I as Wt,a as pt,J as Gt,K as me,M as ze,g as Zt,N as Xt,R as Oe,C as mt,X as xt,Y as ut,T as _e,B as Jt}from"./generateCategoricalChart-6v9BPbG2.js";import{A as Yt,a as ke}from"./AreaChart-B2zlWfdX.js";import{B as Qt}from"./BarChart-DlFprovY.js";import{M as ea}from"./memory-stick-QMV-0CnU.js";import{A as he}from"./arrow-right-DyIltvNZ.js";import{C as ta}from"./circle-DOZr6_68.js";const aa=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],sa=kt("dollar-sign",aa),Ve={blue:{bg:"bg-[var(--dg-blue)]/10",icon:"text-[var(--dg-blue)]",glow:"shadow-[var(--dg-blue)]/10"},emerald:{bg:"bg-[var(--dg-green)]/10",icon:"text-[var(--dg-green)]",glow:"shadow-[var(--dg-green)]/10"},amber:{bg:"bg-[var(--dg-yellow)]/10",icon:"text-[var(--dg-yellow)]",glow:"shadow-[var(--dg-yellow)]/10"},rose:{bg:"bg-[var(--dg-red)]/10",icon:"text-[var(--dg-red)]",glow:"shadow-[var(--dg-red)]/10"},purple:{bg:"bg-[var(--dg-purple)]/10",icon:"text-[var(--dg-purple)]",glow:"shadow-[var(--dg-purple)]/10"},cyan:{bg:"bg-[var(--dg-cyan)]/10",icon:"text-[var(--dg-cyan)]",glow:"shadow-[var(--dg-cyan)]/10"},orange:{bg:"bg-[var(--dg-orange)]/10",icon:"text-[var(--dg-orange)]",glow:"shadow-[var(--dg-orange)]/10"}};function xe({title:a,value:s,description:r,icon:e,trend:o,trendValue:n,color:c,onClick:d,loading:l=!1}){const i=Ve[c]||Ve.blue;if(l)return t.jsx(I,{"code-path":"src/components/dashboard/DashboardStats.tsx:53:7",className:"dg-card overflow-hidden",children:t.jsxs(F,{"code-path":"src/components/dashboard/DashboardStats.tsx:54:9",className:"p-6 space-y-4",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardStats.tsx:55:11",className:"flex items-start justify-between",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardStats.tsx:56:13",className:"space-y-3 flex-1",children:[t.jsx("div",{"code-path":"src/components/dashboard/DashboardStats.tsx:57:15",className:"dg-skeleton h-4 w-24 rounded"}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardStats.tsx:58:15",className:"dg-skeleton h-8 w-16 rounded"})]}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardStats.tsx:60:13",className:"dg-skeleton h-10 w-10 rounded-lg"})]}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardStats.tsx:62:11",className:"dg-skeleton h-3 w-32 rounded"})]})});const p=o==="up"?Pt:o==="down"?Et:Tt,u=o==="up"?"text-[var(--dg-green)]":o==="down"?"text-[var(--dg-red)]":"text-[var(--dg-text-muted)]";return t.jsx(I,{"code-path":"src/components/dashboard/DashboardStats.tsx:76:5",className:m("dg-card dg-card-hover cursor-pointer overflow-hidden",d&&"cursor-pointer"),onClick:d,children:t.jsx(F,{"code-path":"src/components/dashboard/DashboardStats.tsx:83:7",className:"p-6",children:t.jsxs("div",{"code-path":"src/components/dashboard/DashboardStats.tsx:84:9",className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardStats.tsx:85:11",className:"space-y-3 min-w-0 flex-1",children:[t.jsx("p",{"code-path":"src/components/dashboard/DashboardStats.tsx:86:13",className:"text-sm font-medium text-[var(--dg-text-secondary)] truncate",children:a}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardStats.tsx:89:13",className:"flex items-baseline gap-2 flex-wrap",children:[t.jsx("h3",{"code-path":"src/components/dashboard/DashboardStats.tsx:90:15",className:"text-2xl font-bold text-[var(--dg-text-primary)] tracking-tight",children:s}),o&&n&&t.jsxs("span",{"code-path":"src/components/dashboard/DashboardStats.tsx:94:17",className:m("flex items-center text-xs font-semibold gap-0.5",u),children:[t.jsx(p,{"code-path":"src/components/dashboard/DashboardStats.tsx:95:19",className:"h-3.5 w-3.5"}),n]})]}),r&&t.jsx("p",{"code-path":"src/components/dashboard/DashboardStats.tsx:101:15",className:"text-xs text-[var(--dg-text-muted)]",children:r})]}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardStats.tsx:104:11",className:m("p-3 rounded-xl flex-shrink-0",i.bg,i.icon),children:t.jsx(e,{"code-path":"src/components/dashboard/DashboardStats.tsx:111:13",className:"h-5 w-5"})})]})})})}var ra=["points","className","baseLinePoints","connectNulls"];function ee(){return ee=Object.assign?Object.assign.bind():function(a){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(a,e)&&(r[e]=a[e])}return r}function na(a,s){if(a==null)return{};var r={};for(var e in a)if(Object.prototype.hasOwnProperty.call(a,e)){if(s.indexOf(e)>=0)continue;r[e]=a[e]}return r}function qe(a){return la(a)||ia(a)||da(a)||ca()}function ca(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function da(a,s){if(a){if(typeof a=="string")return Pe(a,s);var r=Object.prototype.toString.call(a).slice(8,-1);if(r==="Object"&&a.constructor&&(r=a.constructor.name),r==="Map"||r==="Set")return Array.from(a);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pe(a,s)}}function ia(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function la(a){if(Array.isArray(a))return Pe(a)}function Pe(a,s){(s==null||s>a.length)&&(s=a.length);for(var r=0,e=new Array(s);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return s.forEach(function(e){He(e)?r[r.length-1].push(e):r[r.length-1].length>0&&r.push([])}),He(s[0])&&r[r.length-1].push(s[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},de=function(s,r){var e=ha(s);r&&(e=[e.reduce(function(n,c){return[].concat(qe(n),qe(c))},[])]);var o=e.map(function(n){return n.reduce(function(c,d,l){return"".concat(c).concat(l===0?"M":"L").concat(d.x,",").concat(d.y)},"")}).join("");return e.length===1?"".concat(o,"Z"):o},pa=function(s,r,e){var o=de(s,e);return"".concat(o.slice(-1)==="Z"?o.slice(0,-1):o,"L").concat(de(r.reverse(),e).slice(1))},ma=function(s){var r=s.points,e=s.className,o=s.baseLinePoints,n=s.connectNulls,c=oa(s,ra);if(!r||!r.length)return null;var d=U("recharts-polygon",e);if(o&&o.length){var l=c.stroke&&c.stroke!=="none",i=pa(r,o,n);return x.createElement("g",{className:d},x.createElement("path",ee({},C(c,!0),{fill:i.slice(-1)==="Z"?c.fill:"none",stroke:"none",d:i})),l?x.createElement("path",ee({},C(c,!0),{fill:"none",d:de(r,n)})):null,l?x.createElement("path",ee({},C(c,!0),{fill:"none",d:de(o,n)})):null)}var p=de(r,n);return x.createElement("path",ee({},C(c,!0),{fill:p.slice(-1)==="Z"?c.fill:"none",className:d,d:p}))},we,We;function xa(){if(We)return we;We=1;var a=dt(),s=$t(),r=it();function e(o,n){return o&&o.length?a(o,r(n,2),s):void 0}return we=e,we}var ua=xa();const ba=rt(ua);var Re,Ge;function fa(){if(Ge)return Re;Ge=1;var a=dt(),s=it(),r=It();function e(o,n){return o&&o.length?a(o,s(n,2),r):void 0}return Re=e,Re}var ga=fa();const va=rt(ga);var ya=["cx","cy","angle","ticks","axisLine"],ja=["ticks","tick","angle","tickFormatter","stroke"];function re(a){"@babel/helpers - typeof";return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},re(a)}function ie(){return ie=Object.assign?Object.assign.bind():function(a){for(var s=1;s=0)&&Object.prototype.propertyIsEnumerable.call(a,e)&&(r[e]=a[e])}return r}function Da(a,s){if(a==null)return{};var r={};for(var e in a)if(Object.prototype.hasOwnProperty.call(a,e)){if(s.indexOf(e)>=0)continue;r[e]=a[e]}return r}function Na(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}function Je(a,s){for(var r=0;ret?c=o==="outer"?"start":"end":n<-et?c=o==="outer"?"end":"start":c="middle",c}},{key:"renderAxisLine",value:function(){var e=this.props,o=e.cx,n=e.cy,c=e.radius,d=e.axisLine,l=e.axisLineType,i=G(G({},C(this.props,!1)),{},{fill:"none"},C(d,!1));if(l==="circle")return x.createElement(Ft,X({className:"recharts-polar-angle-axis-line"},i,{cx:o,cy:n,r:c}));var p=this.props.ticks,u=p.map(function(b){return B(o,n,c,b.coordinate)});return x.createElement(ma,X({className:"recharts-polar-angle-axis-line"},i,{points:u}))}},{key:"renderTicks",value:function(){var e=this,o=this.props,n=o.ticks,c=o.tick,d=o.tickLine,l=o.tickFormatter,i=o.stroke,p=C(this.props,!1),u=C(c,!1),b=G(G({},p),{},{fill:"none"},C(d,!1)),D=n.map(function(f,h){var v=e.getTickLineCoord(f),y=e.getTickTextAnchor(f),j=G(G(G({textAnchor:y},p),{},{stroke:"none",fill:i},u),{},{index:h,payload:f,x:v.x2,y:v.y2});return x.createElement(L,X({className:U("recharts-polar-angle-axis-tick",lt(c)),key:"tick-".concat(f.coordinate)},Fe(e.props,f,h)),d&&x.createElement("line",X({className:"recharts-polar-angle-axis-tick-line"},b,v)),c&&s.renderTickItem(c,j,l?l(f.value,h):f.value))});return x.createElement(L,{className:"recharts-polar-angle-axis-ticks"},D)}},{key:"render",value:function(){var e=this.props,o=e.ticks,n=e.radius,c=e.axisLine;return n<=0||!o||!o.length?null:x.createElement(L,{className:U("recharts-polar-angle-axis",this.props.className)},c&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(e,o,n){var c;return x.isValidElement(e)?c=x.cloneElement(e,o):Z(e)?c=e(o):c=x.createElement(Ie,X({},o,{className:"recharts-polar-angle-axis-tick-value"}),n),c}}])})(A.PureComponent);Ne(Ce,"displayName","PolarAngleAxis");Ne(Ce,"axisType","angleAxis");Ne(Ce,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var be;function ne(a){"@babel/helpers - typeof";return ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},ne(a)}function te(){return te=Object.assign?Object.assign.bind():function(a){for(var s=1;s0?Ut(k,"paddingAngle",0):0;if(S){var M=Ue(S.endAngle-S.startAngle,k.endAngle-k.startAngle),N=g(g({},k),{},{startAngle:j+_,endAngle:j+M(h)+_});v.push(N),j=N.endAngle}else{var O=k.endAngle,P=k.startAngle,J=Ue(0,O-P),H=J(h),T=g(g({},k),{},{startAngle:j+_,endAngle:j+H+_});v.push(T),j=T.endAngle}}),x.createElement(L,null,e.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(e){var o=this;e.onkeydown=function(n){if(!n.altKey)switch(n.key){case"ArrowLeft":{var c=++o.state.sectorToFocus%o.sectorRefs.length;o.sectorRefs[c].focus(),o.setState({sectorToFocus:c});break}case"ArrowRight":{var d=--o.state.sectorToFocus<0?o.sectorRefs.length-1:o.state.sectorToFocus%o.sectorRefs.length;o.sectorRefs[d].focus(),o.setState({sectorToFocus:d});break}case"Escape":{o.sectorRefs[o.state.sectorToFocus].blur(),o.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var e=this.props,o=e.sectors,n=e.isAnimationActive,c=this.state.prevSectors;return n&&o&&o.length&&(!c||!zt(c,o))?this.renderSectorsWithAnimation():this.renderSectorsStatically(o)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,o=this.props,n=o.hide,c=o.sectors,d=o.className,l=o.label,i=o.cx,p=o.cy,u=o.innerRadius,b=o.outerRadius,D=o.isAnimationActive,f=this.state.isAnimationFinished;if(n||!c||!c.length||!Q(i)||!Q(p)||!Q(u)||!Q(b))return null;var h=U("recharts-pie",d);return x.createElement(L,{tabIndex:this.props.rootTabIndex,className:h,ref:function(y){e.pieRef=y}},this.renderSectors(),l&&this.renderLabels(c),ht.renderCallByParent(this.props,null,!1),(!D||f)&&Vt.renderCallByParent(this.props,c,!1))}}],[{key:"getDerivedStateFromProps",value:function(e,o){return o.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==o.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:o.curSectors,isAnimationFinished:!0}:e.sectors!==o.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,o){return e>o?"start":e=360?j:j-1)*l,w=v-j*D-k,S=o.reduce(function(N,O){var P=Y(O,y,0);return N+(Q(P)?P:0)},0),_;if(S>0){var M;_=o.map(function(N,O){var P=Y(N,y,0),J=Y(N,p,O),H=(Q(P)?P:0)/S,T;O?T=M.endAngle+ue(h)*l*(P!==0?1:0):T=c;var ce=T+ue(h)*((P!==0?D:0)+H*w),R=(T+ce)/2,Me=(f.innerRadius+f.outerRadius)/2,Nt=[{name:J,value:P,payload:N,dataKey:y,type:b}],Ct=B(f.cx,f.cy,Me,R);return M=g(g(g({percent:H,cornerRadius:n,name:J,tooltipPayload:Nt,midAngle:R,middleRadius:Me,tooltipPosition:Ct},N),f),{},{value:Y(N,y),startAngle:T,endAngle:ce,payload:N,paddingAngle:ue(h)*l}),M})}return g(g({},f),{},{sectors:_,data:o})});var qa=Zt({chartName:"PieChart",GraphicalChild:K,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Ce},{axisType:"radiusAxis",AxisComp:De}],formatAxisMap:Xt,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const Ha={阿里云:"#ff6a00",aliyun:"#ff6a00",AWS:"#ff9900",aws:"#ff9900",腾讯云:"#006eff",tencent:"#006eff",华为云:"#ff0000",huawei:"#ff0000",Azure:"#0078d4",azure:"#0078d4"},st=["#ff6a00","#ff9900","#006eff","#ff0000","#0078d4","#10b981","#a855f7","#ec4899"];function Dt(a){if(!a||a.length<2)return{pct:0,label:"暂无数据",direction:"neutral"};const s=Number(a[a.length-1].cost??0),r=Number(a[a.length-2].cost??0);if(r===0)return{pct:0,label:s>0?"新增费用":"持平",direction:"neutral"};const e=(s-r)/r*100,o=e>.05?"up":e<-.05?"down":"neutral",n=`${e>0?"+":""}${e.toFixed(1)}% 较上月`;return{pct:e,label:n,direction:o}}function Wa(a,s,r,e=24){const o=[];for(let n=e-1;n>=0;n--){const c=new Date(Date.now()-n*60*60*1e3);o.push({time:`${c.getHours().toString().padStart(2,"0")}:00`,cpu:Number(Math.max(0,Math.min(100,a+(Math.random()-.5)*15)).toFixed(1)),memory:Number(Math.max(0,Math.min(100,s+(Math.random()-.5)*10)).toFixed(1)),disk:Number(Math.max(0,Math.min(100,r+(Math.random()-.5)*5)).toFixed(1))})}return o}function Ga(a,s){if(!a||a.length===0)return[];const r={};for(const e of a){const o=e.timestamp;if(!o)continue;const c=`${new Date(o).getHours().toString().padStart(2,"0")}:00`;r[c]||(r[c]={}),e.name==="cpu"&&(r[c].cpu=Number(e.value)||0),e.name==="memory"&&(r[c].memory=Number(e.value)||0)}return Object.entries(r).sort((e,o)=>e[0].localeCompare(o[0])).map(([e,o])=>({time:e,cpu:Number((o.cpu??0).toFixed(1)),memory:Number((o.memory??0).toFixed(1)),disk:Number(s.toFixed(1))}))}function $e({active:a,payload:s,label:r}){return!a||!s?null:t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:94:5",className:"chart-tooltip px-3 py-2",children:[t.jsx("p",{"code-path":"src/components/dashboard/DashboardCharts.tsx:95:7",className:"text-xs font-medium mb-1.5",style:{color:"var(--dg-text-secondary)"},children:r}),s.map((e,o)=>t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:97:9",className:"flex items-center gap-2 text-xs",children:[t.jsx("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:98:11",className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),t.jsxs("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:99:11",style:{color:"var(--dg-text-muted)"},children:[e.name,":"]}),t.jsx("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:100:11",className:"font-medium",style:{color:"var(--dg-text-primary)"},children:typeof e.value=="number"?`${e.value}%`:e.value})]},o))]})}function Za({costStats:a}){const s=a?.cloud_costs??[],r=a?.month_trend??[],e=s.map((d,l)=>({name:d.cloud,value:d.cost,color:Ha[d.cloud]||st[l%st.length]})),o=r.map(d=>({month:d.month,cost:d.cost})),n=a?.total_cost??e.reduce((d,l)=>d+l.value,0),c=Dt(r);return t.jsxs(I,{"code-path":"src/components/dashboard/DashboardCharts.tsx:123:5",className:"dg-card dg-card-hover",children:[t.jsx(z,{"code-path":"src/components/dashboard/DashboardCharts.tsx:124:7",className:"pb-2",children:t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:125:9",className:"flex items-center justify-between",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:126:11",children:[t.jsx(V,{"code-path":"src/components/dashboard/DashboardCharts.tsx:127:13",className:"text-[var(--dg-text-primary)]",children:"云成本概览"}),t.jsx(q,{"code-path":"src/components/dashboard/DashboardCharts.tsx:128:13",className:"text-[var(--dg-text-muted)]",children:"本月各云平台费用支出"})]}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:130:11",className:"text-right",children:[t.jsxs("p",{"code-path":"src/components/dashboard/DashboardCharts.tsx:131:13",className:"text-2xl font-bold text-[var(--dg-text-primary)] tracking-tight",children:["¥",Number(n).toLocaleString()]}),t.jsx("p",{"code-path":"src/components/dashboard/DashboardCharts.tsx:134:13",className:m("text-xs font-medium mt-0.5",c.direction==="up"?"text-[var(--dg-green)]":c.direction==="down"?"text-[var(--dg-red)]":"text-[var(--dg-text-muted)]"),children:c.label})]})]})}),t.jsxs(F,{"code-path":"src/components/dashboard/DashboardCharts.tsx:145:7",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:146:9",className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:147:11",children:[t.jsx("p",{"code-path":"src/components/dashboard/DashboardCharts.tsx:148:13",className:"text-sm text-[var(--dg-text-secondary)] mb-2",children:"费用分布"}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:149:13",className:"h-[180px]",children:t.jsx(Oe,{"code-path":"src/components/dashboard/DashboardCharts.tsx:150:15",width:"100%",height:"100%",children:t.jsxs(qa,{"code-path":"src/components/dashboard/DashboardCharts.tsx:151:17",children:[t.jsx(K,{"code-path":"src/components/dashboard/DashboardCharts.tsx:152:19",data:e,cx:"50%",cy:"50%",innerRadius:40,outerRadius:70,paddingAngle:2,dataKey:"value",stroke:"none",children:e.map((d,l)=>t.jsx(pt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:163:23",fill:d.color},`cell-${l}`))}),t.jsx(_e,{"code-path":"src/components/dashboard/DashboardCharts.tsx:166:19",content:t.jsx($e,{"code-path":"src/components/dashboard/DashboardCharts.tsx:166:37"})})]})})})]}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:171:11",children:[t.jsx("p",{"code-path":"src/components/dashboard/DashboardCharts.tsx:172:13",className:"text-sm text-[var(--dg-text-secondary)] mb-2",children:"月度趋势"}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:173:13",className:"h-[180px]",children:t.jsx(Oe,{"code-path":"src/components/dashboard/DashboardCharts.tsx:174:15",width:"100%",height:"100%",children:t.jsxs(Qt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:175:17",data:o,margin:{top:5,right:5,left:0,bottom:5},children:[t.jsx(mt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:176:19",strokeDasharray:"3 3",className:"chart-grid-stroke",stroke:"var(--chart-grid)"}),t.jsx(xt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:177:19",dataKey:"month",stroke:"var(--chart-axis)",fontSize:10,tickLine:!1,axisLine:!1}),t.jsx(ut,{"code-path":"src/components/dashboard/DashboardCharts.tsx:178:19",stroke:"var(--chart-axis)",fontSize:10,tickLine:!1,axisLine:!1}),t.jsx(_e,{"code-path":"src/components/dashboard/DashboardCharts.tsx:179:19",content:t.jsx($e,{"code-path":"src/components/dashboard/DashboardCharts.tsx:179:37"})}),t.jsx(Jt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:180:19",dataKey:"cost",fill:"var(--dg-blue)",radius:[4,4,0,0]})]})})})]})]}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:186:9",className:"mt-4 space-y-2",children:e.map(d=>t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:188:13",className:"flex items-center justify-between",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:189:15",className:"flex items-center gap-2",children:[t.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:190:17",className:"w-3 h-3 rounded-full",style:{backgroundColor:d.color}}),t.jsx("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:191:17",className:"text-sm text-[var(--dg-text-secondary)]",children:d.name})]}),t.jsxs("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:193:15",className:"text-sm font-semibold text-[var(--dg-text-primary)]",children:["¥",Number(d.value).toLocaleString()]})]},d.name))})]})]})}function Xa({topUsage:a}){const s=(a?.cpu??[]).slice(0,5),r=(a?.memory??[]).slice(0,5),e=(a?.disk??[]).slice(0,5),o=(n,c,d,l,i)=>t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:215:5",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:216:7",className:"flex items-center gap-2 mb-3",children:[l,t.jsx("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:218:9",className:"text-sm font-semibold text-[var(--dg-text-secondary)]",children:i})]}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:220:7",className:"space-y-2.5",children:n.map((p,u)=>{const b=Number(p.usage??0);return t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:224:13",className:"flex items-center gap-2.5",children:[t.jsx("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:225:15",className:"text-xs font-mono text-[var(--dg-text-muted)] w-5 text-center",children:u+1}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:228:15",className:"flex-1 min-w-0",children:[t.jsx("p",{"code-path":"src/components/dashboard/DashboardCharts.tsx:229:17",className:"text-xs text-[var(--dg-text-secondary)] truncate font-medium",children:p.hostname}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:230:17",className:"flex items-center gap-2 mt-1",children:[t.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:231:19",className:"flex-1 h-1.5 bg-[var(--dg-bg-tertiary)] rounded-full overflow-hidden",children:t.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:232:21",className:m("h-full rounded-full transition-all duration-500",b>80?"bg-[var(--dg-red)]":b>60?"bg-[var(--dg-yellow)]":d),style:{width:`${Math.min(b,100)}%`}})}),t.jsxs("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:240:19",className:m("text-xs font-mono font-medium w-12 text-right",b>80?"text-[var(--dg-red)]":b>60?"text-[var(--dg-yellow)]":"text-[var(--dg-text-muted)]"),children:[b.toFixed(1),"%"]})]})]})]},p.id??u)})})]});return t.jsxs(I,{"code-path":"src/components/dashboard/DashboardCharts.tsx:256:5",className:"dg-card dg-card-hover",children:[t.jsx(z,{"code-path":"src/components/dashboard/DashboardCharts.tsx:257:7",className:"pb-2",children:t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:258:9",children:[t.jsx(V,{"code-path":"src/components/dashboard/DashboardCharts.tsx:259:11",className:"text-[var(--dg-text-primary)]",children:"Top5 资源使用"}),t.jsx(q,{"code-path":"src/components/dashboard/DashboardCharts.tsx:260:11",className:"text-[var(--dg-text-muted)]",children:"CPU、内存、磁盘使用率最高"})]})}),t.jsx(F,{"code-path":"src/components/dashboard/DashboardCharts.tsx:263:7",children:t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:264:9",className:"grid grid-cols-3 gap-4",children:[o(s,"blue","bg-[var(--dg-blue)]",t.jsx(ot,{"code-path":"src/components/dashboard/DashboardCharts.tsx:265:69",className:"h-4 w-4 text-[var(--dg-blue)]"}),"CPU"),o(r,"emerald","bg-[var(--dg-green)]",t.jsx(ea,{"code-path":"src/components/dashboard/DashboardCharts.tsx:266:76",className:"h-4 w-4 text-[var(--dg-green)]"}),"内存"),o(e,"purple","bg-[var(--dg-purple)]",t.jsx(Rt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:267:74",className:"h-4 w-4 text-[var(--dg-purple)]"}),"磁盘")]})})]})}function Ja({avgCpu:a,avgMemory:s,avgDisk:r,metrics:e}){const o=Ga(e??[],r),n=o.length>0?o:Wa(a,s,r,24);return t.jsxs(I,{"code-path":"src/components/dashboard/DashboardCharts.tsx:289:5",className:"dg-card",children:[t.jsx(z,{"code-path":"src/components/dashboard/DashboardCharts.tsx:290:7",className:"pb-2",children:t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:291:9",className:"flex items-center justify-between flex-wrap gap-3",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:292:11",children:[t.jsx(V,{"code-path":"src/components/dashboard/DashboardCharts.tsx:293:13",className:"text-[var(--dg-text-primary)]",children:"资源使用率趋势"}),t.jsx(q,{"code-path":"src/components/dashboard/DashboardCharts.tsx:294:13",className:"text-[var(--dg-text-muted)]",children:"过去24小时系统资源使用情况"})]}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:296:11",className:"flex items-center gap-2",children:[t.jsxs($,{"code-path":"src/components/dashboard/DashboardCharts.tsx:297:13",variant:"outline",className:"dg-badge-blue border",children:[t.jsx(ot,{"code-path":"src/components/dashboard/DashboardCharts.tsx:298:15",className:"h-3 w-3 mr-1"}),"CPU"]}),t.jsxs($,{"code-path":"src/components/dashboard/DashboardCharts.tsx:301:13",variant:"outline",className:"dg-badge-green border",children:[t.jsx(wt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:302:15",className:"h-3 w-3 mr-1"}),"内存"]}),t.jsxs($,{"code-path":"src/components/dashboard/DashboardCharts.tsx:305:13",variant:"outline",className:"dg-badge-purple border",children:[t.jsx(Lt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:306:15",className:"h-3 w-3 mr-1"}),"磁盘"]})]})]})}),t.jsx(F,{"code-path":"src/components/dashboard/DashboardCharts.tsx:312:7",children:t.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:313:9",className:"h-[280px]",children:t.jsx(Oe,{"code-path":"src/components/dashboard/DashboardCharts.tsx:314:11",width:"100%",height:"100%",children:t.jsxs(Yt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:315:13",data:n,margin:{top:10,right:10,left:0,bottom:0},children:[t.jsxs("defs",{"code-path":"src/components/dashboard/DashboardCharts.tsx:316:15",children:[t.jsxs("linearGradient",{"code-path":"src/components/dashboard/DashboardCharts.tsx:317:17",id:"colorCpu",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:318:19",offset:"5%",stopColor:"var(--dg-blue)",stopOpacity:.3}),t.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:319:19",offset:"95%",stopColor:"var(--dg-blue)",stopOpacity:0})]}),t.jsxs("linearGradient",{"code-path":"src/components/dashboard/DashboardCharts.tsx:321:17",id:"colorMemory",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:322:19",offset:"5%",stopColor:"var(--dg-green)",stopOpacity:.3}),t.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:323:19",offset:"95%",stopColor:"var(--dg-green)",stopOpacity:0})]}),t.jsxs("linearGradient",{"code-path":"src/components/dashboard/DashboardCharts.tsx:325:17",id:"colorDisk",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:326:19",offset:"5%",stopColor:"var(--dg-purple)",stopOpacity:.3}),t.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:327:19",offset:"95%",stopColor:"var(--dg-purple)",stopOpacity:0})]})]}),t.jsx(mt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:330:15",strokeDasharray:"3 3",stroke:"var(--chart-grid)"}),t.jsx(xt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:331:15",dataKey:"time",stroke:"var(--chart-axis)",fontSize:12,tickLine:!1,axisLine:!1}),t.jsx(ut,{"code-path":"src/components/dashboard/DashboardCharts.tsx:332:15",stroke:"var(--chart-axis)",fontSize:12,tickLine:!1,axisLine:!1,unit:"%"}),t.jsx(_e,{"code-path":"src/components/dashboard/DashboardCharts.tsx:333:15",content:t.jsx($e,{"code-path":"src/components/dashboard/DashboardCharts.tsx:333:33"})}),t.jsx(ke,{"code-path":"src/components/dashboard/DashboardCharts.tsx:334:15",type:"monotone",dataKey:"cpu",stroke:"var(--dg-blue)",fillOpacity:1,fill:"url(#colorCpu)",strokeWidth:2,name:"CPU"}),t.jsx(ke,{"code-path":"src/components/dashboard/DashboardCharts.tsx:335:15",type:"monotone",dataKey:"memory",stroke:"var(--dg-green)",fillOpacity:1,fill:"url(#colorMemory)",strokeWidth:2,name:"内存"}),t.jsx(ke,{"code-path":"src/components/dashboard/DashboardCharts.tsx:336:15",type:"monotone",dataKey:"disk",stroke:"var(--dg-purple)",fillOpacity:1,fill:"url(#colorDisk)",strokeWidth:2,name:"磁盘"})]})})})})]})}function Ya({severity:a}){return t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:31:5",className:m("w-2 h-2 rounded-full flex-shrink-0 mt-1.5",a==="critical"&&"bg-[var(--dg-red)]",a==="warning"&&"bg-[var(--dg-yellow)]",a==="info"&&"bg-[var(--dg-blue)]")})}function Qa({severity:a}){return t.jsx($,{"code-path":"src/components/dashboard/DashboardRecent.tsx:45:5",variant:"outline",className:m("text-xs font-medium",a==="critical"&&"dg-badge-red border",a==="warning"&&"dg-badge-yellow border",a==="info"&&"dg-badge-blue border"),children:a==="critical"?"严重":a==="warning"?"警告":"提示"})}function es({alerts:a}){const s=le(),r=a.filter(e=>e.status==="firing").slice(0,8);return t.jsxs(I,{"code-path":"src/components/dashboard/DashboardRecent.tsx:64:5",className:"dg-card dg-card-hover",children:[t.jsx(z,{"code-path":"src/components/dashboard/DashboardRecent.tsx:65:7",className:"pb-2",children:t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:66:9",className:"flex items-center justify-between",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:67:11",children:[t.jsx(V,{"code-path":"src/components/dashboard/DashboardRecent.tsx:68:13",className:"text-[var(--dg-text-primary)]",children:"告警消息"}),t.jsx(q,{"code-path":"src/components/dashboard/DashboardRecent.tsx:69:13",className:"text-[var(--dg-text-muted)]",children:"最近触发的告警事件"})]}),t.jsxs(se,{"code-path":"src/components/dashboard/DashboardRecent.tsx:71:11",variant:"ghost",size:"sm",className:"dg-btn-ghost text-xs",onClick:()=>s("/alerts"),children:["查看全部",t.jsx(he,{"code-path":"src/components/dashboard/DashboardRecent.tsx:78:13",className:"h-3.5 w-3.5 ml-1"})]})]})}),t.jsx(F,{"code-path":"src/components/dashboard/DashboardRecent.tsx:82:7",children:t.jsx(nt,{"code-path":"src/components/dashboard/DashboardRecent.tsx:83:9",className:"h-[320px] scrollbar-thin",children:r.length===0?t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:85:13",className:"flex flex-col items-center justify-center py-12 text-[var(--dg-text-muted)]",children:[t.jsx(ct,{"code-path":"src/components/dashboard/DashboardRecent.tsx:86:15",className:"h-10 w-10 mb-3 opacity-30"}),t.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:87:15",className:"text-sm",children:"暂无告警事件"}),t.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:88:15",className:"text-xs mt-1 opacity-60",children:"所有系统运行正常"})]}):t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:91:13",className:"space-y-1.5 pr-2",children:r.map(e=>t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:93:17",className:"flex items-start gap-3 p-3 rounded-lg bg-[var(--dg-bg-tertiary)]/50 hover:bg-[var(--dg-bg-hover)] transition-all duration-200 cursor-pointer group",onClick:()=>s("/alert-center"),children:[t.jsx(Ya,{"code-path":"src/components/dashboard/DashboardRecent.tsx:98:19",severity:e.severity||"info"}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:99:19",className:"flex-1 min-w-0",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:100:21",className:"flex items-center gap-2 flex-wrap",children:[t.jsx("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:101:23",className:"text-sm font-medium text-[var(--dg-text-primary)] truncate",children:e.rule_name}),t.jsx(Qa,{"code-path":"src/components/dashboard/DashboardRecent.tsx:104:23",severity:e.severity||"info"})]}),t.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:106:21",className:"text-xs text-[var(--dg-text-muted)] mt-1",children:e.target}),t.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:107:21",className:"text-xs text-[var(--dg-text-muted)]/70 line-clamp-1",children:e.message})]}),t.jsx("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:109:19",className:"text-[11px] text-[var(--dg-text-muted)]/50 whitespace-nowrap flex-shrink-0",children:e.created_at?new Date(e.created_at).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):""})]},e.id))})})})]})}function ts({expCerts:a}){const s=(a??[]).map(o=>({...o,daysUntilExpiry:o.days_until_expiry??Math.ceil((new Date(o.expire_date).getTime()-Date.now())/864e5)})).sort((o,n)=>o.daysUntilExpiry-n.daysUntilExpiry),r=s.filter(o=>o.daysUntilExpiry<30).length,e=s.filter(o=>o.daysUntilExpiry>=30&&o.daysUntilExpiry<60).length;return t.jsxs(I,{"code-path":"src/components/dashboard/DashboardRecent.tsx:134:5",className:"dg-card dg-card-hover",children:[t.jsx(z,{"code-path":"src/components/dashboard/DashboardRecent.tsx:135:7",className:"pb-2",children:t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:136:9",className:"flex items-center justify-between flex-wrap gap-2",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:137:11",children:[t.jsx(V,{"code-path":"src/components/dashboard/DashboardRecent.tsx:138:13",className:"text-[var(--dg-text-primary)]",children:"证书到期提醒"}),t.jsx(q,{"code-path":"src/components/dashboard/DashboardRecent.tsx:139:13",className:"text-[var(--dg-text-muted)]",children:"SSL证书到期时间监控"})]}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:141:11",className:"flex items-center gap-2",children:[r>0&&t.jsxs($,{"code-path":"src/components/dashboard/DashboardRecent.tsx:143:15",className:"dg-badge-red border",children:[t.jsx(ct,{"code-path":"src/components/dashboard/DashboardRecent.tsx:144:17",className:"h-3 w-3 mr-1"}),r," 即将过期"]}),e>0&&t.jsxs($,{"code-path":"src/components/dashboard/DashboardRecent.tsx:149:15",className:"dg-badge-yellow border",children:[e," 30天内过期"]})]})]})}),t.jsx(F,{"code-path":"src/components/dashboard/DashboardRecent.tsx:156:7",children:t.jsx(nt,{"code-path":"src/components/dashboard/DashboardRecent.tsx:157:9",className:"h-[280px] scrollbar-thin",children:s.length===0?t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:159:13",className:"flex flex-col items-center justify-center py-10 text-[var(--dg-text-muted)]",children:[t.jsx(Be,{"code-path":"src/components/dashboard/DashboardRecent.tsx:160:15",className:"h-10 w-10 mb-3 opacity-30"}),t.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:161:15",className:"text-sm",children:"暂无证书数据"})]}):t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:164:13",className:"space-y-1.5 pr-2",children:s.map(o=>t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:166:17",className:"flex items-center justify-between p-3 rounded-lg bg-[var(--dg-bg-tertiary)]/50 hover:bg-[var(--dg-bg-hover)] transition-all duration-200",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:170:19",className:"flex items-center gap-3 min-w-0",children:[t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:171:21",className:m("w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",o.daysUntilExpiry<30?"bg-[var(--dg-red)]/10":o.daysUntilExpiry<60?"bg-[var(--dg-yellow)]/10":"bg-[var(--dg-green)]/10"),children:t.jsx(Be,{"code-path":"src/components/dashboard/DashboardRecent.tsx:179:23",className:m("h-4 w-4",o.daysUntilExpiry<30?"text-[var(--dg-red)]":o.daysUntilExpiry<60?"text-[var(--dg-yellow)]":"text-[var(--dg-green)]")})}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:186:21",className:"min-w-0",children:[t.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:187:23",className:"text-sm font-medium text-[var(--dg-text-primary)] truncate",children:o.name}),t.jsxs("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:188:23",className:"text-xs text-[var(--dg-text-muted)]",children:["到期: ",o.expire_date?.substring(0,10)]})]})]}),t.jsx($,{"code-path":"src/components/dashboard/DashboardRecent.tsx:191:19",variant:"outline",className:m("text-xs flex-shrink-0",o.daysUntilExpiry<30?"dg-badge-red border":o.daysUntilExpiry<60?"dg-badge-yellow border":"dg-badge-green border"),children:o.daysUntilExpiry<0?"已过期":`${o.daysUntilExpiry} 天`})]},o.id))})})})]})}function as({releases:a}){const s=le(),r=a?.slice(0,5)??[];return t.jsxs(I,{"code-path":"src/components/dashboard/DashboardRecent.tsx:217:5",className:"dg-card dg-card-hover",children:[t.jsx(z,{"code-path":"src/components/dashboard/DashboardRecent.tsx:218:7",className:"pb-2",children:t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:219:9",className:"flex items-center justify-between",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:220:11",children:[t.jsx(V,{"code-path":"src/components/dashboard/DashboardRecent.tsx:221:13",className:"text-[var(--dg-text-primary)]",children:"发布历史"}),t.jsx(q,{"code-path":"src/components/dashboard/DashboardRecent.tsx:222:13",className:"text-[var(--dg-text-muted)]",children:"今日应用发布记录"})]}),t.jsxs(se,{"code-path":"src/components/dashboard/DashboardRecent.tsx:224:11",variant:"ghost",size:"sm",className:"dg-btn-ghost text-xs",onClick:()=>s("/pipelines"),children:["查看全部",t.jsx(he,{"code-path":"src/components/dashboard/DashboardRecent.tsx:231:13",className:"h-3.5 w-3.5 ml-1"})]})]})}),t.jsx(F,{"code-path":"src/components/dashboard/DashboardRecent.tsx:235:7",children:r.length===0?t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:237:11",className:"flex flex-col items-center justify-center py-10 text-[var(--dg-text-muted)]",children:[t.jsx(Ke,{"code-path":"src/components/dashboard/DashboardRecent.tsx:238:13",className:"h-10 w-10 mb-3 opacity-30"}),t.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:239:13",className:"text-sm",children:"暂无发布记录"})]}):t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:242:11",className:"space-y-2",children:r.map(e=>t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:244:15",className:"flex items-center gap-3 p-3 rounded-lg bg-[var(--dg-bg-tertiary)]/50 hover:bg-[var(--dg-bg-hover)] transition-all duration-200",children:[t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:248:17",className:m("w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",e.status==="success"?"bg-[var(--dg-green)]/10":e.status==="failed"?"bg-[var(--dg-red)]/10":e.status==="deploying"?"bg-[var(--dg-blue)]/10":"bg-[var(--dg-yellow)]/10"),children:t.jsx(Ke,{"code-path":"src/components/dashboard/DashboardRecent.tsx:257:19",className:m("h-4 w-4",e.status==="success"?"text-[var(--dg-green)]":e.status==="failed"?"text-[var(--dg-red)]":e.status==="deploying"?"text-[var(--dg-blue)]":"text-[var(--dg-yellow)]")})}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:265:17",className:"flex-1 min-w-0",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:266:19",className:"flex items-center gap-2",children:[t.jsx("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:267:21",className:"text-sm font-medium text-[var(--dg-text-primary)] truncate",children:e.app_name}),t.jsx($,{"code-path":"src/components/dashboard/DashboardRecent.tsx:268:21",variant:"outline",className:"text-xs border-[var(--dg-border)] text-[var(--dg-text-muted)] flex-shrink-0",children:e.version})]}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:272:19",className:"flex items-center gap-2 mt-0.5",children:[t.jsx("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:273:21",className:"text-xs text-[var(--dg-text-muted)]",children:e.environment}),t.jsx("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:274:21",className:"text-xs text-[var(--dg-border)]",children:"·"}),t.jsx("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:275:21",className:"text-xs text-[var(--dg-text-muted)] truncate",children:e.commit_id})]})]}),t.jsx($,{"code-path":"src/components/dashboard/DashboardRecent.tsx:278:17",variant:"outline",className:m("text-xs flex-shrink-0",e.status==="success"?"dg-badge-green border":e.status==="failed"?"dg-badge-red border":e.status==="deploying"?"dg-badge-blue border":"dg-badge-yellow border"),children:e.status==="success"?"成功":e.status==="failed"?"失败":e.status==="deploying"?"发布中":e.status==="rolled_back"?"已回滚":"构建中"})]},e.id))})})]})}function ss({servers:a}){const s=le(),r=a.filter(n=>n.status==="running").length,e=a.filter(n=>n.status==="stopped").length,o=a.filter(n=>n.status==="maintenance").length;return t.jsxs(I,{"code-path":"src/components/dashboard/DashboardRecent.tsx:309:5",className:"dg-card dg-card-hover",children:[t.jsx(z,{"code-path":"src/components/dashboard/DashboardRecent.tsx:310:7",className:"pb-2",children:t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:311:9",className:"flex items-center justify-between",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:312:11",children:[t.jsx(V,{"code-path":"src/components/dashboard/DashboardRecent.tsx:313:13",className:"text-[var(--dg-text-primary)]",children:"服务器状态"}),t.jsx(q,{"code-path":"src/components/dashboard/DashboardRecent.tsx:314:13",className:"text-[var(--dg-text-muted)]",children:"服务器运行状态分布"})]}),t.jsxs(se,{"code-path":"src/components/dashboard/DashboardRecent.tsx:316:11",variant:"ghost",size:"sm",className:"dg-btn-ghost text-xs",onClick:()=>s("/servers"),children:["查看全部",t.jsx(he,{"code-path":"src/components/dashboard/DashboardRecent.tsx:323:13",className:"h-3.5 w-3.5 ml-1"})]})]})}),t.jsxs(F,{"code-path":"src/components/dashboard/DashboardRecent.tsx:327:7",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:329:9",className:"grid grid-cols-3 gap-3 mb-4",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:330:11",className:"text-center p-3 rounded-xl bg-[var(--dg-green)]/8 border border-[var(--dg-green)]/15",children:[t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:331:13",className:"text-2xl font-bold text-[var(--dg-green)]",children:r}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:332:13",className:"text-xs text-[var(--dg-text-muted)] mt-1",children:"运行中"})]}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:334:11",className:"text-center p-3 rounded-xl bg-[var(--dg-yellow)]/8 border border-[var(--dg-yellow)]/15",children:[t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:335:13",className:"text-2xl font-bold text-[var(--dg-yellow)]",children:o}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:336:13",className:"text-xs text-[var(--dg-text-muted)] mt-1",children:"维护中"})]}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:338:11",className:"text-center p-3 rounded-xl bg-[var(--dg-text-muted)]/8 border border-[var(--dg-border)]",children:[t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:339:13",className:"text-2xl font-bold text-[var(--dg-text-muted)]",children:e}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:340:13",className:"text-xs text-[var(--dg-text-muted)] mt-1",children:"已停止"})]})]}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:345:9",className:"space-y-1.5",children:[a.slice(0,4).map(n=>t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:347:13",className:"flex items-center gap-3 p-2.5 rounded-lg bg-[var(--dg-bg-tertiary)]/50 hover:bg-[var(--dg-bg-hover)] transition-all duration-200",children:[t.jsx(ta,{"code-path":"src/components/dashboard/DashboardRecent.tsx:351:15",className:m("h-2.5 w-2.5 flex-shrink-0 fill-current",n.status==="running"?"text-[var(--dg-green)]":n.status==="maintenance"?"text-[var(--dg-yellow)]":"text-[var(--dg-text-muted)]")}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:359:15",className:"flex-1 min-w-0",children:[t.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:360:17",className:"text-sm text-[var(--dg-text-primary)] truncate",children:n.hostname}),t.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:361:17",className:"text-xs text-[var(--dg-text-muted)]",children:n.ip})]}),t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:363:15",className:"text-right flex-shrink-0",children:[t.jsxs("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:364:17",className:"text-xs text-[var(--dg-text-muted)]",children:["CPU ",t.jsxs("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:365:23",className:"text-[var(--dg-text-secondary)] font-medium",children:[Number(n.cpu_usage??0).toFixed(1),"%"]})]}),t.jsxs("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:367:17",className:"text-xs text-[var(--dg-text-muted)]",children:["内存 ",t.jsxs("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:368:22",className:"text-[var(--dg-text-secondary)] font-medium",children:[Number(n.memory_usage??0).toFixed(1),"%"]})]})]})]},n.id)),a.length===0&&t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:374:13",className:"flex flex-col items-center justify-center py-6 text-[var(--dg-text-muted)]",children:[t.jsx(Ae,{"code-path":"src/components/dashboard/DashboardRecent.tsx:375:15",className:"h-8 w-8 mb-2 opacity-30"}),t.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:376:15",className:"text-sm",children:"暂无服务器"})]})]})]})]})}function rs({clusters:a}){const s=le();return t.jsxs(I,{"code-path":"src/components/dashboard/DashboardRecent.tsx:389:5",className:"dg-card dg-card-hover",children:[t.jsx(z,{"code-path":"src/components/dashboard/DashboardRecent.tsx:390:7",className:"pb-2",children:t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:391:9",className:"flex items-center justify-between",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:392:11",children:[t.jsx(V,{"code-path":"src/components/dashboard/DashboardRecent.tsx:393:13",className:"text-[var(--dg-text-primary)]",children:"Kubernetes 集群"}),t.jsx(q,{"code-path":"src/components/dashboard/DashboardRecent.tsx:394:13",className:"text-[var(--dg-text-muted)]",children:"Kubernetes集群健康状态"})]}),t.jsxs(se,{"code-path":"src/components/dashboard/DashboardRecent.tsx:396:11",variant:"ghost",size:"sm",className:"dg-btn-ghost text-xs",onClick:()=>s("/kubernetes"),children:["查看全部",t.jsx(he,{"code-path":"src/components/dashboard/DashboardRecent.tsx:403:13",className:"h-3.5 w-3.5 ml-1"})]})]})}),t.jsx(F,{"code-path":"src/components/dashboard/DashboardRecent.tsx:407:7",children:a.length===0?t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:409:11",className:"flex flex-col items-center justify-center py-10 text-[var(--dg-text-muted)]",children:[t.jsx(Se,{"code-path":"src/components/dashboard/DashboardRecent.tsx:410:13",className:"h-10 w-10 mb-3 opacity-30"}),t.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:411:13",className:"text-sm",children:"暂无集群数据"})]}):t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:414:11",className:"space-y-3",children:a.map(r=>{const e=Number(r.cpu_usage??0),o=Number(r.memory_usage??0);return t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:419:17",className:"p-3.5 rounded-xl bg-[var(--dg-bg-tertiary)]/50 hover:bg-[var(--dg-bg-hover)] transition-all duration-200 cursor-pointer",onClick:()=>s(`/kubernetes/${r.code||r.id}`),children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:424:19",className:"flex items-center justify-between mb-3",children:[t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:425:21",className:"flex items-center gap-2.5",children:[t.jsx(Se,{"code-path":"src/components/dashboard/DashboardRecent.tsx:426:23",className:"h-4.5 w-4.5 text-[var(--dg-blue)]"}),t.jsx("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:427:23",className:"text-sm font-semibold text-[var(--dg-text-primary)]",children:r.name})]}),t.jsx($,{"code-path":"src/components/dashboard/DashboardRecent.tsx:429:21",variant:"outline",className:m("text-xs",r.status==="healthy"?"dg-badge-green border":r.status==="warning"?"dg-badge-yellow border":"dg-badge-red border"),children:r.status==="healthy"?"健康":r.status==="warning"?"警告":"异常"})]}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:441:19",className:"grid grid-cols-4 gap-2 text-center",children:[{label:"节点",value:r.node_count??0},{label:"Pod",value:r.pod_count??0},{label:"CPU",value:`${e.toFixed(1)}%`},{label:"内存",value:`${o.toFixed(1)}%`}].map(n=>t.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:448:23",className:"p-1.5 rounded-lg bg-[var(--dg-bg-primary)]/50",children:[t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:449:25",className:"text-sm font-semibold text-[var(--dg-text-primary)]",children:n.value}),t.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:450:25",className:"text-[10px] text-[var(--dg-text-muted)] mt-0.5",children:n.label})]},n.label))})]},r.id)})})})]})}function fe({variant:a="card",className:s}){const r="dg-skeleton";return a==="stat"?t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:22:7",className:m("dg-card p-6 space-y-4",s),children:[t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:23:9",className:"flex items-start justify-between",children:[t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:24:11",className:"space-y-3 flex-1",children:[t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:25:13",className:m("h-4 w-24 rounded",r)}),t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:26:13",className:m("h-8 w-16 rounded",r)})]}),t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:28:11",className:m("h-10 w-10 rounded-lg",r)})]}),t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:30:9",className:m("h-3 w-32 rounded",r)})]}):a==="chart"?t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:37:7",className:m("dg-card p-6 space-y-4",s),children:[t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:38:9",className:"space-y-2",children:[t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:39:11",className:m("h-5 w-32 rounded",r)}),t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:40:11",className:m("h-3 w-48 rounded",r)})]}),t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:42:9",className:m("h-[200px] rounded-lg",r)})]}):a==="table"?t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:49:7",className:m("dg-card overflow-hidden",s),children:[t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:51:9",className:"flex items-center gap-4 p-4 border-b border-[var(--dg-border)]",children:[t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:52:11",className:m("h-4 w-8 rounded",r)}),Array.from({length:6}).map((e,o)=>t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:54:13",className:m("h-4 flex-1 rounded",r)},o))]}),Array.from({length:5}).map((e,o)=>t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:59:11",className:"flex items-center gap-4 p-4 border-b border-[var(--dg-border)] last:border-0",children:[t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:60:13",className:m("h-4 w-8 rounded",r)}),Array.from({length:6}).map((n,c)=>t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:62:15",className:m("h-4 flex-1 rounded",r)},c))]},o))]}):t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:72:5",className:m("dg-card p-6 space-y-4",s),children:[t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:73:7",className:"space-y-2",children:[t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:74:9",className:m("h-5 w-40 rounded",r)}),t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:75:9",className:m("h-3 w-56 rounded",r)})]}),t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:77:7",className:"space-y-3",children:Array.from({length:4}).map((e,o)=>t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:79:11",className:"flex items-center gap-3",children:[t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:80:13",className:m("h-8 w-8 rounded-lg",r)}),t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:81:13",className:"flex-1 space-y-2",children:[t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:82:15",className:m("h-3 w-full rounded",r)}),t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:83:15",className:m("h-3 w-2/3 rounded",r)})]})]},o))})]})}function os({count:a=4}){return t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:97:5",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:Array.from({length:a}).map((s,r)=>t.jsx(fe,{"code-path":"src/components/layout/SkeletonCard.tsx:99:9",variant:"stat"},r))})}function ns(){return t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:110:5",className:"space-y-6",children:[t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:112:7",className:"flex items-center justify-between",children:[t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:113:9",className:"space-y-2",children:[t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:114:11",className:"dg-skeleton h-7 w-24 rounded"}),t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:115:11",className:"dg-skeleton h-4 w-48 rounded"})]}),t.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:117:9",className:"dg-skeleton h-9 w-20 rounded-lg"})]}),t.jsx(os,{"code-path":"src/components/layout/SkeletonCard.tsx:121:7",count:4}),t.jsx(fe,{"code-path":"src/components/layout/SkeletonCard.tsx:124:7",variant:"chart"}),t.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:127:7",className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[t.jsx(fe,{"code-path":"src/components/layout/SkeletonCard.tsx:128:9",variant:"list"}),t.jsx(fe,{"code-path":"src/components/layout/SkeletonCard.tsx:129:9",variant:"list"})]})]})}function Ns(){const a=le(),[s,r]=A.useState(!0),[e,o]=A.useState(!1),[n,c]=A.useState(null),[d,l]=A.useState([]),[i,p]=A.useState([]),[u,b]=A.useState([]),[D,f]=A.useState([]),[h,v]=A.useState([]),[y,j]=A.useState([]),k=A.useCallback(async()=>{o(!0);try{const[O,P,J,H,T,ce]=await Promise.all([pe.getStats().catch(R=>(console.error("Failed to fetch dashboard stats:",R),null)),Ot.getServers({page:1,page_size:100}).catch(R=>(console.error("Failed to fetch servers:",R),null)),_t.getClusters().catch(R=>(console.error("Failed to fetch k8s clusters:",R),null)),pe.getAlerts(10).catch(R=>(console.error("Failed to fetch dashboard alerts:",R),null)),pe.getReleases(5).catch(R=>(console.error("Failed to fetch dashboard releases:",R),null)),pe.getMetrics(6).catch(R=>(console.error("Failed to fetch metrics:",R),[]))]);c(O),l(P?.list??[]),p(J?.list??[]),b(Array.isArray(H)?H:[]),f(Array.isArray(T)?T:[]),v(O?.expiring_certs??[]),j(Array.isArray(ce)?ce:[])}catch(O){console.error("Failed to load dashboard data:",O)}finally{o(!1),r(!1)}},[]);if(A.useEffect(()=>{k();const O=setInterval(k,5e3);return()=>clearInterval(O)},[k]),s)return t.jsx(ns,{"code-path":"src/components/dashboard/Dashboard.tsx:94:12"});const w=n?.server_stats,S=n?.kubernetes_stats,_=n?.alert_stats,M=n?.cost_stats,N=Dt(M?.month_trend);return t.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:104:5",className:"dg-page",children:[t.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:106:7",className:"dg-page-header",children:[t.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:107:9",children:[t.jsx("h1",{"code-path":"src/components/dashboard/Dashboard.tsx:108:11",className:"dg-page-title",children:"仪表盘"}),t.jsxs("p",{"code-path":"src/components/dashboard/Dashboard.tsx:109:11",className:"dg-page-subtitle",children:["实时监控和运维概览 · 最后更新: ",new Date().toLocaleTimeString("zh-CN")]})]}),t.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:111:9",className:"dg-page-actions",children:[t.jsxs(se,{"code-path":"src/components/dashboard/Dashboard.tsx:112:11",variant:"outline",className:"dg-btn-secondary",onClick:k,disabled:e,children:[t.jsx(At,{"code-path":"src/components/dashboard/Dashboard.tsx:118:13",className:m("h-4 w-4",e&&"animate-spin")}),e?"刷新中":"刷新"]}),t.jsxs(se,{"code-path":"src/components/dashboard/Dashboard.tsx:121:11",className:"dg-btn-primary",onClick:()=>a("/servers"),children:[t.jsx(Ae,{"code-path":"src/components/dashboard/Dashboard.tsx:125:13",className:"h-4 w-4"}),"服务器",t.jsx(he,{"code-path":"src/components/dashboard/Dashboard.tsx:127:13",className:"h-3.5 w-3.5"})]})]})]}),t.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:133:7",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[t.jsx("div",{"code-path":"src/components/dashboard/Dashboard.tsx:134:9",className:"animate-fade-in-delay-1",children:t.jsx(xe,{"code-path":"src/components/dashboard/Dashboard.tsx:135:11",title:"服务器总数",value:w?.total??0,description:`${w?.running??0} 台运行中`,icon:Ae,trend:Number(w?.error??0)>0?"down":"neutral",trendValue:Number(w?.error??0)>0?`${w?.error} 台异常`:"运行正常",color:"blue",onClick:()=>a("/servers")})}),t.jsx("div",{"code-path":"src/components/dashboard/Dashboard.tsx:146:9",className:"animate-fade-in-delay-2",children:t.jsx(xe,{"code-path":"src/components/dashboard/Dashboard.tsx:147:11",title:"Kubernetes 集群",value:S?.total??0,description:`${S?.healthy??0} 个健康`,icon:Se,trend:"neutral",trendValue:"稳定",color:"purple",onClick:()=>a("/kubernetes")})}),t.jsx("div",{"code-path":"src/components/dashboard/Dashboard.tsx:158:9",className:"animate-fade-in-delay-3",children:t.jsx(xe,{"code-path":"src/components/dashboard/Dashboard.tsx:159:11",title:"待处理告警",value:_?.firing??0,description:`${_?.critical??0} 个严重`,icon:St,trend:Number(_?.today_count??0)>0?"up":"down",trendValue:`本周 ${_?.week_count??0} 条`,color:"rose",onClick:()=>a("/alert-center")})}),t.jsx("div",{"code-path":"src/components/dashboard/Dashboard.tsx:170:9",className:"animate-fade-in-delay-4",children:t.jsx(xe,{"code-path":"src/components/dashboard/Dashboard.tsx:171:11",title:"本月云成本",value:`¥${Number(M?.month_cost??0).toLocaleString()}`,description:N.label,icon:sa,trend:N.direction,trendValue:`${N.pct>0?"+":""}${N.pct.toFixed(1)}%`,color:"orange",onClick:()=>a("/cloud-billing")})})]}),t.jsx("div",{"code-path":"src/components/dashboard/Dashboard.tsx:185:7",className:"animate-fade-in-delay-2",children:t.jsx(Ja,{"code-path":"src/components/dashboard/Dashboard.tsx:186:9",avgCpu:Number(w?.avg_cpu??0),avgMemory:Number(w?.avg_memory??0),avgDisk:Number(w?.avg_disk??0),metrics:y})}),t.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:195:7",className:"grid grid-cols-1 lg:grid-cols-2 gap-6 animate-fade-in-delay-3",children:[t.jsx(Za,{"code-path":"src/components/dashboard/Dashboard.tsx:196:9",costStats:M}),t.jsx(Xa,{"code-path":"src/components/dashboard/Dashboard.tsx:197:9",topUsage:n?.top_resource_usage})]}),t.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:201:7",className:"grid grid-cols-1 lg:grid-cols-2 gap-6 animate-fade-in-delay-3",children:[t.jsx(es,{"code-path":"src/components/dashboard/Dashboard.tsx:202:9",alerts:u}),t.jsx(ts,{"code-path":"src/components/dashboard/Dashboard.tsx:203:9",expCerts:h})]}),t.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:207:7",className:"grid grid-cols-1 lg:grid-cols-3 gap-6 animate-fade-in-delay-4",children:[t.jsx(as,{"code-path":"src/components/dashboard/Dashboard.tsx:208:9",releases:D}),t.jsx(ss,{"code-path":"src/components/dashboard/Dashboard.tsx:209:9",servers:d}),t.jsx(rs,{"code-path":"src/components/dashboard/Dashboard.tsx:210:9",clusters:i})]})]})}export{Ns as Dashboard};