chunk-a3896f14.5d277999.js 5.0 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a3896f14"],{"0cf0":function(t,e,a){"use strict";a("948f")},"948f":function(t,e,a){},ebfa:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t._self._c;return e("a-skeleton",{attrs:{active:"",loading:t.loading,paragraph:{rows:17}}},[e("a-card",[e("a-row",{attrs:{gutter:8}},[e("a-col",{attrs:{sm:24,xl:12}},[e("area-chart-ty",t._b({},"area-chart-ty",t.memory,!1))],1),e("a-col",{attrs:{sm:24,xl:12}},[e("area-chart-ty",t._b({},"area-chart-ty",t.key,!1))],1)],1),e("h3",[t._v("Redis 详细信息")]),e("a-table",{attrs:{loading:t.tableLoading,columns:t.columns,dataSource:t.redisInfo,pagination:!1}})],1)],1)},n=[],i=a("c1df"),o=a.n(i),l=a("0fea"),u=a("f552");function s(t,e){return y(t)||m(t,e)||f(t,e)||c()}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(t,e){if(t){if("string"===typeof t)return d(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}function m(t,e){var a=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var r,n,i=[],o=!0,l=!1;try{for(a=a.call(t);!(o=(r=a.next()).done);o=!0)if(i.push(r.value),e&&i.length===e)break}catch(u){l=!0,n=u}finally{try{o||null==a["return"]||a["return"]()}finally{if(l)throw n}}return i}}function y(t){if(Array.isArray(t))return t}var h={name:"RedisInfo",components:{AreaChartTy:u["default"]},data:function(){return{loading:!0,tableLoading:!0,timer:null,millisec:3e3,key:{title:"Radis Key 实时数量(个)",dataSource:[],y:"数量(个)",height:340,min:0,max:100,color:"#FF6987",lineSize:8,lineColor:"#DC143C"},memory:{title:"Radis 内存实时占用情况(KB)",dataSource:[],y:"内存(KB)",min:0,max:3e3,height:340,lineSize:8},redisInfo:[],columns:[{title:"Key",align:"center",dataIndex:"key"},{title:"Description",align:"left",dataIndex:"description"},{title:"Value",align:"center",dataIndex:"value"}],url:{keysSize:"/actuator/redis/keysSize",memoryInfo:"/actuator/redis/memoryInfo",info:"/actuator/redis/info"},path:"/monitor/redis/info"}},mounted:function(){var t=this;this.openTimer(),this.loadRedisInfo(),setTimeout((function(){t.loadData()}),1e3)},beforeDestroy:function(){this.closeTimer()},methods:{openTimer:function(){var t=this;this.loadData(),this.closeTimer(),this.timer=setInterval((function(){t.$route.path===t.path&&t.loadData()}),this.millisec)},closeTimer:function(){this.timer&&clearInterval(this.timer)},loadData:function(){var t=this;Promise.all([Object(l["c"])(this.url.keysSize),Object(l["c"])(this.url.memoryInfo)]).then((function(e){var a=o()().format("hh:mm:ss"),r=s(e,2),n=r[0].dbSize,i=r[1],l=i.used_memory/1e3;t.key.dataSource.push({x:a,y:n}),t.memory.dataSource.push({x:a,y:l}),t.key.dataSource.length>6&&(t.key.dataSource.splice(0,1),t.memory.dataSource.splice(0,1));var u=t.getMaxAndMin(t.key.dataSource,"y");t.key.max=Math.floor(u[0])+10,t.key.min=Math.floor(u[1])-10,t.key.min<0&&(t.key.min=0);var c=t.getMaxAndMin(t.memory.dataSource,"y");t.memory.max=Math.floor(c[0])+100,t.memory.min=Math.floor(c[1])-100,t.memory.min<0&&(t.memory.min=0)})).catch((function(e){t.closeTimer(),t.$message.error("获取 Redis 信息失败")})).finally((function(){t.loading=!1}))},getMaxAndMin:function(t,e){var a=null,r=null;return t.forEach((function(t){var n=Number.parseInt(t[e]);(null==a||n>a)&&(a=n),(null==r||n<r)&&(r=n)})),[a,r]},loadRedisInfo:function(){var t=this;this.tableLoading=!0,Object(l["c"])(this.url.info).then((function(e){t.redisInfo=e.result})).finally((function(){t.tableLoading=!1}))}}},p=h,g=a("2877"),v=Object(g["a"])(p,r,n,!1,null,null,null);e["default"]=v.exports},f552:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t._self._c;return e("div",{style:{padding:"0"}},[e("h4",{style:{marginBottom:"20px"}},[t._v(t._s(t.title))]),e("v-chart",{ref:"chart",attrs:{forceFit:!0,height:t.height,data:t.dataSource,scale:t.scale}},[e("v-tooltip",{attrs:{shared:!1}}),e("v-axis"),e("v-line",{attrs:{position:"x*y",size:t.lineSize,color:t.lineColor}}),e("v-area",{attrs:{position:"x*y",color:t.color}})],1)],1)},n=[],i=a("ca00"),o={name:"AreaChartTy",props:{dataSource:{type:Array,required:!0},title:{type:String,default:""},x:{type:String,default:"x"},y:{type:String,default:"y"},min:{type:Number,default:0},max:{type:Number,default:null},height:{type:Number,default:254},lineSize:{type:Number,default:2},color:{type:String,default:""},lineColor:{type:String,default:""}},computed:{scale:function(){return[{dataKey:"x",title:this.x,alias:this.x},{dataKey:"y",title:this.y,alias:this.y,min:this.min,max:this.max}]}},mounted:function(){Object(i["k"])()}},l=o,u=(a("0cf0"),a("2877")),s=Object(u["a"])(l,r,n,!1,null,"6d58f736",null);e["default"]=s.exports}}]);