mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-28 09:55:36 +01:00
1 line
47 KiB
JavaScript
1 line
47 KiB
JavaScript
|
(this.webpackJsonpvmui=this.webpackJsonpvmui||[]).push([[0],{204:function(e,t,n){},219:function(e,t){},223:function(e,t,n){},224:function(e,t,n){},234:function(e,t,n){"use strict";n.r(t);var a=n(1),r=n.n(a),c=n(53),i=n.n(c),o=(n(204),n(9)),s=n(318),l=n(317),u=n(0),d=Object(a.createContext)({showInfoMessage:function(){}}),j=function(e){var t=e.children,n=Object(a.useState)({}),r=Object(o.a)(n,2),c=r[0],i=r[1],j=Object(a.useState)(!1),b=Object(o.a)(j,2),O=b[0],p=b[1],h=Object(a.useState)(void 0),f=Object(o.a)(h,2),x=f[0],v=f[1];Object(a.useEffect)((function(){x&&(i({message:x,key:(new Date).getTime()}),p(!0))}),[x]);return Object(u.jsxs)(d.Provider,{value:{showInfoMessage:v},children:[Object(u.jsx)(s.a,{open:O,autoHideDuration:4e3,onClose:function(e,t){"clickaway"!==t&&(v(void 0),p(!1))},children:Object(u.jsx)(l.a,{children:c.message})},c.key),t]})},b=n(352),O=n(353),p=n(328),h=n(246),f=n(344),x=n(242),v=n(329),m=n(331),y=n(323),g=n(327),S=n(149),E=n.n(S),_=n(3),T=n(16),w=n(40),C=n.n(w),A=n(145),R=n.n(A),I=n(146),k=n.n(I),U=n(105),M=n.n(U);C.a.extend(R.a),C.a.extend(k.a);var H,D=window.innerWidth/2,N=1,L=1578e8,P="YYYY-MM-DD[T]HH:mm:ss",q=[{long:"days",short:"d",possible:"day"},{long:"weeks",short:"w",possible:"week"},{long:"months",short:"M",possible:"mon"},{long:"years",short:"y",possible:"year"},{long:"hours",short:"h",possible:"hour"},{long:"minutes",short:"m",possible:"min"},{long:"seconds",short:"s",possible:"sec"},{long:"milliseconds",short:"ms",possible:"millisecond"}],Y=q.map((function(e){return e.short})),B=function(e){return+M()(e).format("0.000")},F=function(e){var t=e.match(/\d+/g),n=e.match(/[a-zA-Z]+/g);if(n&&t&&Y.includes(n[0]))return Object(_.a)({},n[0],t[0])},Q=function(e,t){var n=(t||new Date).valueOf()/1e3,a=e.trim().split(" ").reduce((function(e,t){var n=F(t);return n?Object(T.a)(Object(T.a)({},e),n):Object(T.a)({},e)}),{}),r=C.a.duration(a).asSeconds();return{start:n-r,end:n,step:B(r/D)||.001,date:z(t||new Date)}},z=function(e){return C()(e).utc().format(P)},G=function(e){var t=Math.floor(e%1e3),n=Math.floor(e/1e3%60),a=Math.floor(e/1e3/60%60),r=Math.floor(e/1e3/3600%24),c=Math.floor(e/864e5),i=["d","h","m","s","ms"];return[c,r,a,n,t].map((function(e,t){return e?"".concat(e).concat(i[t]):""})).filter((function(e){return e})).join(" ")},W=function(e){return new Date(1e3*e)},V=function(e,t){t?window.localStorage.setItem(e,JSON.stringify({value:t})):K([e])},J=function(e){var t=window.localStorage.getItem(e);if(null!==t)try{var n;return null===(n=JSON.parse(t))||void 0===n?void 0:n.value}catch(a){return t}},K=function(e){return e.forEach((function(e){return window.localStorage.removeItem(e)}))},X=["BASIC_AUTH_DATA","BEARER_AUTH_DATA"],Z=n(147),$=n.n(Z),ee=n(117),te=n.n(ee),ne={"time.duration":"range_input","time.period.date":"end_input","time.period.step":"step_input",displayType:"tab"},ae=function(e){var t=new Map(Object.entries(ne)),n=te()(e,"query",""),a=[];n.forEach((function(n,r){t.forEach((function(t,n){var c=te()(e,n,"");if(c){var i=encodeURIComponent(c);a.push("g".concat(r,".").concat(t,"=").concat(i))}})),a.push("g".concat(r,".expr=").concat(n))})),function(e){var t=window;if(t){var n="".concat(t.location.protocol,"//").concat(t.location.host).concat(t.location.pathname,"?").concat(e);t.history.pushState({path:n},"",n)}}(a.join("&"))},re=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.location.search,a=$.a.parse(n,{ignoreQueryPrefix:!0});return te()(a,e,t||"")},ce=re("g0.range_input","1h"),ie=(H=re("g0.end_input",new Date(C()().utc().format(P))),C()(H).utcOffset(0,!0).local().format(P)),oe=function(){var e,t=(null===(e=window.location.search.match(/g\d+.expr/gim))||void 0===e?void 0:e.length)||1;return new Array(t).fill(1).map((function(e,t){return re("g".concat(t,".expr"),"")}))}(),se={serverUrl:window.location.href.replace(/\/(?:prometheus\/)?(?:graph|vmui)\/.*/,"/prometheus/"),displayType:re("tab","chart"),query:oe,queryHistory:oe.map((function(e){return{index:0,values:[e]}})),time:{duration:ce,period:Q(ce,new Date(ie))},queryControls:{autoRefresh:!1,autocomp
|