| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7302a479","chunk-47564ca8","chunk-77156228","chunk-7c199f12","chunk-3b433378","chunk-22924849"],{"05d7":function(t,e,s){"use strict";s("be7a")},"0664":function(t,e,s){"use strict";var i=s("e6d2"),r=s("4023");t.exports="".repeat||function(t){var e=String(r(this)),s="",o=i(t);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(s+=e);return s}},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=[],o=(s("4200"),s("3337"),s("3bae"),s("a037"),s("1d43"),s("6678")),a=s.n(o),n=s("164e"),l=s.n(n),c=s("a9aa"),u={components:{ECharts:a.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,o=i[i.length-1].server.network;this.rx_bytes=0,this.tx_bytes=0,o.forEach((function(t){e.rx_bytes+=t.rx_bytes,e.tx_bytes+=t.tx_bytes})),this.rx_sec=o.reduce((function(t,e){return t+e.rx_sec}),0),this.tx_sec=o.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("cefe"),s("5d22")),p=Object(d["a"])(f,i,r,!1,null,"a0c556fe",null);e["default"]=p.exports},"529f":function(t,e,s){"use strict";var i=s("1f04"),r=s("e6d2"),o=s("8251"),a=s("0664"),n=s("7ce6"),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=function(t,e,s){var i=-1,r=s;while(++i<6)r+=e*t[i],t[i]=r%1e7,r=c(r/1e7)},p=function(t,e){var s=6,i=0;while(--s>=0)i+=t[s],t[s]=c(i/e),i=i%e*1e7},h=function(t){var e=6,s="";while(--e>=0)if(""!==s||0===e||0!==t[e]){var i=String(t[e]);s=""===s?i:s+a.call("0",7-i.length)+i}return s},_=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:_},{toFixed:function(t){var e,s,i,n,l=o(this),c=r(t),_=[0,0,0,0,0,0],m="",b="0";if(c<0||c>20)throw RangeError("Incorrect fraction digits");if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(m="-",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){d(_,0,s),i=c;while(i>=7)d(_,1e7,0),i-=7;d(_,u(10,i,1),0),i=e-1;while(i>=23)p(_,1<<23),i-=23;p(_,1<<i),d(_,1,1),p(_,2),b=h(_)}else d(_,0,s),d(_,1<<-e,0),b=h(_)+a.call("0",c);return c>0?(n=b.length,b=m+(n<=c?"0."+a.call("0",c-n)+b:b.slice(0,n-c)+"."+b.slice(n-c))):b=m+b,b}})},5547:function(t,e,s){"use strict";s("b51f")},6494:function(t,e,s){"use strict";s("c99b")},"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=[],o=(s("5b12"),s("9b5f"),s("3337"),s("a9aa")),a=s("164e"),n=s.n(a),l={mixins:[o["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,o=r.Keyspace,a=r.Stats,n=r.Memory,l=[];for(var c in o)l.push({label:c,value:o[c].split(",")[0].split("=")[1]});this.total_net_input_bytes=a.total_net_input_bytes,this.total_net_output_bytes=a.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("5547"),s("5d22")),f=Object(u["a"])(c,i,r,!1,null,"d711405a",null);e["default"]=f.exports},6927:function(t,e,s){},6972: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=[],o=(s("e3b5"),s("a037"),s("3337"),s("529f"),s("3bae"),s("a9aa")),a={filters:{status_color:function(t){return t<50?"#67C23A":t<70?"#E6A23C":t<100?"#F56C6C":void 0}},mixins:[o["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=a,l=(s("a52e"),s("6494"),s("5d22")),c=Object(l["a"])(n,i,r,!1,null,"2d9d580d",null);e["default"]=c.exports},8251:function(t,e,s){var i=s("36b2");t.exports=function(t){if("number"!=typeof t&&"Number"!=i(t))throw TypeError("Incorrect invocation");return+t}},a52e:function(t,e,s){"use strict";s("6972")},a9aa:function(t,e,s){"use strict";s.r(e);s("529f");var i=s("6678"),r=s.n(i);function o(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:o,fixed2:function(t){return t?parseFloat(parseFloat(t).toFixed(2)):0}},methods:{conByte:o}}},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=[],o=(s("a037"),s("3337"),s("164e")),a=s.n(o),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,o=r.mysqlConn,a=r.mysqlSize;this.Threads_cached=o[0].Threads_cached,this.Threads_connected=o[1].Threads_connected,this.data_size=a.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 a.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("05d7"),s("5d22")),f=Object(u["a"])(c,i,r,!1,null,"0771713f",null);e["default"]=f.exports},b51f:function(t,e,s){},be7a:function(t,e,s){},c99b:function(t,e,s){},cefe:function(t,e,s){"use strict";s("6927")},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=[],o=s("8238"),a=s("5152"),n=s("670e"),l=s("af4a"),c={components:{Network:a["default"],Ct:o["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,o=s.redis,a=s.mysql;i&&i.refresh(e),r&&r.refresh(e),o&&o.refresh(e),a&&a.refresh(e)}))}}},u=c,f=(s("f76d"),s("5d22")),d=Object(f["a"])(u,i,r,!1,null,"053e3658",null);e["default"]=d.exports},f769:function(t,e,s){},f76d:function(t,e,s){"use strict";s("f769")}}]);
|