Files
gb-cms/html/js/dashboard.b50fe9ce.js
T
2025-08-26 17:36:04 +08:00

1 line
11 KiB
JavaScript

webpackJsonp([13],{Nvqn:function(t,e,a){var i=a("ns1y");"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);a("rjj0")("75b065d3",i,!0,{})},QYg8:function(t,e,a){"use strict";(function(t){function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(t[i]=a[i])}return t},n=a("I3G/"),o=i(n),r=a("NYxO"),d=a("4lnF"),l=i(d);o.default.use(l.default),e.default={computed:s({},(0,r.mapState)(["serverInfo","userInfo"])),components:{},data:function(){var t=this;return{chartColors:["#337ab7","#7FFFD4"],pageWidth:0,pageHeight:0,protocol:location.protocol,authViewHeight:80,timer:0,vods:{},duration:30,memData:{columns:["time","use"],rows:[]},memSettings:{area:!0,xAxisType:"time",yAxisType:["percent"],min:[0],max:[1],labelMap:{use:"使用"}},cpuData:{columns:["time","use"],rows:[]},vodData:{columns:["type","count"],rows:[]},vodSettings:{label:{show:!0,formatter:"{b}: {c}"},roseType:"area"},storeData:{columns:["Name","Used","FreeSpace"],rows:[]},storeSettings:{dimension:["Name"],metrics:["Used","FreeSpace"],stack:{store:["Used","FreeSpace"]},legendName:{Used:"已使用(G)",FreeSpace:"剩余(G)"},labelMap:{Used:"已使用(G)",FreeSpace:"剩余(G)"}},authData:{ChannelOnline:0,ChannelTotal:0,ChannelCount:0,DeviceOnline:0,DeviceTotal:0},bandwidthData:{columns:["time","use"],rows:[]},bandwidthSettings:{area:!0,xAxisType:"time",labelMap:{use:"使用(Mbps)"}},netData:{columns:["time","sent","recv"],rows:[]},netSettings:{area:!0,xAxisType:"time",labelMap:{sent:"发送(Mbps)",recv:"接收(Mbps)"}},loadData:{rows:[]},loadSettings:{opacity:.8,dimension:["name"],metrics:["load"],labelMap:{load:"负载",name:"流媒体服务",serial:"流媒体服务"}},loadEvents:{click:function(e){if(!t.isMobile()){var a="",i="";switch(e.name){case"直播":a="stream";break;case"回放":a="playback";break;case"播放":a="playing";break;case"录像":a="record";break;case"H265":a="hevc";break;case"级联":a="cascade";break;default:var s=t.loadData.rows[e.dataIndex];s&&s.serial&&(i=s.serial)}(a||i)&&t.$emit("show-session-list",a,i)}}},storeExtend:{series:{silent:!0}},loadExtend:{series:{barMaxWidth:60},xAxis:{axisLabel:{formatter:function(e,a){return e+"("+t.loadData.rows[a].load+")"}}}},bToping:!1,bStoring:!1,bAuthing:!1}},mounted:function(){var e=this;this.top(),this.timer1=setInterval(function(){e.top()},2e3),this.store(),this.timer2=setInterval(function(){e.store()},1e4),this.timer3=setTimeout(function(){e.resizeCharts()},1e3),t(window).on("resize",this.resize),t(document).on("expanded.pushMenu",this.resizeCharts),t(document).on("collapsed.pushMenu",this.resizeCharts),this.fixAuthView()},created:function(){this.initHeight()},beforeDestroy:function(){this.timer1&&(clearInterval(this.timer1),this.timer1=0),this.timer2&&(clearInterval(this.timer2),this.timer2=0),this.timer3&&(clearTimeout(this.timer3),this.timer3=0),t(window).off("resize",this.resize),t(document).off("expanded.pushMenu",this.resizeCharts),t(document).off("collapsed.pushMenu",this.resizeCharts)},methods:{fullscreen:function(){var t=this;this.$fullscreen.enter(this.$el.querySelector(".container-fluid"),{wrap:!1,callback:function(){t.resize(),t.resizeCharts()}})},top:function(){var e=this;this.bToping||(this.bToping=!0,t.get("/api/v1/dashboard/top").then(function(t){var a=t.data;e.memData.rows=a.memData,e.cpuData.rows=a.cpuData,e.netData.rows=a.netData,e.loadData.rows=a.loadData}).always(function(){e.bToping=!1}))},store:function(){var e=this;this.bStoring||(this.bStoring=!0,t.get("/api/v1/dashboard/store").then(function(t){var a=t.data;e.storeData.rows=a}).always(function(){e.bStoring=!1})),this.bAuthing||(this.bAuthing=!0,t.get("/api/v1/dashboard/auth").then(function(t){var a=t.data;e.authData=a}).always(function(){e.bAuthing=!1}))},isIE:function(){return!!(window.ActiveXObject||"ActiveXObject"in window)},initHeight:function(){this.pageWidth=window.innerWidth,this.pageHeight=window.innerHeight,"number"!=typeof this.pageWidth&&("CSS1Compat"==document.compatMode?(this.pageWidth=document.documentElement.clientWidth,this.pageHeight=document.documentElement.clientHeight):(this.pageWidth=document.body.clientWidth,this.pageHeight=document.body.clientHeight)),this.pageHeight=this.pageHeight-140},resizeCharts:function(){this.$refs.storeChart.resize(),this.$refs.cpuChart.resize(),this.$refs.memChart.resize(),this.$refs.loadChart.resize(),this.$refs.netChart.resize()},resize:function(){this.initHeight(),this.fixAuthView()},fixAuthView:function(){this.pageHeight>=900?t(".auth-view").css("padding-top",this.pageHeight/6+"px"):this.pageHeight>=600?t(".auth-view").css("padding-top",this.pageHeight/8+"px"):t(".auth-view").css("padding-top","32px")}}}}).call(e,a("0iPh"))},UQ7N:function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("section",{staticClass:"content"},[a("div",{staticClass:"qcontent"},[a("div",{staticClass:"qcontent-header hidden-xs"},[t._v("服务器概览 "),a("button",{staticClass:"btn btn-xs btn-default full-btn",attrs:{type:"button",title:"点击大屏展示"},on:{click:function(e){e.preventDefault(),t.fullscreen(e)}}},[a("i",{staticClass:"fa fa-arrows-alt"})])]),t._v(" "),a("div",{staticClass:"container-fluid",style:"height:"+this.pageHeight+"px;min-height:500px;"},[a("div",{staticClass:"col-xs-12 col-md-4"},[a("div",{staticClass:"view-dashboard view-left"},[a("div",{staticClass:"panel"},[a("div",{staticClass:"panel-body"},[a("div",{staticClass:"col-md-12 panel-title"},[t._v("\r\n 通道信息\r\n ")]),t._v(" "),a("div",{staticClass:"col-xs-6 auth-view",staticStyle:{"text-align":"center"}},[a("el-progress",{attrs:{color:"#337ab7",type:"circle",height:this.authViewHeight,width:this.authViewHeight,percentage:0==t.authData.DeviceTotal?0:parseFloat((t.authData.DeviceOnline/t.authData.DeviceTotal*100).toFixed(2))}}),t._v(" "),a("div",{staticClass:"auth-title"},[t._v("在线数:"),a("span",{staticClass:"auth-num"},[t._v(t._s(t.authData.DeviceOnline))]),a("br"),t._v("总设备:"),a("span",{staticClass:"auth-num"},[t._v(t._s(t.authData.DeviceTotal))])])],1),t._v(" "),a("div",{staticClass:"col-xs-6 auth-view",staticStyle:{"text-align":"center"}},[a("el-progress",{attrs:{color:"#337ab7",type:"circle",height:this.authViewHeight,width:this.authViewHeight,percentage:0==t.authData.ChannelTotal?0:parseFloat((t.authData.ChannelOnline/t.authData.ChannelTotal*100).toFixed(2))}}),t._v(" "),a("div",{staticClass:"auth-title"},[t._v("在线数:"),a("span",{staticClass:"auth-num"},[t._v(t._s(t.authData.ChannelOnline))]),a("br"),t._v("总通道:"),a("span",{staticClass:"auth-num"},[t._v(t._s(t.authData.ChannelTotal))])])],1)])])]),t._v(" "),a("div",{staticClass:"view-dashboard view-left view-split"},[a("div",{staticClass:"panel"},[a("div",{staticClass:"panel-body"},[a("ve-bar",{ref:"storeChart",attrs:{height:"100%",colors:t.chartColors,data:t.storeData,settings:t.storeSettings,extend:t.storeExtend,"legend-position":"bottom",title:{text:"存储使用",left:"center"}}})],1)])])]),t._v(" "),a("div",{staticClass:"col-xs-12 col-md-4"},[a("div",{staticClass:"view-dashboard view-split-m"},[a("div",{staticClass:"panel"},[a("div",{staticClass:"panel-body"},[a("ve-histogram",{ref:"loadChart",attrs:{height:"100%",colors:t.chartColors,data:t.loadData,settings:t.loadSettings,events:t.loadEvents,extend:t.loadExtend,"legend-visible":!1,title:{text:"负载信息",left:"center"}}})],1)])]),t._v(" "),a("div",{staticClass:"view-dashboard view-split"},[a("div",{staticClass:"panel"},[a("div",{staticClass:"panel-body"},[a("ve-line",{ref:"netChart",attrs:{height:"100%",colors:t.chartColors,data:t.netData,settings:t.netSettings,"legend-position":"bottom","legend-visible":!0,title:{text:"带宽使用(Mbps)",left:"center"}}})],1)])])]),t._v(" "),a("div",{staticClass:"col-xs-12 col-md-4"},[a("div",{staticClass:"view-dashboard view-right view-split-m"},[a("div",{staticClass:"panel"},[a("div",{staticClass:"panel-body"},[a("ve-line",{ref:"cpuChart",attrs:{height:"100%",colors:t.chartColors,data:t.cpuData,settings:t.memSettings,"legend-visible":!1,title:{text:"CPU使用",left:"center"}}})],1)])]),t._v(" "),a("div",{staticClass:"view-dashboard view-right view-split"},[a("div",{staticClass:"panel"},[a("div",{staticClass:"panel-body"},[a("ve-line",{ref:"memChart",attrs:{height:"100%",colors:t.chartColors,data:t.memData,settings:t.memSettings,"legend-visible":!1,title:{text:"内存使用",left:"center"}}})],1)])])])])])])},s=[],n={render:i,staticRenderFns:s};e.a=n},ns1y:function(t,e,a){e=t.exports=a("FZ+f")(!1),e.push([t.i,".qcontent .fullscreen[data-v-8f9d18e0]{position:fixed;left:0;top:0;right:0;bottom:0;background-color:#ecf0f5}.qcontent .full-btn[data-v-8f9d18e0]{margin-left:2px;margin-top:-3px}.qcontent .col-md-4[data-v-8f9d18e0],.qcontent .col-md-6[data-v-8f9d18e0]{padding-left:0;padding-right:0;height:100%}.qcontent .panel[data-v-8f9d18e0]{height:100%}.qcontent .panel-body[data-v-8f9d18e0]{height:100%;padding:15px 0}.qcontent .panel-title[data-v-8f9d18e0]{text-align:center;font-weight:700;font-size:18px}.qcontent .container-fluid[data-v-8f9d18e0]{padding:10px 10px 20px}.qcontent[data-v-8f9d18e0]{margin:-16px -15px}.view-dashboard[data-v-8f9d18e0]{height:50%}.view-left[data-v-8f9d18e0]{margin-right:5px}.view-right[data-v-8f9d18e0]{margin-left:5px}.view-split[data-v-8f9d18e0]{margin-top:10px}.auth-live[data-v-8f9d18e0],.auth-vlive[data-v-8f9d18e0]{margin-top:6%}.auth-num[data-v-8f9d18e0]{margin-top:20%;font-size:14px;font-weight:700;color:#337ab7}.auth-view[data-v-8f9d18e0]{min-height:200px;padding-top:78px}.auth-title[data-v-8f9d18e0]{font-size:12px;color:#1d3b55}.auth-promt-div[data-v-8f9d18e0]{margin-top:10%}@media (max-width:992px){.col-md-4[data-v-8f9d18e0],.col-md-6[data-v-8f9d18e0]{width:100%}.container-fluid[data-v-8f9d18e0]{height:100%!important}.view-dashboard[data-v-8f9d18e0]{height:320px}.view-left[data-v-8f9d18e0]{margin-right:0}.view-right[data-v-8f9d18e0]{margin-left:0}.view-split-m[data-v-8f9d18e0],.view-split[data-v-8f9d18e0]{margin-top:10px}.auth-live[data-v-8f9d18e0],.auth-vlive[data-v-8f9d18e0]{margin-top:0}.auth-num[data-v-8f9d18e0]{margin-top:20%;font-size:14px;font-weight:700;color:#337ab7}.auth-view[data-v-8f9d18e0]{height:200px!important;padding-top:78px!important}.qcontent .container-fluid[data-v-8f9d18e0]{padding-bottom:10px}}",""])},"w+5F":function(t,e,a){"use strict";function i(t){a("Nvqn")}Object.defineProperty(e,"__esModule",{value:!0});var s=a("QYg8"),n=a.n(s);for(var o in s)["default","default"].indexOf(o)<0&&function(t){a.d(e,t,function(){return s[t]})}(o);var r=a("UQ7N"),d=a("VU/8"),l=i,h=d(n.a,r.a,!1,l,"data-v-8f9d18e0",null);e.default=h.exports}});