forked from bytedance/Elkeid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path23c2f3.68.min.js
1 lines (1 loc) · 2.5 KB
/
23c2f3.68.min.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[68,109],{155:function(e,n,t){"use strict";t.r(n);var o=t(20),l=t.n(o),a=t(0),r=t.n(a),c=t(86),i=t.n(c),u=t(571),m=t(533),d=t.n(m),s="/data00/webprojectdev/hids_open/src/pages/host-list/host-status/index.tsx",f=i.a.bind(d.a);n.default=function(e){var n=e.data,t=Object(a.useMemo)((function(){var e,t,o,l;return[{count:null!==(e=null==n?void 0:n.running)&&void 0!==e?e:0,label:"运行中",color:"#22BB43"},{count:null!==(t=null==n?void 0:n.abnormal)&&void 0!==t?t:0,label:"运行异常",color:"#FBB02E"},{count:null!==(o=null==n?void 0:n.offline)&&void 0!==o?o:0,label:"离线",color:"#EB635E"},{count:null!==(l=null==n?void 0:n.uninstalled)&&void 0!==l?l:0,label:"未安装",color:"#E5E8EF"}]}),[n]),o=[50,70],c="30%",i="50%",m=Object(a.useState)({}),d=l()(m,2),b=d[0],v=d[1];return Object(a.useEffect)((function(){v({legend:{selectedMode:!1,data:t.map((function(e){return{name:e.label,itemStyle:{color:e.color}}})),top:"center",cursor:"default",right:"20px",orient:"vertical",icon:"circle",itemWidth:10,itemHeight:10,itemGap:20,formatter:function(e){var n;return" {name|".concat(e,"} {count|").concat(null!==(n=t[null==t?void 0:t.findIndex((function(n){return n.label===e}))].count)&&void 0!==n?n:0,"}")},textStyle:{color:"#606A78",fontFamily:"PingFang Sc",fontSize:12,rich:{name:{width:48},count:{fontFamily:'"ByteNumber Bold"',color:"#000000"}}}},series:[{type:"pie",radius:o,center:[c,i],label:{show:!0,position:"outer",alignTo:"none",bleedMargin:5,color:"#606A78",fontFamily:"PingFang Sc",fontSize:12,formatter:"{b}: {d}%"},labelLine:{show:!0},data:null==t?void 0:t.map((function(e){return{value:e.count,name:e.label,itemStyle:{color:e.color,borderColor:"#fff",borderWidth:1}}}))}]})}),[t]),r.a.createElement("div",{className:f("chart-container"),__source:{fileName:s,lineNumber:98,columnNumber:5}},r.a.createElement("div",{className:f("title"),__source:{fileName:s,lineNumber:99,columnNumber:7}},"主机状态分布"),r.a.createElement("div",{className:f("chart-box"),__source:{fileName:s,lineNumber:101,columnNumber:7}},r.a.createElement("div",{className:f("center-info"),style:{left:c,top:i,transform:"translate(-50%, -50%)"},__source:{fileName:s,lineNumber:102,columnNumber:9}},null),r.a.createElement(u.a,{option:b,style:{width:"100%",height:"100%"},__source:{fileName:s,lineNumber:112,columnNumber:9}})))}},533:function(e,n,t){e.exports={"chart-container":"chart-container-54bc00c87d",title:"title-c3c1c24ffc","chart-box":"chart-box-940e57ba0c","center-info":"center-info-26f50a5033"}}}]);