dappros/ethora

View on GitHub
client-web/build-prod/static/js/296.7fed2419.chunk.js

Summary

Maintainability
A
0 mins
Test Coverage
"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[296],{21296:function(t,e,a){a.r(e),a.d(e,{default:function(){return I}});var n=a(37762),s=a(74165),r=a(15861),c=a(70885),l=a(1413),i=a(45987),o=a(72791),u=a(20803),d=a(94293),x=a(90166),p=a(4565),h=a(50228),y=a(47409),f=a(9478),Z=a(59911),v=a(17205),j=a(91482),g=a(39709),m=a(85847),b=a(82839),D=a(90466),w=a(12891),k=a(53628),S=a(80184),C=["children","value","index"];function K(t){var e=t.children,a=t.value,n=t.index,s=(0,i.Z)(t,C);return(0,S.jsx)("div",(0,l.Z)((0,l.Z)({role:"tabpanel",hidden:a!==n,id:"simple-tabpanel-".concat(n),"aria-labelledby":"simple-tab-".concat(n),style:{height:"100%"}},s),{},{children:a===n&&(0,S.jsx)(h.Z,{sx:{p:3},children:(0,S.jsx)(p.Z,{children:e})})}))}function V(t){return{id:"simple-tab-".concat(t),"aria-controls":"simple-tabpanel-".concat(t),disableFocusRipple:!0}}function I(){var t=o.useState(0),e=(0,c.Z)(t,2),a=e[0],i=e[1],C=o.useState(),I=(0,c.Z)(C,2),B=I[0],T=I[1],A=o.useState(),M=(0,c.Z)(A,2),N=M[0],R=M[1],q=o.useState(),L=(0,c.Z)(q,2),P=L[0],F=L[1],U=o.useState(),_=(0,c.Z)(U,2),E=_[0],W=_[1],H=o.useState(!1),z=(0,c.Z)(H,2),G=z[0],J=z[1],O=o.useState([]),Q=(0,c.Z)(O,2),X=Q[0],Y=Q[1],$=o.useState([]),tt=(0,c.Z)($,2),et=tt[0],at=tt[1],nt=o.useState([]),st=(0,c.Z)(nt,2),rt=st[0],ct=st[1],lt=o.useState([]),it=(0,c.Z)(lt,2),ot=it[0],ut=it[1],dt=o.useState((function(){var t=new Date;return t.setDate(1),t.setHours(0,0,0,0),(0,j.Z)(t,"yyyy-MM-dd")})),xt=(0,c.Z)(dt,2),pt=xt[0],ht=xt[1],yt=o.useState((function(){var t=new Date;return(0,j.Z)(t,"yyyy-MM-dd")})),ft=(0,c.Z)(yt,2),Zt=ft[0],vt=ft[1],jt=new URL(f.v.API_URL).origin,gt=function(){var t=(0,r.Z)((0,s.Z)().mark((function t(){var e,a,n,r;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return J(!0),t.prev=1,t.next=4,y.Vy()({url:"".concat(jt,"/analysis/sessions-count?startDate=").concat(pt,"&endDate=").concat(Zt)});case 4:return e=t.sent,R(e.data.count),t.next=8,y.Vy()({url:"".concat(jt,"/analysis/transactions-count?startDate=").concat(pt,"&endDate=").concat(Zt)});case 8:return a=t.sent,F(a.data.count),t.next=12,y.Vy()({url:"".concat(jt,"/analysis/issuance-count?startDate=").concat(pt,"&endDate=").concat(Zt)});case 12:return n=t.sent,W(n.data.count),t.next=16,y.Vy()({url:"".concat(jt,"/analysis/apis-count?startDate=").concat(pt,"&endDate=").concat(Zt)});case 16:r=t.sent,T(r.data.count),t.next=23;break;case 20:t.prev=20,t.t0=t.catch(1),J(!1);case 23:J(!1);case 24:case"end":return t.stop()}}),t,null,[[1,20]])})));return function(){return t.apply(this,arguments)}}(),mt=function(){var t=(0,r.Z)((0,s.Z)().mark((function t(){var e,a,r,l,i;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=function(t){var e,a=[],s=(0,n.Z)(t.y.entries());try{for(s.s();!(e=s.n()).done;){var r=(0,c.Z)(e.value,2),l=r[0],i=r[1];a.push({value:i,name:(0,j.Z)(new Date(t.x[l]),"yyyy-MM-dd")})}}catch(o){s.e(o)}finally{s.f()}return a},t.next=3,y.Vy()({url:"".concat(jt,"/analysis/sessions-graph?startDate=").concat(pt,"&endDate=").concat(Zt)});case 3:return e=t.sent,t.next=6,y.Vy()({url:"".concat(jt,"/analysis/apis-graph?startDate=").concat(pt,"&endDate=").concat(Zt)});case 6:return a=t.sent,t.next=9,y.Vy()({url:"".concat(jt,"/analysis/transactions-graph?startDate=").concat(pt,"&endDate=").concat(Zt)});case 9:return r=t.sent,t.next=12,y.Vy()({url:"".concat(jt,"/analysis/issuance-graph?startDate=").concat(pt,"&endDate=").concat(Zt)});case 12:l=t.sent,Y(i(e.data)),at(i(a.data)),ct(i(r.data)),ut(i(l.data));case 17:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();o.useEffect((function(){gt(),mt()}),[]);var bt=function(){var t=(0,r.Z)((0,s.Z)().mark((function t(){return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,gt();case 2:return t.next=4,mt();case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Dt=function(){var t=(0,r.Z)((0,s.Z)().mark((function t(){var e,a,n;return(0,s.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.Vy()({url:"".concat(jt,"/analysis/apis-csv?startDate=").concat(pt,"&endDate=").concat(Zt)});case 2:e=t.sent,a="data:text/csv,"+e.data,"api.csv",(n=document.createElement("a")).href=a,n.download="api.csv",n.click();case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,S.jsxs)(u.Z,{maxWidth:"xl",style:{height:"calc(100vh - 68px)",paddingTop:"20px"},children:[(0,S.jsx)(h.Z,{style:{paddingBottom:"20px"},children:(0,S.jsx)(p.Z,{variant:"h4",children:"Statistics"})}),(0,S.jsxs)(h.Z,{style:{display:"flex",marginBottom:"20px"},children:[(0,S.jsx)(Z.Z,{id:"date",label:"From",type:"date",defaultValue:pt,sx:{width:220},InputLabelProps:{shrink:!0},onChange:function(t){console.log(t.target.value),ht(t.target.value)},style:{paddingRight:"15px"}}),(0,S.jsx)(Z.Z,{id:"date",label:"To",type:"date",defaultValue:Zt,sx:{width:220},InputLabelProps:{shrink:!0},onChange:function(t){return vt(t.target.value)},style:{paddingRight:"15px"}}),(0,S.jsx)(g.Z,{loading:G,variant:"outlined",disabled:G,onClick:bt,children:"Filter Stats"})]}),(0,S.jsxs)(h.Z,{sx:{width:"100%",height:"100%"},className:"tabs-start",children:[(0,S.jsx)(h.Z,{children:(0,S.jsxs)(d.Z,{value:a,onChange:function(t,e){i(e)},"aria-label":"basic tabs example",variant:"fullWidth",centered:!1,children:[(0,S.jsx)(x.Z,(0,l.Z)((0,l.Z)({label:"Sessions - ".concat(N)},V(0)),{},{style:{textAlign:"left",textTransform:"none",alignItems:"flex-start"}})),(0,S.jsx)(x.Z,(0,l.Z)((0,l.Z)({label:"API calls - ".concat(B)},V(1)),{},{className:"statistic-tab",style:{textAlign:"left",textTransform:"none",alignItems:"flex-start"}})),(0,S.jsx)(x.Z,(0,l.Z)((0,l.Z)({label:"Issuence - ".concat(E)},V(2)),{},{style:{textAlign:"left",textTransform:"none",alignItems:"flex-start"}})),(0,S.jsx)(x.Z,(0,l.Z)((0,l.Z)({label:"Blockchain Transactions - ".concat(P)},V(3)),{},{style:{textAlign:"left",textTransform:"none",alignItems:"flex-start"}}))]})}),(0,S.jsx)(K,{value:a,index:0,children:(0,S.jsx)(h.Z,{className:"tabpanel-box",style:{display:"flex",justifyContent:"center"},children:(0,S.jsxs)(m.w,{height:500,width:900,data:X,margin:{top:5,right:30,left:20,bottom:5},children:[(0,S.jsx)(b.q,{strokeDasharray:"3 3"}),(0,S.jsx)(D.K,{dataKey:"name"}),(0,S.jsx)(w.B,{label:{value:"Sessions",angle:-90,position:"left"}}),(0,S.jsx)(k.x,{type:"monotone",dataKey:"value",stroke:"#8884d8",activeDot:{r:8}})]})})}),(0,S.jsxs)(K,{value:a,index:1,children:[(0,S.jsx)(h.Z,{className:"tabpanel-box",style:{display:"flex",justifyContent:"center"},children:(0,S.jsxs)(m.w,{height:500,width:900,data:et,margin:{top:5,right:30,left:20,bottom:5},children:[(0,S.jsx)(b.q,{strokeDasharray:"3 3"}),(0,S.jsx)(D.K,{dataKey:"name"}),(0,S.jsx)(w.B,{label:{value:"Sessions",angle:-90,position:"left"}}),(0,S.jsx)(k.x,{type:"monotone",dataKey:"value",stroke:"#8884d8",activeDot:{r:8}})]})}),(0,S.jsx)(v.Z,{onClick:Dt,children:"Upload CSV"})]}),(0,S.jsx)(K,{value:a,index:2,children:(0,S.jsx)(h.Z,{className:"tabpanel-box",style:{display:"flex",justifyContent:"center"},children:(0,S.jsxs)(m.w,{height:500,width:900,data:ot,margin:{top:5,right:30,left:20,bottom:5},children:[(0,S.jsx)(b.q,{strokeDasharray:"3 3"}),(0,S.jsx)(D.K,{dataKey:"name"}),(0,S.jsx)(w.B,{label:{value:"Sessions",angle:-90,position:"left"}}),(0,S.jsx)(k.x,{type:"monotone",dataKey:"value",stroke:"#8884d8",activeDot:{r:8}})]})})}),(0,S.jsx)(K,{value:a,index:3,children:(0,S.jsx)(h.Z,{className:"tabpanel-box",style:{display:"flex",justifyContent:"center"},children:(0,S.jsxs)(m.w,{height:500,width:900,data:rt,margin:{top:5,right:30,left:20,bottom:5},children:[(0,S.jsx)(b.q,{strokeDasharray:"3 3"}),(0,S.jsx)(D.K,{dataKey:"name"}),(0,S.jsx)(w.B,{label:{value:"Sessions",angle:-90,position:"left"}}),(0,S.jsx)(k.x,{type:"monotone",dataKey:"value",stroke:"#8884d8",activeDot:{r:8}})]})})})]})]})}}}]);
//# sourceMappingURL=296.7fed2419.chunk.js.map