5 lines
72 KiB
JavaScript
5 lines
72 KiB
JavaScript
import{R as m,g as st,r as A,j as s}from"./vendor-codemirror-B1SGo4xl.js";import{au as K,m as u,i as ie,B as se,q as rt}from"./index-Bp-M7P_8.js";import{d as he}from"./dashboard-50x02M_T.js";import{s as Ct}from"./server-B7EY-8NK.js";import{k as kt}from"./index-BkulU9RM.js";import{S as Rt}from"./stat-strip-CSMyyoYr.js";import{C as B,b as U,c as z,d as V,a as q}from"./card-BHSBTtub.js";import{B as L}from"./badge-B00SZHvE.js";import{g as ot,A as At,H as wt,az as St,D as Ot,ae as le,l as nt,j as Me,ar as Ke,aG as Pt,h as ct,i as Be,b as _t}from"./vendor-icons-BWk-DH7F.js";import{f as C,r as dt,b as Et,c as it,d as Tt,i as X,e as Ee,p as I,L as T,g as lt,h as Te,j as ht,D as Lt,k as It,l as ae,m as J,S as $t,n as Ft,o as Mt,q as Ue,s as Kt,t as Q,u as Bt,v as Ut,G as zt,w as me,x as Vt,y as pt,z as qt,E as pe,F as ze,H as mt,I as ut,X as Le,Y as Ie,J as Wt,K as Gt,R as Re,A as Ht,C as xt,T as Ae,a as Ne}from"./AreaChart-B_pR5s1C.js";var Zt=["points","className","baseLinePoints","connectNulls"];function ee(){return ee=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},ee.apply(this,arguments)}function Xt(t,a){if(t==null)return{};var r=Yt(t,a),e,o;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(o=0;o<n.length;o++)e=n[o],!(a.indexOf(e)>=0)&&Object.prototype.propertyIsEnumerable.call(t,e)&&(r[e]=t[e])}return r}function Yt(t,a){if(t==null)return{};var r={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){if(a.indexOf(e)>=0)continue;r[e]=t[e]}return r}function Ve(t){return ta(t)||ea(t)||Qt(t)||Jt()}function Jt(){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 Qt(t,a){if(t){if(typeof t=="string")return we(t,a);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return we(t,a)}}function ea(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ta(t){if(Array.isArray(t))return we(t)}function we(t,a){(a==null||a>t.length)&&(a=t.length);for(var r=0,e=new Array(a);r<a;r++)e[r]=t[r];return e}var qe=function(a){return a&&a.x===+a.x&&a.y===+a.y},aa=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return a.forEach(function(e){qe(e)?r[r.length-1].push(e):r[r.length-1].length>0&&r.push([])}),qe(a[0])&&r[r.length-1].push(a[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},ce=function(a,r){var e=aa(a);r&&(e=[e.reduce(function(n,c){return[].concat(Ve(n),Ve(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},sa=function(a,r,e){var o=ce(a,e);return"".concat(o.slice(-1)==="Z"?o.slice(0,-1):o,"L").concat(ce(r.reverse(),e).slice(1))},ra=function(a){var r=a.points,e=a.className,o=a.baseLinePoints,n=a.connectNulls,c=Xt(a,Zt);if(!r||!r.length)return null;var d=K("recharts-polygon",e);if(o&&o.length){var l=c.stroke&&c.stroke!=="none",i=sa(r,o,n);return m.createElement("g",{className:d},m.createElement("path",ee({},C(c,!0),{fill:i.slice(-1)==="Z"?c.fill:"none",stroke:"none",d:i})),l?m.createElement("path",ee({},C(c,!0),{fill:"none",d:ce(r,n)})):null,l?m.createElement("path",ee({},C(c,!0),{fill:"none",d:ce(o,n)})):null)}var p=ce(r,n);return m.createElement("path",ee({},C(c,!0),{fill:p.slice(-1)==="Z"?c.fill:"none",className:d,d:p}))},Ce,We;function oa(){if(We)return Ce;We=1;var t=dt(),a=Et(),r=it();function e(o,n){return o&&o.length?t(o,r(n,2),a):void 0}return Ce=e,Ce}var na=oa();const ca=st(na);var ke,Ge;function da(){if(Ge)return ke;Ge=1;var t=dt(),a=it(),r=Tt();function e(o,n){return o&&o.length?t(o,a(n,2),r):void 0}return ke=e,ke}var ia=da();const la=st(ia);var ha=["cx","cy","angle","ticks","axisLine"],pa=["ticks","tick","angle","tickFormatter","stroke"];function re(t){"@babel/helpers - typeof";return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},re(t)}function de(){return de=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},de.apply(this,arguments)}function He(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);a&&(e=e.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,e)}return r}function H(t){for(var a=1;a<arguments.length;a++){var r=arguments[a]!=null?arguments[a]:{};a%2?He(Object(r),!0).forEach(function(e){ve(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):He(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ze(t,a){if(t==null)return{};var r=ma(t,a),e,o;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(o=0;o<n.length;o++)e=n[o],!(a.indexOf(e)>=0)&&Object.prototype.propertyIsEnumerable.call(t,e)&&(r[e]=t[e])}return r}function ma(t,a){if(t==null)return{};var r={};for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){if(a.indexOf(e)>=0)continue;r[e]=t[e]}return r}function ua(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function Xe(t,a){for(var r=0;r<a.length;r++){var e=a[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,ft(e.key),e)}}function xa(t,a,r){return a&&Xe(t.prototype,a),r&&Xe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ba(t,a,r){return a=be(a),fa(t,bt()?Reflect.construct(a,r||[],be(t).constructor):a.apply(t,r))}function fa(t,a){if(a&&(re(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ga(t)}function ga(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bt=function(){return!!t})()}function be(t){return be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},be(t)}function va(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),a&&Se(t,a)}function Se(t,a){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,o){return e.__proto__=o,e},Se(t,a)}function ve(t,a,r){return a=ft(a),a in t?Object.defineProperty(t,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[a]=r,t}function ft(t){var a=ya(t,"string");return re(a)=="symbol"?a:a+""}function ya(t,a){if(re(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var e=r.call(t,a);if(re(e)!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ye=(function(t){function a(){return ua(this,a),ba(this,a,arguments)}return va(a,t),xa(a,[{key:"getTickValueCoord",value:function(e){var o=e.coordinate,n=this.props,c=n.angle,d=n.cx,l=n.cy;return I(d,l,o,c)}},{key:"getTickTextAnchor",value:function(){var e=this.props.orientation,o;switch(e){case"left":o="end";break;case"right":o="start";break;default:o="middle";break}return o}},{key:"getViewBox",value:function(){var e=this.props,o=e.cx,n=e.cy,c=e.angle,d=e.ticks,l=ca(d,function(p){return p.coordinate||0}),i=la(d,function(p){return p.coordinate||0});return{cx:o,cy:n,startAngle:c,endAngle:c,innerRadius:i.coordinate||0,outerRadius:l.coordinate||0}}},{key:"renderAxisLine",value:function(){var e=this.props,o=e.cx,n=e.cy,c=e.angle,d=e.ticks,l=e.axisLine,i=Ze(e,ha),p=d.reduce(function(f,h){return[Math.min(f[0],h.coordinate),Math.max(f[1],h.coordinate)]},[1/0,-1/0]),x=I(o,n,p[0],c),b=I(o,n,p[1],c),N=H(H(H({},C(i,!1)),{},{fill:"none"},C(l,!1)),{},{x1:x.x,y1:x.y,x2:b.x,y2:b.y});return m.createElement("line",de({className:"recharts-polar-radius-axis-line"},N))}},{key:"renderTicks",value:function(){var e=this,o=this.props,n=o.ticks,c=o.tick,d=o.angle,l=o.tickFormatter,i=o.stroke,p=Ze(o,pa),x=this.getTickTextAnchor(),b=C(p,!1),N=C(c,!1),f=n.map(function(h,v){var y=e.getTickValueCoord(h),j=H(H(H(H({textAnchor:x,transform:"rotate(".concat(90-d,", ").concat(y.x,", ").concat(y.y,")")},b),{},{stroke:"none",fill:i},N),{},{index:v},y),{},{payload:h});return m.createElement(T,de({className:K("recharts-polar-radius-axis-tick",lt(c)),key:"tick-".concat(h.coordinate)},Te(e.props,h,v)),a.renderTickItem(c,j,l?l(h.value,v):h.value))});return m.createElement(T,{className:"recharts-polar-radius-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,o=e.ticks,n=e.axisLine,c=e.tick;return!o||!o.length?null:m.createElement(T,{className:K("recharts-polar-radius-axis",this.props.className)},n&&this.renderAxisLine(),c&&this.renderTicks(),ht.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(e,o,n){var c;return m.isValidElement(e)?c=m.cloneElement(e,o):X(e)?c=e(o):c=m.createElement(Ee,de({},o,{className:"recharts-polar-radius-axis-tick-value"}),n),c}}])})(A.PureComponent);ve(ye,"displayName","PolarRadiusAxis");ve(ye,"axisType","radiusAxis");ve(ye,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function oe(t){"@babel/helpers - typeof";return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},oe(t)}function Y(){return Y=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},Y.apply(this,arguments)}function Ye(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);a&&(e=e.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,e)}return r}function Z(t){for(var a=1;a<arguments.length;a++){var r=arguments[a]!=null?arguments[a]:{};a%2?Ye(Object(r),!0).forEach(function(e){je(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ye(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function ja(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function Je(t,a){for(var r=0;r<a.length;r++){var e=a[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,vt(e.key),e)}}function Da(t,a,r){return a&&Je(t.prototype,a),r&&Je(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Na(t,a,r){return a=fe(a),Ca(t,gt()?Reflect.construct(a,r||[],fe(t).constructor):a.apply(t,r))}function Ca(t,a){if(a&&(oe(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ka(t)}function ka(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gt=function(){return!!t})()}function fe(t){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fe(t)}function Ra(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),a&&Oe(t,a)}function Oe(t,a){return Oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,o){return e.__proto__=o,e},Oe(t,a)}function je(t,a,r){return a=vt(a),a in t?Object.defineProperty(t,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[a]=r,t}function vt(t){var a=Aa(t,"string");return oe(a)=="symbol"?a:a+""}function Aa(t,a){if(oe(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var e=r.call(t,a);if(oe(e)!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var wa=Math.PI/180,Qe=1e-5,De=(function(t){function a(){return ja(this,a),Na(this,a,arguments)}return Ra(a,t),Da(a,[{key:"getTickLineCoord",value:function(e){var o=this.props,n=o.cx,c=o.cy,d=o.radius,l=o.orientation,i=o.tickSize,p=i||8,x=I(n,c,d,e.coordinate),b=I(n,c,d+(l==="inner"?-1:1)*p,e.coordinate);return{x1:x.x,y1:x.y,x2:b.x,y2:b.y}}},{key:"getTickTextAnchor",value:function(e){var o=this.props.orientation,n=Math.cos(-e.coordinate*wa),c;return n>Qe?c=o==="outer"?"start":"end":n<-Qe?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=Z(Z({},C(this.props,!1)),{},{fill:"none"},C(d,!1));if(l==="circle")return m.createElement(Lt,Y({className:"recharts-polar-angle-axis-line"},i,{cx:o,cy:n,r:c}));var p=this.props.ticks,x=p.map(function(b){return I(o,n,c,b.coordinate)});return m.createElement(ra,Y({className:"recharts-polar-angle-axis-line"},i,{points:x}))}},{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),x=C(c,!1),b=Z(Z({},p),{},{fill:"none"},C(d,!1)),N=n.map(function(f,h){var v=e.getTickLineCoord(f),y=e.getTickTextAnchor(f),j=Z(Z(Z({textAnchor:y},p),{},{stroke:"none",fill:i},x),{},{index:h,payload:f,x:v.x2,y:v.y2});return m.createElement(T,Y({className:K("recharts-polar-angle-axis-tick",lt(c)),key:"tick-".concat(f.coordinate)},Te(e.props,f,h)),d&&m.createElement("line",Y({className:"recharts-polar-angle-axis-tick-line"},b,v)),c&&a.renderTickItem(c,j,l?l(f.value,h):f.value))});return m.createElement(T,{className:"recharts-polar-angle-axis-ticks"},N)}},{key:"render",value:function(){var e=this.props,o=e.ticks,n=e.radius,c=e.axisLine;return n<=0||!o||!o.length?null:m.createElement(T,{className:K("recharts-polar-angle-axis",this.props.className)},c&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(e,o,n){var c;return m.isValidElement(e)?c=m.cloneElement(e,o):X(e)?c=e(o):c=m.createElement(Ee,Y({},o,{className:"recharts-polar-angle-axis-tick-value"}),n),c}}])})(A.PureComponent);je(De,"displayName","PolarAngleAxis");je(De,"axisType","angleAxis");je(De,"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 ue;function ne(t){"@babel/helpers - typeof";return ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},ne(t)}function te(){return te=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},te.apply(this,arguments)}function et(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);a&&(e=e.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,e)}return r}function g(t){for(var a=1;a<arguments.length;a++){var r=arguments[a]!=null?arguments[a]:{};a%2?et(Object(r),!0).forEach(function(e){P(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Sa(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function tt(t,a){for(var r=0;r<a.length;r++){var e=a[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,jt(e.key),e)}}function Oa(t,a,r){return a&&tt(t.prototype,a),r&&tt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pa(t,a,r){return a=ge(a),_a(t,yt()?Reflect.construct(a,r||[],ge(t).constructor):a.apply(t,r))}function _a(t,a){if(a&&(ne(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ea(t)}function Ea(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yt=function(){return!!t})()}function ge(t){return ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ge(t)}function Ta(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),a&&Pe(t,a)}function Pe(t,a){return Pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,o){return e.__proto__=o,e},Pe(t,a)}function P(t,a,r){return a=jt(a),a in t?Object.defineProperty(t,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[a]=r,t}function jt(t){var a=La(t,"string");return ne(a)=="symbol"?a:a+""}function La(t,a){if(ne(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var e=r.call(t,a);if(ne(e)!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var $=(function(t){function a(r){var e;return Sa(this,a),e=Pa(this,a,[r]),P(e,"pieRef",null),P(e,"sectorRefs",[]),P(e,"id",Ut("recharts-pie-")),P(e,"handleAnimationEnd",function(){var o=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),X(o)&&o()}),P(e,"handleAnimationStart",function(){var o=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),X(o)&&o()}),e.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},e}return Ta(a,t),Oa(a,[{key:"isActiveIndex",value:function(e){var o=this.props.activeIndex;return Array.isArray(o)?o.indexOf(e)!==-1:e===o}},{key:"hasActiveIndex",value:function(){var e=this.props.activeIndex;return Array.isArray(e)?e.length!==0:e||e===0}},{key:"renderLabels",value:function(e){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var n=this.props,c=n.label,d=n.labelLine,l=n.dataKey,i=n.valueKey,p=C(this.props,!1),x=C(c,!1),b=C(d,!1),N=c&&c.offsetRadius||20,f=e.map(function(h,v){var y=(h.startAngle+h.endAngle)/2,j=I(h.cx,h.cy,h.outerRadius+N,y),k=g(g(g(g({},p),h),{},{stroke:"none"},x),{},{index:v,textAnchor:a.getTextAnchor(j.x,h.cx)},j),S=g(g(g(g({},p),h),{},{fill:"none",stroke:h.fill},b),{},{index:v,points:[I(h.cx,h.cy,h.outerRadius,y),j]}),w=l;return ae(l)&&ae(i)?w="value":ae(l)&&(w=i),m.createElement(T,{key:"label-".concat(h.startAngle,"-").concat(h.endAngle,"-").concat(h.midAngle,"-").concat(v)},d&&a.renderLabelLineItem(d,S,"line"),a.renderLabelItem(c,k,J(h,w)))});return m.createElement(T,{className:"recharts-pie-labels"},f)}},{key:"renderSectorsStatically",value:function(e){var o=this,n=this.props,c=n.activeShape,d=n.blendStroke,l=n.inactiveShape;return e.map(function(i,p){if(i?.startAngle===0&&i?.endAngle===0&&e.length!==1)return null;var x=o.isActiveIndex(p),b=l&&o.hasActiveIndex()?l:null,N=x?c:b,f=g(g({},i),{},{stroke:d?i.fill:i.stroke,tabIndex:-1});return m.createElement(T,te({ref:function(v){v&&!o.sectorRefs.includes(v)&&o.sectorRefs.push(v)},tabIndex:-1,className:"recharts-pie-sector"},Te(o.props,i,p),{key:"sector-".concat(i?.startAngle,"-").concat(i?.endAngle,"-").concat(i.midAngle,"-").concat(p)}),m.createElement($t,te({option:N,isActive:x,shapeType:"sector"},f)))})}},{key:"renderSectorsWithAnimation",value:function(){var e=this,o=this.props,n=o.sectors,c=o.isAnimationActive,d=o.animationBegin,l=o.animationDuration,i=o.animationEasing,p=o.animationId,x=this.state,b=x.prevSectors,N=x.prevIsAnimationActive;return m.createElement(Ft,{begin:d,duration:l,isActive:c,easing:i,from:{t:0},to:{t:1},key:"pie-".concat(p,"-").concat(N),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(f){var h=f.t,v=[],y=n&&n[0],j=y.startAngle;return n.forEach(function(k,S){var w=b&&b[S],_=S>0?Mt(k,"paddingAngle",0):0;if(w){var F=Ue(w.endAngle-w.startAngle,k.endAngle-k.startAngle),D=g(g({},k),{},{startAngle:j+_,endAngle:j+F(h)+_});v.push(D),j=D.endAngle}else{var M=k.endAngle,O=k.startAngle,W=Ue(0,M-O),G=W(h),E=g(g({},k),{},{startAngle:j+_,endAngle:j+G+_});v.push(E),j=E.endAngle}}),m.createElement(T,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||!Kt(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,x=o.innerRadius,b=o.outerRadius,N=o.isAnimationActive,f=this.state.isAnimationFinished;if(n||!c||!c.length||!Q(i)||!Q(p)||!Q(x)||!Q(b))return null;var h=K("recharts-pie",d);return m.createElement(T,{tabIndex:this.props.rootTabIndex,className:h,ref:function(y){e.pieRef=y}},this.renderSectors(),l&&this.renderLabels(c),ht.renderCallByParent(this.props,null,!1),(!N||f)&&Bt.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<o?"end":"middle"}},{key:"renderLabelLineItem",value:function(e,o,n){if(m.isValidElement(e))return m.cloneElement(e,o);if(X(e))return e(o);var c=K("recharts-pie-label-line",typeof e!="boolean"?e.className:"");return m.createElement(It,te({},o,{key:n,type:"linear",className:c}))}},{key:"renderLabelItem",value:function(e,o,n){if(m.isValidElement(e))return m.cloneElement(e,o);var c=n;if(X(e)&&(c=e(o),m.isValidElement(c)))return c;var d=K("recharts-pie-label-text",typeof e!="boolean"&&!X(e)?e.className:"");return m.createElement(Ee,te({},o,{alignmentBaseline:"middle",className:d}),c)}}])})(A.PureComponent);ue=$;P($,"displayName","Pie");P($,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!zt.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});P($,"parseDeltaAngle",function(t,a){var r=me(a-t),e=Math.min(Math.abs(a-t),360);return r*e});P($,"getRealPieData",function(t){var a=t.data,r=t.children,e=C(t,!1),o=Vt(r,pt);return a&&a.length?a.map(function(n,c){return g(g(g({payload:n},e),n),o&&o[c]&&o[c].props)}):o&&o.length?o.map(function(n){return g(g({},e),n.props)}):[]});P($,"parseCoordinateOfPie",function(t,a){var r=a.top,e=a.left,o=a.width,n=a.height,c=qt(o,n),d=e+pe(t.cx,o,o/2),l=r+pe(t.cy,n,n/2),i=pe(t.innerRadius,c,0),p=pe(t.outerRadius,c,c*.8),x=t.maxRadius||Math.sqrt(o*o+n*n)/2;return{cx:d,cy:l,innerRadius:i,outerRadius:p,maxRadius:x}});P($,"getComposedData",function(t){var a=t.item,r=t.offset,e=a.type.defaultProps!==void 0?g(g({},a.type.defaultProps),a.props):a.props,o=ue.getRealPieData(e);if(!o||!o.length)return null;var n=e.cornerRadius,c=e.startAngle,d=e.endAngle,l=e.paddingAngle,i=e.dataKey,p=e.nameKey,x=e.valueKey,b=e.tooltipType,N=Math.abs(e.minAngle),f=ue.parseCoordinateOfPie(e,r),h=ue.parseDeltaAngle(c,d),v=Math.abs(h),y=i;ae(i)&&ae(x)?(ze(!1,`Use "dataKey" to specify the value of pie,
|
|
the props "valueKey" will be deprecated in 1.1.0`),y="value"):ae(i)&&(ze(!1,`Use "dataKey" to specify the value of pie,
|
|
the props "valueKey" will be deprecated in 1.1.0`),y=x);var j=o.filter(function(D){return J(D,y,0)!==0}).length,k=(v>=360?j:j-1)*l,S=v-j*N-k,w=o.reduce(function(D,M){var O=J(M,y,0);return D+(Q(O)?O:0)},0),_;if(w>0){var F;_=o.map(function(D,M){var O=J(D,y,0),W=J(D,p,M),G=(Q(O)?O:0)/w,E;M?E=F.endAngle+me(h)*l*(O!==0?1:0):E=c;var R=E+me(h)*((O!==0?N:0)+G*S),$e=(E+R)/2,Fe=(f.innerRadius+f.outerRadius)/2,Dt=[{name:W,value:O,payload:D,dataKey:y,type:b}],Nt=I(f.cx,f.cy,Fe,$e);return F=g(g(g({percent:G,cornerRadius:n,name:W,tooltipPayload:Dt,midAngle:$e,middleRadius:Fe,tooltipPosition:Nt},D),f),{},{value:J(D,y),startAngle:E,endAngle:R,payload:D,paddingAngle:me(h)*l}),F})}return g(g({},f),{},{sectors:_,data:o})});var Ia=mt({chartName:"BarChart",GraphicalChild:ut,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Le},{axisType:"yAxis",AxisComp:Ie}],formatAxisMap:Wt}),$a=mt({chartName:"PieChart",GraphicalChild:$,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:De},{axisType:"radiusAxis",AxisComp:ye}],formatAxisMap:Gt,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const Fa={阿里云:"#ff6a00",aliyun:"#ff6a00",AWS:"#ff9900",aws:"#ff9900",腾讯云:"#006eff",tencent:"#006eff",华为云:"#ff0000",huawei:"#ff0000",Azure:"#0078d4",azure:"#0078d4"},at=["#ff6a00","#ff9900","#006eff","#ff0000","#0078d4","#10b981","#a855f7","#ec4899"];function Ma(t){if(!t||t.length<2)return{pct:0,label:"暂无数据",direction:"neutral"};const a=Number(t[t.length-1].cost??0),r=Number(t[t.length-2].cost??0);if(r===0)return{pct:0,label:a>0?"新增费用":"持平",direction:"neutral"};const e=(a-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 Ka(t,a,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,t+(Math.random()-.5)*15)).toFixed(1)),memory:Number(Math.max(0,Math.min(100,a+(Math.random()-.5)*10)).toFixed(1)),disk:Number(Math.max(0,Math.min(100,r+(Math.random()-.5)*5)).toFixed(1))})}return o}function Ba(t,a){if(!t||t.length===0)return[];const r={};for(const e of t){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(a.toFixed(1))}))}function _e({active:t,payload:a,label:r}){return!t||!a?null:s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:94:5",className:"chart-tooltip px-3 py-2",children:[s.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}),a.map((e,o)=>s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:97:9",className:"flex items-center gap-2 text-xs",children:[s.jsx("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:98:11",className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),s.jsxs("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:99:11",style:{color:"var(--dg-text-muted)"},children:[e.name,":"]}),s.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 Ua({costStats:t}){const a=t?.cloud_costs??[],r=t?.month_trend??[],e=a.map((d,l)=>({name:d.cloud,value:d.cost,color:Fa[d.cloud]||at[l%at.length]})),o=r.map(d=>({month:d.month,cost:d.cost})),n=t?.total_cost??e.reduce((d,l)=>d+l.value,0),c=Ma(r);return s.jsxs(B,{"code-path":"src/components/dashboard/DashboardCharts.tsx:123:5",className:"dg-card dg-card-hover",children:[s.jsx(U,{"code-path":"src/components/dashboard/DashboardCharts.tsx:124:7",className:"pb-2",children:s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:125:9",className:"flex items-center justify-between",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:126:11",children:[s.jsx(z,{"code-path":"src/components/dashboard/DashboardCharts.tsx:127:13",className:"text-[var(--dg-text-primary)]",children:"云成本概览"}),s.jsx(V,{"code-path":"src/components/dashboard/DashboardCharts.tsx:128:13",className:"text-[var(--dg-text-muted)]",children:"本月各云平台费用支出"})]}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:130:11",className:"text-right",children:[s.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()]}),s.jsx("p",{"code-path":"src/components/dashboard/DashboardCharts.tsx:134:13",className:u("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})]})]})}),s.jsxs(q,{"code-path":"src/components/dashboard/DashboardCharts.tsx:145:7",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:146:9",className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:147:11",children:[s.jsx("p",{"code-path":"src/components/dashboard/DashboardCharts.tsx:148:13",className:"text-sm text-[var(--dg-text-secondary)] mb-2",children:"费用分布"}),s.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:149:13",className:"h-[180px]",children:s.jsx(Re,{"code-path":"src/components/dashboard/DashboardCharts.tsx:150:15",width:"100%",height:"100%",children:s.jsxs($a,{"code-path":"src/components/dashboard/DashboardCharts.tsx:151:17",children:[s.jsx($,{"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)=>s.jsx(pt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:163:23",fill:d.color},`cell-${l}`))}),s.jsx(Ae,{"code-path":"src/components/dashboard/DashboardCharts.tsx:166:19",content:s.jsx(_e,{"code-path":"src/components/dashboard/DashboardCharts.tsx:166:37"})})]})})})]}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:171:11",children:[s.jsx("p",{"code-path":"src/components/dashboard/DashboardCharts.tsx:172:13",className:"text-sm text-[var(--dg-text-secondary)] mb-2",children:"月度趋势"}),s.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:173:13",className:"h-[180px]",children:s.jsx(Re,{"code-path":"src/components/dashboard/DashboardCharts.tsx:174:15",width:"100%",height:"100%",children:s.jsxs(Ia,{"code-path":"src/components/dashboard/DashboardCharts.tsx:175:17",data:o,margin:{top:5,right:5,left:0,bottom:5},children:[s.jsx(xt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:176:19",strokeDasharray:"3 3",className:"chart-grid-stroke",stroke:"var(--chart-grid)"}),s.jsx(Le,{"code-path":"src/components/dashboard/DashboardCharts.tsx:177:19",dataKey:"month",stroke:"var(--chart-axis)",fontSize:10,tickLine:!1,axisLine:!1}),s.jsx(Ie,{"code-path":"src/components/dashboard/DashboardCharts.tsx:178:19",stroke:"var(--chart-axis)",fontSize:10,tickLine:!1,axisLine:!1}),s.jsx(Ae,{"code-path":"src/components/dashboard/DashboardCharts.tsx:179:19",content:s.jsx(_e,{"code-path":"src/components/dashboard/DashboardCharts.tsx:179:37"})}),s.jsx(ut,{"code-path":"src/components/dashboard/DashboardCharts.tsx:180:19",dataKey:"cost",fill:"var(--dg-blue)",radius:[4,4,0,0]})]})})})]})]}),s.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:186:9",className:"mt-4 space-y-2",children:e.map(d=>s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:188:13",className:"flex items-center justify-between",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:189:15",className:"flex items-center gap-2",children:[s.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:190:17",className:"w-3 h-3 rounded-full",style:{backgroundColor:d.color}}),s.jsx("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:191:17",className:"text-sm text-[var(--dg-text-secondary)]",children:d.name})]}),s.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 za({topUsage:t}){const a=(t?.cpu??[]).slice(0,5),r=(t?.memory??[]).slice(0,5),e=(t?.disk??[]).slice(0,5),o=(n,c,d,l,i)=>s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:215:5",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:216:7",className:"flex items-center gap-2 mb-3",children:[l,s.jsx("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:218:9",className:"text-sm font-semibold text-[var(--dg-text-secondary)]",children:i})]}),s.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:220:7",className:"space-y-2.5",children:n.map((p,x)=>{const b=Number(p.usage??0);return s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:224:13",className:"flex items-center gap-2.5",children:[s.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:x+1}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:228:15",className:"flex-1 min-w-0",children:[s.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}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:230:17",className:"flex items-center gap-2 mt-1",children:[s.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:s.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:232:21",className:u("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)}%`}})}),s.jsxs("span",{"code-path":"src/components/dashboard/DashboardCharts.tsx:240:19",className:u("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??x)})})]});return s.jsxs(B,{"code-path":"src/components/dashboard/DashboardCharts.tsx:256:5",className:"dg-card dg-card-hover",children:[s.jsx(U,{"code-path":"src/components/dashboard/DashboardCharts.tsx:257:7",className:"pb-2",children:s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:258:9",children:[s.jsx(z,{"code-path":"src/components/dashboard/DashboardCharts.tsx:259:11",className:"text-[var(--dg-text-primary)]",children:"Top5 资源使用"}),s.jsx(V,{"code-path":"src/components/dashboard/DashboardCharts.tsx:260:11",className:"text-[var(--dg-text-muted)]",children:"CPU、内存、磁盘使用率最高"})]})}),s.jsx(q,{"code-path":"src/components/dashboard/DashboardCharts.tsx:263:7",children:s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:264:9",className:"grid grid-cols-3 gap-4",children:[o(a,"blue","bg-[var(--dg-blue)]",s.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)]",s.jsx(St,{"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)]",s.jsx(Ot,{"code-path":"src/components/dashboard/DashboardCharts.tsx:267:74",className:"h-4 w-4 text-[var(--dg-purple)]"}),"磁盘")]})})]})}function Va({avgCpu:t,avgMemory:a,avgDisk:r,metrics:e}){const o=Ba(e??[],r),n=o.length>0?o:Ka(t,a,r,24);return s.jsxs(B,{"code-path":"src/components/dashboard/DashboardCharts.tsx:289:5",className:"dg-card",children:[s.jsx(U,{"code-path":"src/components/dashboard/DashboardCharts.tsx:290:7",className:"pb-2",children:s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:291:9",className:"flex items-center justify-between flex-wrap gap-3",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:292:11",children:[s.jsx(z,{"code-path":"src/components/dashboard/DashboardCharts.tsx:293:13",className:"text-[var(--dg-text-primary)]",children:"资源使用率趋势"}),s.jsx(V,{"code-path":"src/components/dashboard/DashboardCharts.tsx:294:13",className:"text-[var(--dg-text-muted)]",children:"过去24小时系统资源使用情况"})]}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:296:11",className:"flex items-center gap-2",children:[s.jsxs(L,{"code-path":"src/components/dashboard/DashboardCharts.tsx:297:13",variant:"outline",className:"dg-badge-blue border",children:[s.jsx(ot,{"code-path":"src/components/dashboard/DashboardCharts.tsx:298:15",className:"h-3 w-3 mr-1"}),"CPU"]}),s.jsxs(L,{"code-path":"src/components/dashboard/DashboardCharts.tsx:301:13",variant:"outline",className:"dg-badge-green border",children:[s.jsx(At,{"code-path":"src/components/dashboard/DashboardCharts.tsx:302:15",className:"h-3 w-3 mr-1"}),"内存"]}),s.jsxs(L,{"code-path":"src/components/dashboard/DashboardCharts.tsx:305:13",variant:"outline",className:"dg-badge-purple border",children:[s.jsx(wt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:306:15",className:"h-3 w-3 mr-1"}),"磁盘"]})]})]})}),s.jsx(q,{"code-path":"src/components/dashboard/DashboardCharts.tsx:312:7",children:s.jsx("div",{"code-path":"src/components/dashboard/DashboardCharts.tsx:313:9",className:"h-[280px]",children:s.jsx(Re,{"code-path":"src/components/dashboard/DashboardCharts.tsx:314:11",width:"100%",height:"100%",children:s.jsxs(Ht,{"code-path":"src/components/dashboard/DashboardCharts.tsx:315:13",data:n,margin:{top:10,right:10,left:0,bottom:0},children:[s.jsxs("defs",{"code-path":"src/components/dashboard/DashboardCharts.tsx:316:15",children:[s.jsxs("linearGradient",{"code-path":"src/components/dashboard/DashboardCharts.tsx:317:17",id:"colorCpu",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:318:19",offset:"5%",stopColor:"var(--dg-blue)",stopOpacity:.3}),s.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:319:19",offset:"95%",stopColor:"var(--dg-blue)",stopOpacity:0})]}),s.jsxs("linearGradient",{"code-path":"src/components/dashboard/DashboardCharts.tsx:321:17",id:"colorMemory",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:322:19",offset:"5%",stopColor:"var(--dg-green)",stopOpacity:.3}),s.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:323:19",offset:"95%",stopColor:"var(--dg-green)",stopOpacity:0})]}),s.jsxs("linearGradient",{"code-path":"src/components/dashboard/DashboardCharts.tsx:325:17",id:"colorDisk",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:326:19",offset:"5%",stopColor:"var(--dg-purple)",stopOpacity:.3}),s.jsx("stop",{"code-path":"src/components/dashboard/DashboardCharts.tsx:327:19",offset:"95%",stopColor:"var(--dg-purple)",stopOpacity:0})]})]}),s.jsx(xt,{"code-path":"src/components/dashboard/DashboardCharts.tsx:330:15",strokeDasharray:"3 3",stroke:"var(--chart-grid)"}),s.jsx(Le,{"code-path":"src/components/dashboard/DashboardCharts.tsx:331:15",dataKey:"time",stroke:"var(--chart-axis)",fontSize:12,tickLine:!1,axisLine:!1}),s.jsx(Ie,{"code-path":"src/components/dashboard/DashboardCharts.tsx:332:15",stroke:"var(--chart-axis)",fontSize:12,tickLine:!1,axisLine:!1,unit:"%"}),s.jsx(Ae,{"code-path":"src/components/dashboard/DashboardCharts.tsx:333:15",content:s.jsx(_e,{"code-path":"src/components/dashboard/DashboardCharts.tsx:333:33"})}),s.jsx(Ne,{"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"}),s.jsx(Ne,{"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:"内存"}),s.jsx(Ne,{"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 qa({severity:t}){return s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:31:5",className:u("w-2 h-2 rounded-full flex-shrink-0 mt-1.5",t==="critical"&&"bg-[var(--dg-red)]",t==="warning"&&"bg-[var(--dg-yellow)]",t==="info"&&"bg-[var(--dg-blue)]")})}function Wa({severity:t}){return s.jsx(L,{"code-path":"src/components/dashboard/DashboardRecent.tsx:45:5",variant:"outline",className:u("text-xs font-medium",t==="critical"&&"dg-badge-red border",t==="warning"&&"dg-badge-yellow border",t==="info"&&"dg-badge-blue border"),children:t==="critical"?"严重":t==="warning"?"警告":"提示"})}function Ga({alerts:t}){const a=ie(),r=t.filter(e=>e.status==="firing").slice(0,8);return s.jsxs(B,{"code-path":"src/components/dashboard/DashboardRecent.tsx:64:5",className:"dg-card dg-card-hover",children:[s.jsx(U,{"code-path":"src/components/dashboard/DashboardRecent.tsx:65:7",className:"pb-2",children:s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:66:9",className:"flex items-center justify-between",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:67:11",children:[s.jsx(z,{"code-path":"src/components/dashboard/DashboardRecent.tsx:68:13",className:"text-[var(--dg-text-primary)]",children:"告警消息"}),s.jsx(V,{"code-path":"src/components/dashboard/DashboardRecent.tsx:69:13",className:"text-[var(--dg-text-muted)]",children:"最近触发的告警事件"})]}),s.jsxs(se,{"code-path":"src/components/dashboard/DashboardRecent.tsx:71:11",variant:"ghost",size:"sm",className:"dg-btn-ghost text-xs",onClick:()=>a("/alerts"),children:["查看全部",s.jsx(le,{"code-path":"src/components/dashboard/DashboardRecent.tsx:78:13",className:"h-3.5 w-3.5 ml-1"})]})]})}),s.jsx(q,{"code-path":"src/components/dashboard/DashboardRecent.tsx:82:7",children:s.jsx(rt,{"code-path":"src/components/dashboard/DashboardRecent.tsx:83:9",className:"h-[320px] scrollbar-thin",children:r.length===0?s.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:[s.jsx(nt,{"code-path":"src/components/dashboard/DashboardRecent.tsx:86:15",className:"h-10 w-10 mb-3 opacity-30"}),s.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:87:15",className:"text-sm",children:"暂无告警事件"}),s.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:88:15",className:"text-xs mt-1 opacity-60",children:"所有系统运行正常"})]}):s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:91:13",className:"space-y-1.5 pr-2",children:r.map(e=>s.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:()=>a("/alert-center"),children:[s.jsx(qa,{"code-path":"src/components/dashboard/DashboardRecent.tsx:98:19",severity:e.severity||"info"}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:99:19",className:"flex-1 min-w-0",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:100:21",className:"flex items-center gap-2 flex-wrap",children:[s.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}),s.jsx(Wa,{"code-path":"src/components/dashboard/DashboardRecent.tsx:104:23",severity:e.severity||"info"})]}),s.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:106:21",className:"text-xs text-[var(--dg-text-muted)] mt-1",children:e.target}),s.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})]}),s.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 Ha({expCerts:t}){const a=(t??[]).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=a.filter(o=>o.daysUntilExpiry<30).length,e=a.filter(o=>o.daysUntilExpiry>=30&&o.daysUntilExpiry<60).length;return s.jsxs(B,{"code-path":"src/components/dashboard/DashboardRecent.tsx:134:5",className:"dg-card dg-card-hover",children:[s.jsx(U,{"code-path":"src/components/dashboard/DashboardRecent.tsx:135:7",className:"pb-2",children:s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:136:9",className:"flex items-center justify-between flex-wrap gap-2",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:137:11",children:[s.jsx(z,{"code-path":"src/components/dashboard/DashboardRecent.tsx:138:13",className:"text-[var(--dg-text-primary)]",children:"证书到期提醒"}),s.jsx(V,{"code-path":"src/components/dashboard/DashboardRecent.tsx:139:13",className:"text-[var(--dg-text-muted)]",children:"SSL证书到期时间监控"})]}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:141:11",className:"flex items-center gap-2",children:[r>0&&s.jsxs(L,{"code-path":"src/components/dashboard/DashboardRecent.tsx:143:15",className:"dg-badge-red border",children:[s.jsx(nt,{"code-path":"src/components/dashboard/DashboardRecent.tsx:144:17",className:"h-3 w-3 mr-1"}),r," 即将过期"]}),e>0&&s.jsxs(L,{"code-path":"src/components/dashboard/DashboardRecent.tsx:149:15",className:"dg-badge-yellow border",children:[e," 30天内过期"]})]})]})}),s.jsx(q,{"code-path":"src/components/dashboard/DashboardRecent.tsx:156:7",children:s.jsx(rt,{"code-path":"src/components/dashboard/DashboardRecent.tsx:157:9",className:"h-[280px] scrollbar-thin",children:a.length===0?s.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:[s.jsx(Me,{"code-path":"src/components/dashboard/DashboardRecent.tsx:160:15",className:"h-10 w-10 mb-3 opacity-30"}),s.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:161:15",className:"text-sm",children:"暂无证书数据"})]}):s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:164:13",className:"space-y-1.5 pr-2",children:a.map(o=>s.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:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:170:19",className:"flex items-center gap-3 min-w-0",children:[s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:171:21",className:u("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:s.jsx(Me,{"code-path":"src/components/dashboard/DashboardRecent.tsx:179:23",className:u("h-4 w-4",o.daysUntilExpiry<30?"text-[var(--dg-red)]":o.daysUntilExpiry<60?"text-[var(--dg-yellow)]":"text-[var(--dg-green)]")})}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:186:21",className:"min-w-0",children:[s.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}),s.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)]})]})]}),s.jsx(L,{"code-path":"src/components/dashboard/DashboardRecent.tsx:191:19",variant:"outline",className:u("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 Za({releases:t}){const a=ie(),r=t?.slice(0,5)??[];return s.jsxs(B,{"code-path":"src/components/dashboard/DashboardRecent.tsx:217:5",className:"dg-card dg-card-hover",children:[s.jsx(U,{"code-path":"src/components/dashboard/DashboardRecent.tsx:218:7",className:"pb-2",children:s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:219:9",className:"flex items-center justify-between",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:220:11",children:[s.jsx(z,{"code-path":"src/components/dashboard/DashboardRecent.tsx:221:13",className:"text-[var(--dg-text-primary)]",children:"发布历史"}),s.jsx(V,{"code-path":"src/components/dashboard/DashboardRecent.tsx:222:13",className:"text-[var(--dg-text-muted)]",children:"今日应用发布记录"})]}),s.jsxs(se,{"code-path":"src/components/dashboard/DashboardRecent.tsx:224:11",variant:"ghost",size:"sm",className:"dg-btn-ghost text-xs",onClick:()=>a("/pipelines"),children:["查看全部",s.jsx(le,{"code-path":"src/components/dashboard/DashboardRecent.tsx:231:13",className:"h-3.5 w-3.5 ml-1"})]})]})}),s.jsx(q,{"code-path":"src/components/dashboard/DashboardRecent.tsx:235:7",children:r.length===0?s.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:[s.jsx(Ke,{"code-path":"src/components/dashboard/DashboardRecent.tsx:238:13",className:"h-10 w-10 mb-3 opacity-30"}),s.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:239:13",className:"text-sm",children:"暂无发布记录"})]}):s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:242:11",className:"space-y-2",children:r.map(e=>s.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:[s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:248:17",className:u("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:s.jsx(Ke,{"code-path":"src/components/dashboard/DashboardRecent.tsx:257:19",className:u("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)]")})}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:265:17",className:"flex-1 min-w-0",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:266:19",className:"flex items-center gap-2",children:[s.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}),s.jsx(L,{"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})]}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:272:19",className:"flex items-center gap-2 mt-0.5",children:[s.jsx("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:273:21",className:"text-xs text-[var(--dg-text-muted)]",children:e.environment}),s.jsx("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:274:21",className:"text-xs text-[var(--dg-border)]",children:"·"}),s.jsx("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:275:21",className:"text-xs text-[var(--dg-text-muted)] truncate",children:e.commit_id})]})]}),s.jsx(L,{"code-path":"src/components/dashboard/DashboardRecent.tsx:278:17",variant:"outline",className:u("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 Xa({servers:t}){const a=ie(),r=t.filter(n=>n.status==="running").length,e=t.filter(n=>n.status==="stopped").length,o=t.filter(n=>n.status==="maintenance").length;return s.jsxs(B,{"code-path":"src/components/dashboard/DashboardRecent.tsx:309:5",className:"dg-card dg-card-hover",children:[s.jsx(U,{"code-path":"src/components/dashboard/DashboardRecent.tsx:310:7",className:"pb-2",children:s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:311:9",className:"flex items-center justify-between",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:312:11",children:[s.jsx(z,{"code-path":"src/components/dashboard/DashboardRecent.tsx:313:13",className:"text-[var(--dg-text-primary)]",children:"服务器状态"}),s.jsx(V,{"code-path":"src/components/dashboard/DashboardRecent.tsx:314:13",className:"text-[var(--dg-text-muted)]",children:"服务器运行状态分布"})]}),s.jsxs(se,{"code-path":"src/components/dashboard/DashboardRecent.tsx:316:11",variant:"ghost",size:"sm",className:"dg-btn-ghost text-xs",onClick:()=>a("/servers"),children:["查看全部",s.jsx(le,{"code-path":"src/components/dashboard/DashboardRecent.tsx:323:13",className:"h-3.5 w-3.5 ml-1"})]})]})}),s.jsxs(q,{"code-path":"src/components/dashboard/DashboardRecent.tsx:327:7",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:329:9",className:"grid grid-cols-3 gap-3 mb-4",children:[s.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:[s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:331:13",className:"text-2xl font-bold text-[var(--dg-green)]",children:r}),s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:332:13",className:"text-xs text-[var(--dg-text-muted)] mt-1",children:"运行中"})]}),s.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:[s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:335:13",className:"text-2xl font-bold text-[var(--dg-yellow)]",children:o}),s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:336:13",className:"text-xs text-[var(--dg-text-muted)] mt-1",children:"维护中"})]}),s.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:[s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:339:13",className:"text-2xl font-bold text-[var(--dg-text-muted)]",children:e}),s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:340:13",className:"text-xs text-[var(--dg-text-muted)] mt-1",children:"已停止"})]})]}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:345:9",className:"space-y-1.5",children:[t.slice(0,4).map(n=>s.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:[s.jsx(Pt,{"code-path":"src/components/dashboard/DashboardRecent.tsx:351:15",className:u("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)]")}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:359:15",className:"flex-1 min-w-0",children:[s.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:360:17",className:"text-sm text-[var(--dg-text-primary)] truncate",children:n.hostname}),s.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:361:17",className:"text-xs text-[var(--dg-text-muted)]",children:n.ip})]}),s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:363:15",className:"text-right flex-shrink-0",children:[s.jsxs("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:364:17",className:"text-xs text-[var(--dg-text-muted)]",children:["CPU ",s.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),"%"]})]}),s.jsxs("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:367:17",className:"text-xs text-[var(--dg-text-muted)]",children:["内存 ",s.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)),t.length===0&&s.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:[s.jsx(ct,{"code-path":"src/components/dashboard/DashboardRecent.tsx:375:15",className:"h-8 w-8 mb-2 opacity-30"}),s.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:376:15",className:"text-sm",children:"暂无服务器"})]})]})]})]})}function Ya({clusters:t}){const a=ie();return s.jsxs(B,{"code-path":"src/components/dashboard/DashboardRecent.tsx:389:5",className:"dg-card dg-card-hover",children:[s.jsx(U,{"code-path":"src/components/dashboard/DashboardRecent.tsx:390:7",className:"pb-2",children:s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:391:9",className:"flex items-center justify-between",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:392:11",children:[s.jsx(z,{"code-path":"src/components/dashboard/DashboardRecent.tsx:393:13",className:"text-[var(--dg-text-primary)]",children:"Kubernetes 集群"}),s.jsx(V,{"code-path":"src/components/dashboard/DashboardRecent.tsx:394:13",className:"text-[var(--dg-text-muted)]",children:"Kubernetes集群健康状态"})]}),s.jsxs(se,{"code-path":"src/components/dashboard/DashboardRecent.tsx:396:11",variant:"ghost",size:"sm",className:"dg-btn-ghost text-xs",onClick:()=>a("/kubernetes"),children:["查看全部",s.jsx(le,{"code-path":"src/components/dashboard/DashboardRecent.tsx:403:13",className:"h-3.5 w-3.5 ml-1"})]})]})}),s.jsx(q,{"code-path":"src/components/dashboard/DashboardRecent.tsx:407:7",children:t.length===0?s.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:[s.jsx(Be,{"code-path":"src/components/dashboard/DashboardRecent.tsx:410:13",className:"h-10 w-10 mb-3 opacity-30"}),s.jsx("p",{"code-path":"src/components/dashboard/DashboardRecent.tsx:411:13",className:"text-sm",children:"暂无集群数据"})]}):s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:414:11",className:"space-y-3",children:t.map(r=>{const e=Number(r.cpu_usage??0),o=Number(r.memory_usage??0);return s.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:()=>a(`/kubernetes/${r.code||r.id}`),children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:424:19",className:"flex items-center justify-between mb-3",children:[s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:425:21",className:"flex items-center gap-2.5",children:[s.jsx(Be,{"code-path":"src/components/dashboard/DashboardRecent.tsx:426:23",className:"h-4.5 w-4.5 text-[var(--dg-blue)]"}),s.jsx("span",{"code-path":"src/components/dashboard/DashboardRecent.tsx:427:23",className:"text-sm font-semibold text-[var(--dg-text-primary)]",children:r.name})]}),s.jsx(L,{"code-path":"src/components/dashboard/DashboardRecent.tsx:429:21",variant:"outline",className:u("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"?"警告":"异常"})]}),s.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=>s.jsxs("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:448:23",className:"p-1.5 rounded-lg bg-[var(--dg-bg-primary)]/50",children:[s.jsx("div",{"code-path":"src/components/dashboard/DashboardRecent.tsx:449:25",className:"text-sm font-semibold text-[var(--dg-text-primary)]",children:n.value}),s.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 xe({variant:t="card",className:a}){const r="dg-skeleton";return t==="stat"?s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:22:7",className:u("dg-card p-6 space-y-4",a),children:[s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:23:9",className:"flex items-start justify-between",children:[s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:24:11",className:"space-y-3 flex-1",children:[s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:25:13",className:u("h-4 w-24 rounded",r)}),s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:26:13",className:u("h-8 w-16 rounded",r)})]}),s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:28:11",className:u("h-10 w-10 rounded-lg",r)})]}),s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:30:9",className:u("h-3 w-32 rounded",r)})]}):t==="chart"?s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:37:7",className:u("dg-card p-6 space-y-4",a),children:[s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:38:9",className:"space-y-2",children:[s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:39:11",className:u("h-5 w-32 rounded",r)}),s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:40:11",className:u("h-3 w-48 rounded",r)})]}),s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:42:9",className:u("h-[200px] rounded-lg",r)})]}):t==="table"?s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:49:7",className:u("dg-card overflow-hidden",a),children:[s.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:[s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:52:11",className:u("h-4 w-8 rounded",r)}),Array.from({length:6}).map((e,o)=>s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:54:13",className:u("h-4 flex-1 rounded",r)},o))]}),Array.from({length:5}).map((e,o)=>s.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:[s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:60:13",className:u("h-4 w-8 rounded",r)}),Array.from({length:6}).map((n,c)=>s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:62:15",className:u("h-4 flex-1 rounded",r)},c))]},o))]}):s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:72:5",className:u("dg-card p-6 space-y-4",a),children:[s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:73:7",className:"space-y-2",children:[s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:74:9",className:u("h-5 w-40 rounded",r)}),s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:75:9",className:u("h-3 w-56 rounded",r)})]}),s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:77:7",className:"space-y-3",children:Array.from({length:4}).map((e,o)=>s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:79:11",className:"flex items-center gap-3",children:[s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:80:13",className:u("h-8 w-8 rounded-lg",r)}),s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:81:13",className:"flex-1 space-y-2",children:[s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:82:15",className:u("h-3 w-full rounded",r)}),s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:83:15",className:u("h-3 w-2/3 rounded",r)})]})]},o))})]})}function Ja({count:t=4}){return s.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:t}).map((a,r)=>s.jsx(xe,{"code-path":"src/components/layout/SkeletonCard.tsx:99:9",variant:"stat"},r))})}function Qa(){return s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:110:5",className:"space-y-6",children:[s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:112:7",className:"flex items-center justify-between",children:[s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:113:9",className:"space-y-2",children:[s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:114:11",className:"dg-skeleton h-7 w-24 rounded"}),s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:115:11",className:"dg-skeleton h-4 w-48 rounded"})]}),s.jsx("div",{"code-path":"src/components/layout/SkeletonCard.tsx:117:9",className:"dg-skeleton h-9 w-20 rounded-lg"})]}),s.jsx(Ja,{"code-path":"src/components/layout/SkeletonCard.tsx:121:7",count:4}),s.jsx(xe,{"code-path":"src/components/layout/SkeletonCard.tsx:124:7",variant:"chart"}),s.jsxs("div",{"code-path":"src/components/layout/SkeletonCard.tsx:127:7",className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsx(xe,{"code-path":"src/components/layout/SkeletonCard.tsx:128:9",variant:"list"}),s.jsx(xe,{"code-path":"src/components/layout/SkeletonCard.tsx:129:9",variant:"list"})]})]})}function ls(){const t=ie(),[a,r]=A.useState(!0),[e,o]=A.useState(!1),[n,c]=A.useState(null),[d,l]=A.useState([]),[i,p]=A.useState([]),[x,b]=A.useState([]),[N,f]=A.useState([]),[h,v]=A.useState([]),[y,j]=A.useState([]),k=A.useCallback(async()=>{o(!0);try{const[D,M,O,W,G,E]=await Promise.all([he.getStats().catch(R=>(console.error("Failed to fetch dashboard stats:",R),null)),Ct.getServers({page:1,page_size:100}).catch(R=>(console.error("Failed to fetch servers:",R),null)),kt.getClusters().catch(R=>(console.error("Failed to fetch k8s clusters:",R),null)),he.getAlerts(10).catch(R=>(console.error("Failed to fetch dashboard alerts:",R),null)),he.getReleases(5).catch(R=>(console.error("Failed to fetch dashboard releases:",R),null)),he.getMetrics(6).catch(R=>(console.error("Failed to fetch metrics:",R),[]))]);c(D),l(M?.list??[]),p(O?.list??[]),b(Array.isArray(W)?W:[]),f(Array.isArray(G)?G:[]),v(D?.expiring_certs??[]),j(Array.isArray(E)?E:[])}catch(D){console.error("Failed to load dashboard data:",D)}finally{o(!1),r(!1)}},[]);if(A.useEffect(()=>{k();const D=setInterval(k,5e3);return()=>clearInterval(D)},[k]),a)return s.jsx(Qa,{"code-path":"src/components/dashboard/Dashboard.tsx:94:12"});const S=n?.server_stats,w=n?.kubernetes_stats,_=n?.alert_stats,F=n?.cost_stats;return s.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:103:5",className:"dg-page",children:[s.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:105:7",className:"dg-page-header",children:[s.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:106:9",children:[s.jsx("h1",{"code-path":"src/components/dashboard/Dashboard.tsx:107:11",className:"dg-page-title",children:"仪表盘"}),s.jsxs("p",{"code-path":"src/components/dashboard/Dashboard.tsx:108:11",className:"dg-page-subtitle",children:["实时监控和运维概览 · 最后更新: ",new Date().toLocaleTimeString("zh-CN")]})]}),s.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:110:9",className:"dg-page-actions",children:[s.jsxs(se,{"code-path":"src/components/dashboard/Dashboard.tsx:111:11",variant:"outline",className:"dg-btn-secondary",onClick:k,disabled:e,children:[s.jsx(_t,{"code-path":"src/components/dashboard/Dashboard.tsx:117:13",className:u("h-4 w-4",e&&"animate-spin")}),e?"刷新中":"刷新"]}),s.jsxs(se,{"code-path":"src/components/dashboard/Dashboard.tsx:120:11",className:"dg-btn-primary",onClick:()=>t("/servers"),children:[s.jsx(ct,{"code-path":"src/components/dashboard/Dashboard.tsx:124:13",className:"h-4 w-4"}),"服务器",s.jsx(le,{"code-path":"src/components/dashboard/Dashboard.tsx:126:13",className:"h-3.5 w-3.5"})]})]})]}),s.jsx("div",{"code-path":"src/components/dashboard/Dashboard.tsx:132:7",className:"animate-fade-in-delay-1",children:s.jsx(Rt,{"code-path":"src/components/dashboard/Dashboard.tsx:133:9",items:[{label:"服务器",value:S?.total??0,color:"blue"},{label:"运行中",value:S?.running??0,color:"emerald"},{label:"K8s 集群",value:w?.total??0,color:"purple"},{label:"健康集群",value:w?.healthy??0,color:"cyan"},{label:"告警",value:_?.firing??0,color:_?.firing>0?"red":"muted"},{label:"严重",value:_?.critical??0,color:"red"},{label:"本月成本",value:`¥${Number(F?.month_cost??0).toLocaleString()}`,color:"amber"}]})}),s.jsx("div",{"code-path":"src/components/dashboard/Dashboard.tsx:147:7",className:"animate-fade-in-delay-2",children:s.jsx(Va,{"code-path":"src/components/dashboard/Dashboard.tsx:148:9",avgCpu:Number(S?.avg_cpu??0),avgMemory:Number(S?.avg_memory??0),avgDisk:Number(S?.avg_disk??0),metrics:y})}),s.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:157:7",className:"grid grid-cols-1 lg:grid-cols-2 gap-6 animate-fade-in-delay-3",children:[s.jsx(Ua,{"code-path":"src/components/dashboard/Dashboard.tsx:158:9",costStats:F}),s.jsx(za,{"code-path":"src/components/dashboard/Dashboard.tsx:159:9",topUsage:n?.top_resource_usage})]}),s.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:163:7",className:"grid grid-cols-1 lg:grid-cols-2 gap-6 animate-fade-in-delay-3",children:[s.jsx(Ga,{"code-path":"src/components/dashboard/Dashboard.tsx:164:9",alerts:x}),s.jsx(Ha,{"code-path":"src/components/dashboard/Dashboard.tsx:165:9",expCerts:h})]}),s.jsxs("div",{"code-path":"src/components/dashboard/Dashboard.tsx:169:7",className:"grid grid-cols-1 lg:grid-cols-3 gap-6 animate-fade-in-delay-4",children:[s.jsx(Za,{"code-path":"src/components/dashboard/Dashboard.tsx:170:9",releases:N}),s.jsx(Xa,{"code-path":"src/components/dashboard/Dashboard.tsx:171:9",servers:d}),s.jsx(Ya,{"code-path":"src/components/dashboard/Dashboard.tsx:172:9",clusters:i})]})]})}export{ls as Dashboard};
|