|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[579],{58074:function(e,t,i){i.r(t);var n=i(7557),s=i.n(n),l=i(41498),r=i.n(l),o=i(79800),a=i.n(o),d=i(39647),c=i.n(d),p=i(59301),u=i(92736),h=i(27513),g=i(41473),f=i(81863),x=i(90136),y=i(56766),v=i(79460),m=i(7121),j=i(75745),w=i(42441),S=i(37712),_=["loading","globalSetting","children","user","dispatch","location"];t.default=(0,x.connect)((function(e){return{loading:e.loading,globalSetting:e.globalSetting,user:e.user}}))((function(e){e.loading,e.globalSetting,e.children,e.user,e.dispatch,e.location,c()(e,_);var t=(0,p.useState)(),i=a()(t,2),n=i[0],l=i[1],o=(0,p.useState)(),d=a()(o,2),x=d[0],k=d[1],b=(0,p.useState)(),z=a()(b,2),I=z[0],T=z[1],W=(0,p.useState)(),Z=a()(W,2),F=Z[0],A=Z[1],C=(0,p.useState)({page_index:1,page_size:10}),P=a()(C,2),R=P[0],q=P[1],E=(0,p.useState)({page_index:1,page_size:10}),L=a()(E,2),D=L[0],B=L[1];function U(){return(U=r()(s()().mark((function e(){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.ZP)("/api/sys/resource",{method:"get"});case 2:t=e.sent,l(t),sessionStorage.setItem("indexstatus",null==t?void 0:t.status);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(){return(G=r()(s()().mark((function e(){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.ZP)("/api/sys/network_speed",{method:"get"});case 2:t=e.sent,k(null==t?void 0:t.network_speed);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(){return N.apply(this,arguments)}function N(){return(N=r()(s()().mark((function e(){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.ZP)("/api/sys/login_info",{method:"get"});case 2:t=e.sent,T(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(){return H.apply(this,arguments)}function H(){return(H=r()(s()().mark((function e(){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.ZP)("/api/sys/request_info",{method:"get",params:R});case 2:t=e.sent,A(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,p.useEffect)((function(){sessionStorage.setItem("indexstatus",0),setInterval((function(){!function(){U.apply(this,arguments)}()}),2e3),function(){G.apply(this,arguments)}(),J(),O()}),[]),(0,S.jsx)(u.ZP,{locale:f.Z,children:(0,S.jsxs)("div",{style:{width:1200,margin:"auto",marginTop:15},children:[(0,S.jsx)("div",{style:{marginBottom:15,color:"#666666",textAlign:"end"},children:"状态刷新时间间隔:2秒"}),(0,S.jsxs)("div",{style:{display:"flex"},children:[(0,S.jsxs)("div",{style:{height:150,width:"19%",marginRight:20,background:"#fff",padding:20},children:[(0,S.jsx)("div",{style:{color:"#333333",fontSize:16,fontWeight:500},children:"平台状态"}),(0,S.jsx)("div",{style:{marginTop:33,fontSize:24,color:"#13A88F"},children:0===(null==n?void 0:n.status)?"正常":"异常"})]}),(0,S.jsxs)("div",{style:{height:150,width:"19%",marginRight:20,background:"#fff",padding:20},children:[(0,S.jsx)("div",{style:{color:"#333333",fontSize:16,fontWeight:500},children:"在线人数"}),(0,S.jsx)("div",{style:{marginTop:33,fontSize:24,color:"#020202"},children:null==n?void 0:n.online})]}),(0,S.jsxs)("div",{style:{height:150,width:"62%",background:"#fff",padding:20},children:[(0,S.jsx)("div",{style:{color:"#333333",fontSize:16,fontWeight:500},children:"系统负载"}),(0,S.jsxs)("div",{style:{marginTop:20,display:"flex",justifyContent:"space-between"},children:[(0,S.jsxs)("div",{style:{display:"flex"},children:[(0,S.jsx)("img",{src:y,style:{width:68,height:65}}),(0,S.jsxs)("div",{style:{marginLeft:15},children:[(0,S.jsxs)("div",{style:{fontSize:24,color:"#000000",fontWeight:"bold"},children:[null==n?void 0:n.cpu_percent,"%"]}),(0,S.jsx)("div",{style:{marginTop:4,color:"#585858",fontWeight:400,fontSize:14},children:"CPU占用率"})]})]}),(0,S.jsxs)("div",{style:{display:"flex"},children:[(0,S.jsx)("img",{src:v,style:{width:68,height:65}}),(0,S.jsxs)("div",{style:{marginLeft:15},children:[(0,S.jsxs)("div",{style:{fontSize:24,color:"#000000",fontWeight:"bold"},children:[null==n?void 0:n.memory_percent,"%"]}),(0,S.jsx)("div",{style:{marginTop:4,color:"#585858",fontWeight:400,fontSize:14},children:"内存占用率"})]})]}),(0,S.jsxs)("div",{style:{display:"flex"},children:[(0,S.jsx)("img",{src:m,style:{width:68,height:65}}),(0,S.jsxs)("div",{style:{marginLeft:15},children:[(0,S.jsxs)("div",{style:{fontSize:24,color:"#000000",fontWeight:"bold"},children:[null==n?void 0:n.io_percent,"%"]}),(0,S.jsx)("div",{style:{marginTop:4,color:"#585858",fontWeight:400,fontSize:14},children:"磁盘占用率"})]})]})]})]})]}),(0,S.jsxs)("div",{style:{marginTop:20,padding:20,background:"#fff"},children:[(0,S.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,S.jsx)("div",{style:{color:"#333333",fontSize:16,fontWeight:500},children:"访问延迟"}),(0,S.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,S.jsx)("div",{children:(0,S.jsxs)("div",{style:{display:"flex",alignItems:"center",marginRight:10},children:[(0,S.jsx)("span",{style:{display:"inline-flex",width:11,height:1,background:"#4A6FE4"}}),(0,S.jsx)("span",{style:{display:"inline-flex",width:9,height:9,borderRadius:"50%",border:"1px solid #4A6FE4"}}),(0,S.jsx)("span",{style:{display:"inline-flex",width:11,height:1,background:"#4A6FE4"}})]})}),(0,S.jsx)("div",{style:{color:"#585858",fontSize:14},children:"某时间上的宽带速度"})]})]}),(0,S.jsx)(w.Z,{option:{color:["#3398DB"],tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},xAxis:{type:"category",boundaryGap:!1,data:null==x?void 0:x.map((function(e){return null==e?void 0:e.timestamp}))},yAxis:{type:"value"},series:[{data:null==x?void 0:x.map((function(e){return null==e?void 0:e.download_speed_mbps})),type:"line",areaStyle:{}}]},style:{height:400,width:1200},opts:{renderer:"svg"}})]}),(0,S.jsxs)("div",{style:{marginTop:20,padding:20,background:"#fff",height:500},children:[(0,S.jsx)("div",{style:{color:"#333333",fontSize:16,fontWeight:500},children:"最近请求"}),(0,S.jsx)(h.Z,{dataSource:null==F?void 0:F.request_info,style:{marginTop:20},scroll:{y:300},columns:[{title:"接口URL",dataIndex:"url",key:"url"},{title:"请求参数",dataIndex:"request_json",key:"request_json",ellipsis:!0},{title:"返回参数",dataIndex:"response_data",key:"response_data",ellipsis:!0,render:function(e){return JSON.stringify(e)}},{title:"时间",dataIndex:"time",key:"time"}],pagination:!1}),(0,S.jsx)(g.Z,{showTotal:function(e){return(0,S.jsxs)("div",{children:["共",(0,S.jsx)("span",{style:{color:"#165DFF"},children:e}),"条数据"]})},current:R.page_index,onChange:function(e,t){R.page_index=e,R.page_size=t,q(R),O()},total:null==F?void 0:F.total,style:{marginTop:20}})]}),(0,S.jsxs)("div",{style:{marginTop:20,padding:20,background:"#fff",height:500},children:[(0,S.jsx)("div",{style:{color:"#333333",fontSize:16,fontWeight:500},children:"最近登录"}),(0,S.jsx)(h.Z,{dataSource:null==I?void 0:I.login_info,style:{marginTop:20},scroll:{y:300},columns:[{title:"序号",dataIndex:"number",align:"center",width:50,ellipsis:{showTitle:!1},render:function(e,t,i){return D.page_size*(D.page_index-1)+i+1}},{title:"姓名",dataIndex:"name",key:"name",ellipsis:!0},{title:"学号/工号",dataIndex:"id_number",key:"id_number",ellipsis:!0},{title:"手机号码",dataIndex:"phone",key:"phone",ellipsis:!0},{title:"单位",dataIndex:"unit",key:"unit",ellipsis:!0},{title:"邮箱地址",dataIndex:"email",key:"email",ellipsis:!0},{title:"角色",dataIndex:"role",key:"role",ellipsis:!0},{title:"最近登录时间",dataIndex:"last_login",key:"last_login"}],pagination:!1}),(0,S.jsx)(g.Z,{showTotal:function(e){return(0,S.jsxs)("div",{children:["共",(0,S.jsx)("span",{style:{color:"#165DFF"},children:e}),"条数据"]})},current:R.page_index,onChange:function(e,t){D.page_index=e,D.page_size=t,B(D),J()},total:null==I?void 0:I.total,style:{marginTop:20}})]})]})})}))}}]); |