You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ocr-web/dist/js/chunk-8db88282.844bf564.js

1 line
5.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8db88282"],{"1d85":function(t,e,a){},"8d7f":function(t,e,a){"use strict";a("1d85")},ebfa:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("a-skeleton",{attrs:{active:"",loading:t.loading,paragraph:{rows:17}}},[a("a-card",[a("a-row",{attrs:{gutter:8}},[a("a-col",{attrs:{sm:24,xl:12}},[a("area-chart-ty",t._b({},"area-chart-ty",t.memory,!1))],1),a("a-col",{attrs:{sm:24,xl:12}},[a("area-chart-ty",t._b({},"area-chart-ty",t.key,!1))],1)],1),a("h3",[t._v("Redis 详细信息")]),a("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"),s=a("f552");function u(t,e){return y(t)||f(t,e)||d(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 d(t,e){if(t){if("string"===typeof t)return m(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)?m(t,e):void 0}}function m(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 f(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var a=[],r=!0,n=!1,i=void 0;try{for(var o,l=t[Symbol.iterator]();!(r=(o=l.next()).done);r=!0)if(a.push(o.value),e&&a.length===e)break}catch(s){n=!0,i=s}finally{try{r||null==l["return"]||l["return"]()}finally{if(n)throw i}}return a}}function y(t){if(Array.isArray(t))return t}var h={name:"RedisInfo",components:{AreaChartTy:s["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:"/sys/actuator/redis/keysSize",memoryInfo:"/sys/actuator/redis/memoryInfo",info:"/sys/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=u(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 s=t.getMaxAndMin(t.key.dataSource,"y");t.key.max=Math.floor(s[0])+10,t.key.min=Math.floor(s[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"),b=Object(g["a"])(p,r,n,!1,null,null,null);e["default"]=b.exports},f552:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{style:{padding:"0"}},[a("h4",{style:{marginBottom:"20px"}},[t._v(t._s(t.title))]),a("v-chart",{ref:"chart",attrs:{forceFit:!0,height:t.height,data:t.dataSource,scale:t.scale}},[a("v-tooltip",{attrs:{shared:!1}}),a("v-axis"),a("v-line",{attrs:{position:"x*y",size:t.lineSize,color:t.lineColor}}),a("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["o"])()}},l=o,s=(a("8d7f"),a("2877")),u=Object(s["a"])(l,r,n,!1,null,"6d58f736",null);e["default"]=u.exports}}]);