沙钢智慧能源系统前端代码
houzhongjian
2024-10-09 314507f8ddadd9c66e98d260c3b2a5dad1a04015
1
import{aV as D,d as k,r as A,A as w,b as z,o as C,g as E,B as l,k as o,O as r,D as i,a as s,am as B,ap as L,b3 as O}from"./index-BP6bNRoi.js";import{_ as R}from"./Echart.vue_vue_type_script_setup_true_lang-CUhHxp-X.js";import{E as T}from"./el-card-bU92WWV4.js";import{E as I,a as K}from"./el-descriptions-item-BuMEVwqR.js";const b=()=>D.get({url:"/infra/redis/get-monitor-info"}),N=k({__name:"index",setup(P){const t=A(),d=w({title:{text:"\u5185\u5B58\u4F7F\u7528\u60C5\u51B5",left:"center",show:!0,offsetCenter:[0,"20%"],color:"yellow",fontSize:20},toolbox:{show:!1,feature:{restore:{show:!0},saveAsImage:{show:!0}}},series:[{name:"\u5CF0\u503C",type:"gauge",min:0,max:50,splitNumber:10,color:"#F5C74E",radius:"85%",center:["50%","50%"],startAngle:225,endAngle:-45,axisLine:{lineStyle:{color:[[.2,"#7FFF00"],[.8,"#00FFFF"],[1,"#FF0000"]],width:10}},axisTick:{length:5,lineStyle:{color:"#76D9D7"}},splitLine:{length:20,lineStyle:{color:"#76D9D7"}},axisLabel:{color:"#76D9D7",distance:15,fontSize:15},pointer:{width:7,show:!0},detail:{textStyle:{fontWeight:"normal",fontSize:15,color:"#FFFFFF"},valueAnimation:!0},progress:{show:!0}}]}),c=w({title:{text:"\u547D\u4EE4\u7EDF\u8BA1",left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{type:"scroll",orient:"vertical",right:30,top:10,bottom:20,data:[],textStyle:{color:"#a1a1a1"}},series:[{name:"\u547D\u4EE4",type:"pie",radius:[20,120],center:["40%","60%"],data:[],roseType:"radius",label:{show:!0},emphasis:{label:{show:!0},itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}),v=async()=>{d.series[0].data=[];try{const u=await b();t.value=u;const _=[],n=[];u.commandStats.forEach(f=>{_.push({name:f.command,value:f.calls}),n.push(f.command)}),c.legend.data=n,c.series[0].data=_}catch{}},F=async()=>{try{const u=await b();t.value=u,d.series[0].detail={show:!0,offsetCenter:[0,"50%"],color:"auto",fontSize:30,formatter:t.value.info.used_memory_human},console.log(t.value.info.used_memory_human),d.series[0].data[0]={value:t.value.info.used_memory_human,name:"\u5185\u5B58\u6D88\u8017"},console.log(t.value.info),d.tooltip={formatter:"{b} <br/>{a} : "+t.value.info.used_memory_human}}catch{}};return z(()=>{(async()=>{const u=await b();t.value=u})(),v(),F()}),(u,_)=>{const n=I,f=K,h=T,p=B,g=R,x=L,S=O;return C(),E(S,{height:"calc(100vh - 88px - 40px - 50px)"},{default:l(()=>[o(x,null,{default:l(()=>[o(p,{span:24,class:"card-box",shadow:"hover"},{default:l(()=>[o(h,null,{default:l(()=>[o(f,{title:"\u57FA\u672C\u4FE1\u606F",column:6,border:""},{default:l(()=>[o(n,{label:"Redis\u7248\u672C :"},{default:l(()=>{var e,a;return[r(i((a=(e=s(t))==null?void 0:e.info)==null?void 0:a.redis_version),1)]}),_:1}),o(n,{label:"\u8FD0\u884C\u6A21\u5F0F :"},{default:l(()=>{var e,a;return[r(i(((a=(e=s(t))==null?void 0:e.info)==null?void 0:a.redis_mode)=="standalone"?"\u5355\u673A":"\u96C6\u7FA4"),1)]}),_:1}),o(n,{label:"\u7AEF\u53E3 :"},{default:l(()=>{var e,a;return[r(i((a=(e=s(t))==null?void 0:e.info)==null?void 0:a.tcp_port),1)]}),_:1}),o(n,{label:"\u5BA2\u6237\u7AEF\u6570 :"},{default:l(()=>{var e,a;return[r(i((a=(e=s(t))==null?void 0:e.info)==null?void 0:a.connected_clients),1)]}),_:1}),o(n,{label:"\u8FD0\u884C\u65F6\u95F4(\u5929) :"},{default:l(()=>{var e,a;return[r(i((a=(e=s(t))==null?void 0:e.info)==null?void 0:a.uptime_in_days),1)]}),_:1}),o(n,{label:"\u4F7F\u7528\u5185\u5B58 :"},{default:l(()=>{var e,a;return[r(i((a=(e=s(t))==null?void 0:e.info)==null?void 0:a.used_memory_human),1)]}),_:1}),o(n,{label:"\u4F7F\u7528CPU :"},{default:l(()=>{var e,a,m;return[r(i((e=s(t))!=null&&e.info?parseFloat((m=(a=s(t))==null?void 0:a.info)==null?void 0:m.used_cpu_user_children).toFixed(2):""),1)]}),_:1}),o(n,{label:"\u5185\u5B58\u914D\u7F6E :"},{default:l(()=>{var e,a;return[r(i((a=(e=s(t))==null?void 0:e.info)==null?void 0:a.maxmemory_human),1)]}),_:1}),o(n,{label:"AOF\u662F\u5426\u5F00\u542F :"},{default:l(()=>{var e,a;return[r(i(((a=(e=s(t))==null?void 0:e.info)==null?void 0:a.aof_enabled)=="0"?"\u5426":"\u662F"),1)]}),_:1}),o(n,{label:"RDB\u662F\u5426\u6210\u529F :"},{default:l(()=>{var e,a;return[r(i((a=(e=s(t))==null?void 0:e.info)==null?void 0:a.rdb_last_bgsave_status),1)]}),_:1}),o(n,{label:"Key\u6570\u91CF :"},{default:l(()=>{var e;return[r(i((e=s(t))==null?void 0:e.dbSize),1)]}),_:1}),o(n,{label:"\u7F51\u7EDC\u5165\u53E3/\u51FA\u53E3 :"},{default:l(()=>{var e,a,m,y;return[r(i((a=(e=s(t))==null?void 0:e.info)==null?void 0:a.instantaneous_input_kbps)+"kps/ "+i((y=(m=s(t))==null?void 0:m.info)==null?void 0:y.instantaneous_output_kbps)+"kps ",1)]}),_:1})]),_:1})]),_:1})]),_:1}),o(p,{span:12,class:"mt-3"},{default:l(()=>[o(h,{gutter:12,shadow:"hover"},{default:l(()=>[o(g,{options:s(c),height:420},null,8,["options"])]),_:1})]),_:1}),o(p,{span:12,class:"mt-3"},{default:l(()=>[o(h,{class:"ml-3",gutter:12,shadow:"hover"},{default:l(()=>[o(g,{options:s(d),height:420},null,8,["options"])]),_:1})]),_:1})]),_:1})]),_:1})}}});export{N as default};