2 lines
2.7 KiB
JavaScript
2 lines
2.7 KiB
JavaScript
import{l as w}from"./goldTarget.De2IzyrI.js";import{d as g,R as y,_ as h}from"../index.D-NvtsOM.js";import{c as u,e as x,d as S}from"./useWS.DO0ookxT.js";import{g as _,b0 as D,b2 as F,bq as L,b5 as T,bs as C,b7 as z,bt as U,r as c,w as k,W as A,k as I,D as O,bu as d,b9 as R,ba as B}from"./vendor/index.CRpmXtWV.js";import"./ws-websocket.Bq7KFeli.js";import"./useUserActivity.DNiKEL74.js";import"./useTopology.BsBJQHWe.js";const E=_({__name:"index",setup(G){const{t:i}=g();D([F,L,T,C,z,U]);const f=c(void 0),o=c(null);function b(e,t){if(e){o.value||(o.value=R(B(e,"light"))),t&&o.value.setOption(t);var r=new ResizeObserver(n=>{o.value&&o.value.resize()});r.observe(e)}}function m(){const{lineXTime:e,lineYUp:t,lineYDown:r}=u.value;var n=[{name:i("views.dashboard.overview.upfFlow.up"),type:"line",color:"rgba(250, 219, 20)",smooth:!0,areaStyle:{color:new d(0,0,0,1,[{offset:0,color:"rgba(250, 219, 20, .5)"},{offset:1,color:"rgba(250, 219, 20, 0.5)"}]),shadowColor:"rgba(0, 0, 0, 0.1)",shadowBlur:10},symbol:"circle",symbolSize:5,formatter:"{b}",data:t},{name:i("views.dashboard.overview.upfFlow.down"),type:"line",color:"rgba(92, 123, 217)",smooth:!0,areaStyle:{color:new d(0,0,0,1,[{offset:0,color:"rgba(92, 123, 217, .5)"},{offset:1,color:"rgba(92, 123, 217, 0.5)"}]),shadowColor:"rgba(0, 0, 0, 0.1)",shadowBlur:10},symbol:"circle",symbolSize:5,formatter:"{b}",data:r}];const v={tooltip:{show:!0,trigger:"axis",formatter:function(a){var s="";if(a!==null&&a.length>0){s+=a[0].name+"<br />";for(var l=0;l<a.length;l++)s+=a[l].marker+a[l].seriesName+": "+a[l].value+"<br />"}return s}},legend:{data:n.map(a=>a.name),textStyle:{fontSize:12,color:"rgb(0,253,255,0.6)"},left:"center"},grid:{top:"14%",left:"4%",right:"4%",bottom:"16%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:e,axisLabel:{formatter:function(a){return a.split(" ")[1]},fontSize:14},axisLine:{lineStyle:{color:"rgb(0,253,255,0.6)"}}},yAxis:[{name:"(Mbps)",nameTextStyle:{fontSize:12,padding:[0,-10,0,0]},type:"value",min:0,axisLabel:{formatter:"{value}"},splitLine:{lineStyle:{color:"rgb(23,255,243,0.3)"}},axisLine:{lineStyle:{color:"rgb(0,253,255,0.6)"}}}],series:n};b(f.value,v)}function p(){const e=new Date().getTime();w({neType:"UPF",neId:x.value,startTime:e-5*60*1e3,endTime:e,interval:5,sortField:"timeGroup",sortOrder:"asc"}).then(t=>{if(t.code===y&&Array.isArray(t.data))for(const r of t.data)S(r)}).finally(()=>{m()})}return k(()=>u.value,e=>{o.value!=null&&o.value.setOption({xAxis:{data:e.lineXTime},series:[{data:e.lineYUp},{data:e.lineYDown}]})},{deep:!0}),A(()=>{p()}),(e,t)=>(I(),O("div",{ref_key:"upfFlow",ref:f,class:"chart-container"},null,512))}}),K=h(E,[["__scopeId","data-v-0990b5a4"]]);export{K as default};
|