diff --git a/src/main/resources/webui/index.html b/src/main/resources/webui/index.html index a4937a6..09e33c3 100644 --- a/src/main/resources/webui/index.html +++ b/src/main/resources/webui/index.html @@ -1 +1 @@ -MD@H Client
\ No newline at end of file +MD@H Client
\ No newline at end of file diff --git a/src/main/resources/webui/js/app.74a1c55f.js b/src/main/resources/webui/js/app.74a1c55f.js deleted file mode 100644 index a5ee2f6..0000000 --- a/src/main/resources/webui/js/app.74a1c55f.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(t){function e(e){for(var r,o,i=e[0],c=e[1],l=e[2],u=0,g=[];ut.data.maxStorePoints&&t.data.stats.splice(0,t.data.stats.length-t.data.maxStorePoints)},bg:function(t,e){t.hasBgImage=e},setBg:function(t,e){t.bgImage=e}},d=new o["a"].Store({state:i,mutations:l,getters:c}),u={name:"App",data:function(){return{drawer:null,settings:"settings",items:[{title:"Dashboard",icon:"mdi-view-dashboard",route:"/"},{title:"Settings",icon:"mdi-cog-outline",route:"/opts"}],evnt:Event}},mounted:function(){localStorage.stats&&d.getters.data.stats.length<1&&d.commit("setStats",JSON.parse(localStorage.stats)),fetch("/api/pastStats").then((function(t){return t.json()})).then((function(t){t.forEach((function(e){return d.commit("pushStats",JSON.parse("{"+e+": "+JSON.stringify(t[e])+"}"))}))})).catch((function(t){return console.log(t)})),setInterval((function(){fetch("/api/stats").then((function(t){return t.json()})).then((function(t){d.commit("pushStats",t),d.commit("changed",!0),localStorage.stats=JSON.stringify(d.getters.data.stats)})).catch((function(t){return console.log(t),!1}))}),2e3),Event.$emit("load")}},g=u,h=(a("034f"),a("2877")),f=a("6544"),p=a.n(f),b=a("7496"),m=a("40dc"),v=a("5bc1"),j=a("ce7e"),y=a("132d"),k=a("adda"),C=a("8860"),x=a("da13"),w=a("5d23"),_=a("34c3"),$=a("f6c4"),S=a("f774"),A=a("2fa4"),I=Object(h["a"])(g,s,n,!1,null,null,null),O=I.exports;p()(I,{VApp:b["a"],VAppBar:m["a"],VAppBarNavIcon:v["a"],VDivider:j["a"],VIcon:y["a"],VImg:k["a"],VList:C["a"],VListItem:x["a"],VListItemContent:w["a"],VListItemIcon:_["a"],VListItemTitle:w["b"],VMain:$["a"],VNavigationDrawer:S["a"],VSpacer:A["a"]});var T=a("f309");r["a"].use(T["a"]);var D=new T["a"]({}),V=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-container",{staticClass:"pa-5",style:{color:t.$store.getters.current.textColor},attrs:{fluid:""}},[a("v-container",{staticClass:"mb-3",style:{backgroundColor:t.$store.getters.current.secondary+t.$store.getters.alpha},attrs:{fluid:""}},[a("h1",[t._v("Dashboard")])]),a("v-row",[a("v-col",{attrs:{cols:"12",md:"4"}},[a("graph",{attrs:{"graph-id":"hitmiss",height:"300","md-up-height":"300",type:"doughnut",data:{labels:["Hits","Misses","Browser Cached"],datasets:[{data:[0,0,0],backgroundColor:[t.$store.getters.current.green,t.$store.getters.current.red,t.$store.getters.current.yellow],borderColor:t.$store.getters.current.accent2}]},options:{maintainAspectRatio:!1,cutoutPercentage:65,centerText:{display:!0},legend:{labels:{fontColor:t.$store.getters.current.textColor}},title:{display:!0,text:"Reliability",fontColor:t.$store.getters.current.textColor}},plugins:[{beforeDraw:function(t,e){if(null!==t.config.options.centerText.display&&"undefined"!==typeof t.config.options.centerText.display&&t.config.options.centerText.display){var a=t.chart.width,r=t.chart.height,s=t.chart.ctx,n=(t.chartArea.left+t.chartArea.right)/2,o=(t.chartArea.top+t.chartArea.bottom)/2,i=(t.data.datasets[0].data[0]/(t.data.datasets[0].data[1]+t.data.datasets[0].data[0])*100).toFixed(2);"NaN"===i&&(i=0),s.restore(),s.textAlign="center";var c=(Math.min(r,a)/134).toFixed(2);s.font=c+"em sans-serif",s.textBaseline="middle",s.fillStyle=["hsl(",(i/100*120).toString(10),",100%,40%)"].join("");var l=i+"%";s.fillText(l,n,o),s.save()}}}]}})],1),a("v-col",{attrs:{cols:"12",md:"8"}},[a("graph",{attrs:{"graph-id":"netact",height:"250","md-up-height":"300",type:"line",data:{datasets:t.netactdata},options:{maintainAspectRatio:!1,elements:{line:{tension:0}},legend:{labels:{fontColor:t.$store.getters.current.textColor}},title:{display:!0,text:"Bytes Sent",fontColor:t.$store.getters.current.textColor},scales:t.dataScaleConfig}}})],1)],1),a("v-row",[a("v-col",{attrs:{cols:"12",md:"6"}},[a("graph",{attrs:{"graph-id":"reqserved",height:"250","md-up-height":"300",type:"line",data:{labels:[],datasets:t.reqdata},options:{maintainAspectRatio:!1,point:{pointBackgroundColor:"rgba(0,0,0,0)",pointBorderColor:"rgba(0,0,0,0)"},elements:{line:{tension:0}},legend:{labels:{fontColor:t.$store.getters.current.textColor}},title:{display:!0,text:"Requests Served",fontColor:t.$store.getters.current.textColor},scales:t.graphScaleConfig}}})],1),a("v-col",{attrs:{cols:"12",md:"6"}},[a("graph",{attrs:{"graph-id":"sizondisk",height:"250","md-up-height":"300",type:"line",data:{labels:[],datasets:t.diskdata},options:{maintainAspectRatio:!1,point:{pointBackgroundColor:"rgba(0,0,0,0)",pointBorderColor:"rgba(0,0,0,0)"},elements:{line:{tension:0}},legend:{labels:{fontColor:t.$store.getters.current.textColor}},title:{display:!0,text:"Space Used",fontColor:t.$store.getters.current.textColor},scales:t.dataScaleConfig}}})],1)],1),a("v-row"),a("v-btn",{attrs:{dark:t.$store.getters.current.isDark},on:{click:function(e){return t.pull()}}},[t._v("Update Now! ")])],1)},z=[],B=(a("99af"),a("b680"),a("b64b"),a("ac1f"),a("25f0"),a("5319"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-container",{style:{backgroundColor:t.$store.getters.current.secondary+t.$store.getters.alpha,height:(t.$vuetify.breakpoint.mdAndUp?t.mdUpHeight:t.height)+"px"},attrs:{fluid:""}},[a("canvas",{attrs:{id:t.graphId}})])}),R=[],M=a("30ef"),q=a.n(M),P=[],E={name:"graph",props:["graphId","type","data","options","plugins","mdUpHeight","height"],methods:{createChart:function(t){var e=document.getElementById(t);P.push({chart:new q.a(e,{type:this.type,data:this.data,options:this.options,plugins:this.plugins}),chartid:t})},getChart:function(){return P},clearChart:function(){P=[]}},mounted:function(){this.createChart(this.graphId)}},U=E,L=a("a523"),N=Object(h["a"])(U,B,R,!1,null,"5ac2b79a",null),F=N.exports;p()(N,{VContainer:L["a"]});var H={name:"Dashboard",components:{Graph:F},data:function(){return{graphScaleConfig:{yAxes:[{ticks:{beginAtZero:!0,fontColor:d.getters.current.textColor,maxTicksLimit:11,padding:10},gridLines:{color:d.getters.current.accent,drawTicks:!1}}],xAxes:[{type:"time",ticks:{fontColor:d.getters.current.textColor,maxRotation:0,autoSkipPadding:22,padding:10},gridLines:{color:d.getters.current.accent,drawTicks:!1}}]},dataScaleConfig:{yAxes:[{ticks:{beginAtZero:!0,fontColor:d.getters.current.textColor,maxTicksLimit:11,padding:10,callback:function(t){var e=parseFloat(t.toString()),a=Math.abs(e);return a>=1e15?(e/1e15).toFixed(1)+"pb":a>=1e12?(e/1e12).toFixed(1)+"tb":a>=1e9?(e/1e9).toFixed(1)+"gb":a>=1e6?(e/1e6).toFixed(1)+"mb":a>=1e3?(e/1e3).toFixed(1)+"kb":e+"b"}},gridLines:{color:d.getters.current.accent,drawTicks:!1}}],xAxes:[{type:"time",ticks:{fontColor:d.getters.current.textColor,maxRotation:0,autoSkipPadding:22,padding:10},gridLines:{color:d.getters.current.accent,drawTicks:!1}}]},toolTips:{mode:"average"},hitmissdata:[0,0,0],netactdata:[{label:"Change",data:[],backgroundColor:d.getters.current.yellow+"d0",borderColor:d.getters.current.yellow+"d0",pointRadius:0,pointHitRadius:10,borderWidth:1},{label:"Total",data:[],backgroundColor:d.getters.current.accent2,borderColor:d.getters.current.accent+"d0",pointRadius:0,pointHitRadius:10,borderWidth:1}],diskdata:[{label:"Change",data:[],backgroundColor:d.getters.current.yellow,borderColor:d.getters.current.yellow+"d0",pointRadius:0,pointHitRadius:10,borderWidth:1},{label:"Total",data:[],backgroundColor:d.getters.current.accent2,borderColor:d.getters.current.accent+"d0",pointRadius:0,pointHitRadius:10,borderWidth:1}],reqdata:[{label:"Change",data:[],backgroundColor:d.getters.current.yellow,borderColor:d.getters.current.yellow+"d0",pointRadius:0,pointHitRadius:10,borderWidth:1},{label:"Total",data:[],backgroundColor:d.getters.current.accent2,borderColor:d.getters.current.accent+"d0",pointRadius:0,pointHitRadius:10,borderWidth:1}],evnt:Event}},methods:{updateValues:function(){var t=d.getters.data.stats;if(!(t.length<1)){var e=Object.keys(t[t.length-1])[0],a=t[t.length-1][e],r=t.length>2?t[t.length-2][Object.keys(t[t.length-2])[0]]:null,s=new Date(e.replace("T"," ").replace("Z"," ")),n=Date.UTC(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds());this.netactdata[0].data.push({t:n,y:r?a.bytes_sent-r.bytes_sent:0}),this.netactdata[1].data.push({t:n,y:a.bytes_sent}),this.diskdata[0].data.push({t:n,y:r?a.bytes_on_disk-r.bytes_on_disk:0}),this.diskdata[1].data.push({t:n,y:a.bytes_on_disk}),this.reqdata[0].data.push({t:n,y:r?a.requests_served-r.requests_served:0}),this.reqdata[1].data.push({t:n,y:a.requests_served}),this.hitmissdata=[a.cache_hits,a.cache_misses,a.browser_cached];var o=F.methods.getChart();for(var i in o)o[i].chart.data.datasets.forEach((function(t){t.data.length>d.getters.data.maxPoints&&t.data.splice(0,t.data.length-d.getters.data.maxPoints)})),o[i].chart.update()}},loadData:function(){var t=d.getters.data.stats;if(!(t.length<1)){this.netactdata[0].data=[],this.netactdata[1].data=[],this.diskdata[0].data=[],this.diskdata[1].data=[],this.reqdata[0].data=[],this.reqdata[1].data=[];for(var e=Math.max(t.length-d.getters.data.maxPoints,0);e1?t[e-1][Object.keys(t[e-1])[0]]:null,n=new Date(a.replace("T"," ").replace("Z"," ")),o=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds());this.netactdata[0].data.push({t:o,y:s?r.bytes_sent-s.bytes_sent:0}),this.netactdata[1].data.push({t:o,y:r.bytes_sent}),this.diskdata[0].data.push({t:o,y:s?r.bytes_on_disk-s.bytes_on_disk:0}),this.diskdata[1].data.push({t:o,y:r.bytes_on_disk}),this.reqdata[0].data.push({t:o,y:s?r.requests_served-s.requests_served:0}),this.reqdata[1].data.push({t:o,y:r.requests_served}),this.hitmissdata=[r.cache_hits,r.cache_misses,r.browser_cached]}var i=F.methods.getChart();for(var c in i)i[c].chart.update()}},sortValues:function(){var t=d.getters.data.stats,e=a(t);function a(t){if(t.length<=1)return t;for(var e=[],r=[],s=t.pop(),n=t.length,o=0;o