chunk-2ba6aaa2.cbe6cc35.js 16 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2ba6aaa2","chunk-8d58b6c4","chunk-bafe6538","chunk-58b6ca9a","chunk-58869047","chunk-6fec2edc"],{1148:function(t,e,s){"use strict";var i=s("a691"),r=s("1d80");t.exports="".repeat||function(t){var e=String(r(this)),s="",a=i(t);if(a<0||a==1/0)throw RangeError("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(e+=e))1&a&&(s+=e);return s}},"408a":function(t,e,s){var i=s("c6b6");t.exports=function(t){if("number"!=typeof t&&"Number"!=i(t))throw TypeError("Incorrect invocation");return+t}},"484c":function(t,e,s){"use strict";var i=s("c0f3"),r=s.n(i);r.a},5152:function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"network"},[s("p",{staticClass:"title"},[t._v("流量")]),s("ul",[s("li",{staticClass:"rx",class:[t.options.legend.selected["上行"]?"on":"off"],on:{click:function(e){return t.change("上行")}}},[s("p",[t._v("上行")]),s("p",[t._v(t._s(t._f("unit_size")(t.tx_sec)))])]),s("li",{staticClass:"tx",class:[t.options.legend.selected["下载"]?"on":"off"],on:{click:function(e){return t.change("下载")}}},[s("p",[t._v("下载")]),s("p",[t._v(t._s(t._f("unit_size")(t.rx_sec)))])]),s("li",{staticClass:"send"},[s("p",[t._v("总发送")]),s("p",[t._v(t._s(t._f("unit_size")(t.tx_bytes)))])]),s("li",{staticClass:"receive"},[s("p",[t._v("总接收")]),s("p",[t._v(t._s(t._f("unit_size")(t.rx_bytes)))])])]),t.visible?s("e-charts",{attrs:{options:t.options}}):t._e()],1)},r=[],a=(s("4160"),s("a15b"),s("d81d"),s("13d5"),s("b0c0"),s("159b"),s("6678")),o=s.n(a),n=s("164e"),l=s.n(n),c=s("a9aa"),u={components:{ECharts:o.a},mixins:[c["default"]],props:{data:null},data:function(){var t=this;return{visible:!0,options:{tooltip:{trigger:"axis",axisPointer:{lineStyle:{color:"#ddd"}},backgroundColor:"rgba(255,255,255,1)",padding:[5,10],textStyle:{color:"#7588E4"},extraCssText:"box-shadow: 0 0 5px rgba(0, 0, 0, 0.3)",formatter:function(e){return e.map((function(e,s){return(0==s?"上行:":"下载:")+t.conByte(e.value)})).join("<br>")}},legend:{data:["上行","下载"],selected:{"上行":!0,"下载":!0},left:"1000%"},grid:{left:"5%",right:"2%",bottom:"10%",top:"10%"},xAxis:{type:"category",data:[],boundaryGap:!1,splitLine:{show:!0,interval:"auto",lineStyle:{color:["#D4DFF5"]}},axisTick:{show:!1},axisLine:{lineStyle:{color:"#609ee9"}},axisLabel:{margin:10,textStyle:{fontSize:14}}},yAxis:{type:"value",splitLine:{lineStyle:{color:["#D4DFF5"]}},axisTick:{show:!1},axisLine:{lineStyle:{color:"#609ee9"}},axisLabel:{margin:10,textStyle:{fontSize:14},formatter:function(e){return t.conByte(e)}}},series:[{type:"line",showSymbol:!1,symbol:"circle",symbolSize:6,data:[],areaStyle:{normal:{color:new l.a.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(255, 202, 89, 0.5)"},{offset:1,color:"rgba(255, 202, 89, 0.2)"}],!1)}},itemStyle:{normal:{color:"#f7b851"}},lineStyle:{normal:{width:1}}},{type:"line",showSymbol:!1,symbol:"circle",symbolSize:6,data:[],areaStyle:{normal:{color:new l.a.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(216, 244, 247, 1)"},{offset:1,color:"rgba(216, 244, 247, 1)"}],!1)}},itemStyle:{normal:{color:"#58c8da"}},lineStyle:{normal:{width:1}}}]},rx_bytes:0,tx_bytes:0,rx_sec:0,tx_sec:0}},methods:{change:function(t){var e=this;this.options.legend.selected[t]=!this.options.legend.selected[t],this.visible=!1,this.$nextTick((function(){e.visible=!0}))},refresh:function(t){var e=this,s=t.data,i=void 0===s?[]:s,r=t.time,a=i[i.length-1].server.network;this.rx_bytes=0,this.tx_bytes=0,a.forEach((function(t){e.rx_bytes+=t.rx_bytes,e.tx_bytes+=t.tx_bytes})),this.rx_sec=a.reduce((function(t,e){return t+e.rx_sec}),0),this.tx_sec=a.reduce((function(t,e){return t+e.tx_sec}),0),this.options.xAxis.data=r,this.options.series[0].name="上行",this.options.series[0].data=i.map((function(t){return t.server.network.reduce((function(t,e){return t+e.tx_sec}),0)})),this.options.series[1].name="下载",this.options.series[1].data=i.map((function(t){return t.server.network.reduce((function(t,e){return t+e.rx_sec}),0)}))}}},f=u,d=(s("8e67"),s("2877")),p=Object(d["a"])(f,i,r,!1,null,"58a77e35",null);e["default"]=p.exports},"550d":function(t,e,s){},"5eac":function(t,e,s){"use strict";var i=s("7f91"),r=s.n(i);r.a},"5f82":function(t,e,s){},"670e":function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"perf-redis"},[s("p",{staticClass:"title"},[t._v(" Redis ")]),s("el-row",{staticClass:"fn"},[s("el-col",{attrs:{span:8}},[s("div",{staticClass:"block"},[s("div",{staticClass:"icon _disk"},[s("icon-svg",{attrs:{name:"disk"}})],1),s("ul",{staticClass:"b"},[s("li",[s("p",[t._v("已使用")]),s("p",[t._v(t._s(t._f("unit_size")(t.used_memory)))])])])])]),s("el-col",{attrs:{span:8}},[s("div",{staticClass:"block"},[s("div",{staticClass:"icon _network"},[s("icon-svg",{attrs:{name:"network"}})],1),s("ul",{staticClass:"b"},[s("li",[s("p",[t._v("输入")]),s("p",[t._v(t._s(t._f("unit_size")(t.total_net_input_bytes)))])]),s("li",[s("p",[t._v("输出")]),s("p",[t._v(t._s(t._f("unit_size")(t.total_net_output_bytes)))])])])])]),s("el-col",{attrs:{span:8}},[s("div",{staticClass:"block"},[s("div",{staticClass:"icon _db"},[s("icon-svg",{attrs:{name:"db"}})],1),s("ul",{staticClass:"b"},t._l(t.dbList,(function(e,i){return s("li",{key:i},[s("p",[t._v(t._s(e.label))]),s("p",[t._v(t._s(e.value)+" key")])])})),0)])])],1),s("e-charts",{attrs:{options:t.chart.options}})],1)},r=[],a=(s("d81d"),s("ac1f"),s("1276"),s("a9aa")),o=s("164e"),n=s.n(o),l={mixins:[a["default"]],data:function(){return{dbList:[],chart:{options:{}},total_net_input_bytes:0,total_net_output_bytes:0,used_memory:0}},methods:{refresh:function(t){var e=t.data,s=t.time,i=e[e.length-1],r=i.redis,a=r.Keyspace,o=r.Stats,n=r.Memory,l=[];for(var c in a)l.push({label:c,value:a[c].split(",")[0].split("=")[1]});this.total_net_input_bytes=o.total_net_input_bytes,this.total_net_output_bytes=o.total_net_output_bytes,this.used_memory=n.used_memory,this.chart.options=this.onChart(s,e.map((function(t){return t.redis.Stats.instantaneous_ops_per_sec})),{color:"204, 32, 20",smooth:!1}),this.dbList=l},onChart:function(t,e){return{tooltip:{trigger:"axis",axisPointer:{lineStyle:{color:"#F56C6C"}},backgroundColor:"rgb(255,255,255)",padding:[5,10],textStyle:{color:"#F56C6C"},extraCssText:"box-shadow: 0 0 5px rgba(0, 0, 0, 0.3)",formatter:function(t){return"".concat(t[0].data," / S(每秒操作数)")}},grid:{left:"10px",right:"10px",bottom:"10px",top:"30px"},xAxis:{type:"category",show:!1,boundaryGap:!1,splitLine:{interval:"auto",lineStyle:{color:["#D4DFF5"]}},axisTick:{show:!1},axisLine:{show:!1,lineStyle:{color:"#609ee9"}},axisLabel:{margin:10,textStyle:{fontSize:12}},data:t},yAxis:{type:"value",show:!1,splitLine:{show:!0,lineStyle:{color:["#D4DFF5"]}},axisTick:{show:!1},axisLine:{show:!0,lineStyle:{color:["#609ee9"]}},axisLabel:{margin:10,textStyle:{fontSize:12}}},series:[{type:"line",smooth:!0,showSymbol:!1,symbol:"circle",symbolSize:6,data:e,markPoint:{symbolSize:30,data:[{type:"max",name:"最大值"},{type:"min",name:"最小值"}]},areaStyle:{normal:{color:new n.a.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(245, 108, 108, 0.5)"},{offset:1,color:"rgba(245, 108, 108, 0.1)"}],!1)}},itemStyle:{normal:{color:"#F56C6C"}},lineStyle:{normal:{width:1}}}]}}}},c=l,u=(s("484c"),s("2877")),f=Object(u["a"])(c,i,r,!1,null,"acfebaf4",null);e["default"]=f.exports},"7f91":function(t,e,s){},8238:function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"ct"},[s("el-row",{attrs:{gutter:20}},[s("el-col",{attrs:{xl:4,md:12}},[s("div",{staticClass:"block"},[s("p",{staticClass:"label"},[t._v("负载状态")]),s("el-popover",{attrs:{width:"100",trigger:"hover"}},[s("div",{staticClass:"system-perf-progress-popover"},[s("ul",[s("li",[t._v("CPU:"+t._s(t._f("fixed2")(t.cpu.perc))+" %")]),s("li",[t._v("内存:"+t._s(t._f("fixed2")(t.mem.perc))+" %")])])]),s("el-progress",{attrs:{slot:"reference",type:"circle",percentage:t._f("fixed2")(t.lb.perc),color:t._f("status_color")(t.lb.perc)},slot:"reference"})],1)],1)]),s("el-col",{attrs:{xl:4,md:12}},[s("div",{staticClass:"block"},[s("p",{staticClass:"label"},[t._v("CPU存使用率")]),s("el-progress",{attrs:{type:"circle",percentage:t._f("fixed2")(t.cpu.perc),color:t._f("status_color")(t.cpu.perc)}})],1)]),s("el-col",{attrs:{xl:4,md:12}},[s("div",{staticClass:"block"},[s("p",{staticClass:"label"},[t._v("内存使用率")]),s("el-popover",{attrs:{width:"100",trigger:"hover"}},[s("div",{staticClass:"system-perf-progress-popover"},[s("ul",[s("li",[t._v("总数:"+t._s(t._f("unit_size")(t.mem.total)))]),s("li",[t._v("已使用:"+t._s(t._f("unit_size")(t.mem.used)))])])]),s("el-progress",{attrs:{slot:"reference",type:"circle",percentage:t._f("fixed2")(t.mem.perc),color:t._f("status_color")(t.mem.perc)},slot:"reference"})],1)],1)]),t._l(t.disk.list,(function(e,i){return s("el-col",{key:i,attrs:{xl:4,md:12}},[s("div",{staticClass:"block"},[s("p",{staticClass:"label"},[t._v(t._s(e.mount))]),s("el-popover",{attrs:{width:"100",trigger:"hover"}},[s("div",{staticClass:"system-perf-progress-popover"},[s("ul",[s("li",[t._v("总数:"+t._s(t._f("unit_size")(e.size)))]),s("li",[t._v("已使用:"+t._s(t._f("unit_size")(e.used)))])])]),s("el-progress",{attrs:{slot:"reference",type:"circle",percentage:t._f("fixed2")(e.use),color:t._f("status_color")(e.use)},slot:"reference"})],1)],1)])}))],2)],1)},r=[],a=(s("4de4"),s("4160"),s("d81d"),s("13d5"),s("b680"),s("159b"),s("a9aa")),o={filters:{status_color:function(t){return t<50?"#67C23A":t<70?"#E6A23C":t<100?"#F56C6C":void 0}},mixins:[a["default"]],data:function(){return{lb:{perc:0},redis:{options:{},perc:0},mysql:{options:{},number:0,perc:0},cpu:{options:{},perc:0},mem:{perc:0,total:0,used:0},disk:{list:[],all:0}}},methods:{refresh:function(t){var e=t.data,s=e[e.length-1];this.toMysql(t,s.mysql),this.toRedis(t,s.redis),this.toCPU(t,s.server.cpu),this.toDisk(s.server.disk.filter((function(t){return t.size}))),this.toMem(s.server.mem),this.toLB()},toLB:function(){var t=this.mem.perc,e=this.cpu.perc;this.lb.perc=t>=90?t:e>=80?e:.4*t+.6*e},toCPU:function(t,e){this.cpu.perc=e.currentload},toMem:function(t){this.mem.perc=t.buffcache/t.total*100,this.mem.total=t.total,this.mem.used=t.buffcache},toDisk:function(t){this.disk.all=t.reduce((function(t,e){return t+e.size}),0),this.disk.list=t.map((function(t){return t.use=t.use.toFixed(2),t}))},toRedis:function(t,e){this.redis.perc=parseFloat(e.Memory.used_memory_dataset_perc)},toMysql:function(t,e){var s=0,i=0;e.mysqlSize.forEach((function(t){s+=parseFloat(t.data_free),i+=parseFloat(t.data_size)})),this.mysql.number=e.mysqlSize.length,this.mysql.perc=(i/(s+i)).toFixed(2)}}},n=o,l=(s("a52e"),s("fc39"),s("2877")),c=Object(l["a"])(n,i,r,!1,null,"5b6c8886",null);e["default"]=c.exports},"8e67":function(t,e,s){"use strict";var i=s("5f82"),r=s.n(i);r.a},a52e:function(t,e,s){"use strict";var i=s("550d"),r=s.n(i);r.a},a9aa:function(t,e,s){"use strict";s.r(e);s("b680");var i=s("6678"),r=s.n(i);function a(t){if(0===t)return"0 B";var e=1024,s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=Math.floor(Math.log(t)/Math.log(e));return(t/Math.pow(e,i)).toPrecision(3)+" "+s[i]}e["default"]={components:{ECharts:r.a},filters:{unit_size:a,fixed2:function(t){return t?parseFloat(parseFloat(t).toFixed(2)):0}},methods:{conByte:a}}},af0e:function(t,e,s){"use strict";var i=s("df80"),r=s.n(i);r.a},af4a:function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"perf-mysql"},[s("p",{staticClass:"title"},[t._v(" Mysql ")]),s("el-row",{staticClass:"fn"},[s("el-col",{attrs:{span:8}},[s("div",{staticClass:"block"},[s("div",{staticClass:"icon _disk"},[s("icon-svg",{attrs:{name:"disk"}})],1),s("ul",{staticClass:"b"},[s("li",[s("p",[t._v("已使用")]),s("p",[t._v(t._s(t.data_size))])])])])]),s("el-col",{attrs:{span:8}},[s("div",{staticClass:"block"},[s("div",{staticClass:"icon _cache"},[s("icon-svg",{attrs:{name:"cache"}})],1),s("ul",{staticClass:"b"},[s("li",[s("p",[t._v("缓存数")]),s("p",[t._v(t._s(t.Threads_cached))])])])])]),s("el-col",{attrs:{span:8}},[s("div",{staticClass:"block"},[s("div",{staticClass:"icon _connect"},[s("icon-svg",{attrs:{name:"connect"}})],1),s("ul",{staticClass:"b"},[s("li",[s("p",[t._v("连接数")]),s("p",[t._v(t._s(t.Threads_connected))])])])])])],1),s("e-charts",{attrs:{options:t.chart.options}})],1)},r=[],a=(s("d81d"),s("13d5"),s("164e")),o=s.n(a),n=s("a9aa"),l={mixins:[n["default"]],data:function(){return{chart:{options:{}},Threads_connected:0,Threads_cached:0,data_size:0}},methods:{refresh:function(t){var e=t.data,s=t.time,i=e[e.length-1],r=i.mysql,a=r.mysqlConn,o=r.mysqlSize;this.Threads_cached=a[0].Threads_cached,this.Threads_connected=a[1].Threads_connected,this.data_size=o.reduce((function(t,e){return t+parseFloat(e.data_size)}),0)+"mb",this.chart.options=this.onChart(s,e.map((function(t){return t.mysql.mysqlConn[3].Threads_running})))},onChart:function(t,e){return{tooltip:{trigger:"axis",axisPointer:{lineStyle:{color:"rgb(15, 75, 111)"}},backgroundColor:"rgb(255,255,255)",padding:[5,10],textStyle:{color:"rgb(15, 75, 111)"},extraCssText:"box-shadow: 0 0 5px rgba(0, 0, 0, 0.3)",formatter:function(t){return"线程数:".concat(t[0].data)}},grid:{left:"10px",right:"10px",bottom:"10px",top:"30px"},xAxis:{type:"category",show:!1,boundaryGap:!1,splitLine:{interval:"auto"},axisTick:{show:!1},axisLine:{show:!1},axisLabel:{margin:10,textStyle:{fontSize:12}},data:t},yAxis:{type:"value",show:!1,splitLine:{show:!0},axisTick:{show:!1},axisLine:{show:!0}},series:[{type:"line",smooth:!0,showSymbol:!1,symbol:"circle",symbolSize:6,data:e,markPoint:{symbolSize:30,data:[{type:"max",name:"最大值"},{type:"min",name:"最小值"}]},areaStyle:{normal:{color:new o.a.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgba(15, 75, 111, 0.5)"},{offset:1,color:"rgba(15, 75, 111, 0.1)"}],!1)}},itemStyle:{normal:{color:"rgb(15, 75, 111)"}},lineStyle:{normal:{width:1}}}]}}}},c=l,u=(s("af0e"),s("2877")),f=Object(u["a"])(c,i,r,!1,null,"1c20f402",null);e["default"]=f.exports},b3da:function(t,e,s){},b680:function(t,e,s){"use strict";var i=s("23e7"),r=s("a691"),a=s("408a"),o=s("1148"),n=s("d039"),l=1..toFixed,c=Math.floor,u=function(t,e,s){return 0===e?s:e%2===1?u(t,e-1,s*t):u(t*t,e/2,s)},f=function(t){var e=0,s=t;while(s>=4096)e+=12,s/=4096;while(s>=2)e+=1,s/=2;return e},d=l&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n((function(){l.call({})}));i({target:"Number",proto:!0,forced:d},{toFixed:function(t){var e,s,i,n,l=a(this),d=r(t),p=[0,0,0,0,0,0],h="",_="0",m=function(t,e){var s=-1,i=e;while(++s<6)i+=t*p[s],p[s]=i%1e7,i=c(i/1e7)},b=function(t){var e=6,s=0;while(--e>=0)s+=p[e],p[e]=c(s/t),s=s%t*1e7},v=function(){var t=6,e="";while(--t>=0)if(""!==e||0===t||0!==p[t]){var s=String(p[t]);e=""===e?s:e+o.call("0",7-s.length)+s}return e};if(d<0||d>20)throw RangeError("Incorrect fraction digits");if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(h="-",l=-l),l>1e-21)if(e=f(l*u(2,69,1))-69,s=e<0?l*u(2,-e,1):l/u(2,e,1),s*=4503599627370496,e=52-e,e>0){m(0,s),i=d;while(i>=7)m(1e7,0),i-=7;m(u(10,i,1),0),i=e-1;while(i>=23)b(1<<23),i-=23;b(1<<i),m(1,1),b(2),_=v()}else m(0,s),m(1<<-e,0),_=v()+o.call("0",d);return d>0?(n=_.length,_=h+(n<=d?"0."+o.call("0",d-n)+_:_.slice(0,n-d)+"."+_.slice(n-d))):_=h+_,_}})},c0f3:function(t,e,s){},cf6c:function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"system-perf"},[s("ct",{ref:"ct"}),s("network",{ref:"network"}),s("el-row",{staticStyle:{"margin-top":"15px"},attrs:{gutter:20}},[s("el-col",{attrs:{span:12}},[s("redis",{ref:"redis"})],1),s("el-col",{attrs:{span:12}},[s("mysql",{ref:"mysql"})],1)],1)],1)},r=[],a=s("8238"),o=s("5152"),n=s("670e"),l=s("af4a"),c={components:{Network:o["default"],Ct:a["default"],Redis:n["default"],Mysql:l["default"]},beforeRouteLeave:function(t,e,s){clearTimeout(this.tiemr),s()},data:function(){return{list:{},tiemr:null}},mounted:function(){this.refresh(),this.tiemr=setInterval(this.refresh,3e3)},methods:{refresh:function(){var t=this;this.$service.system.info.record().then((function(e){var s=t.$refs,i=s.network,r=s.ct,a=s.redis,o=s.mysql;i&&i.refresh(e),r&&r.refresh(e),a&&a.refresh(e),o&&o.refresh(e)}))}}},u=c,f=(s("5eac"),s("2877")),d=Object(f["a"])(u,i,r,!1,null,"072d15b2",null);e["default"]=d.exports},df80:function(t,e,s){},fc39:function(t,e,s){"use strict";var i=s("b3da"),r=s.n(i);r.a}}]);