2021-12-06 09:17:44 +01:00
|
|
|
(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){},231:function(e,t,n){"use strict";n.r(t);var a=n(1),r=n.n(a),c=n(78),i=n.n(c),o=(n(204),n(9)),s=n(313),l=n(312),u=n(0),d=Object(a.createContext)({showInfoMessage:function(){}}),j=function(){return Object(a.useContext)(d)},b=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],h=b[1],f=Object(a.useState)(void 0),p=Object(o.a)(f,2),x=p[0],v=p[1];Object(a.useEffect)((function(){x&&(i({message:x,key:(new Date).getTime()}),h(!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),h(!1))},children:Object(u.jsx)(l.a,{children:c.message})},c.key),t]})},O=n(348),h=n(349),f=n(324),p=n(242),x=n(336),v=n(238),m=n(325),y=n(326),g=n(327),E=n(318),_=n(323),S=n(154),T=n.n(S),C=n(3),A=n(16),w=n(43),I=n.n(w),R=n(150),U=n.n(R),k=n(151),D=n.n(k),H=n(112),M=n.n(H);I.a.extend(U.a),I.a.extend(D.a);var L,N=window.innerWidth/2,Y=1,P=1578e8,q="YYYY-MM-DD[T]HH:mm:ss",B=[{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"}],z=B.map((function(e){return e.short})),F=function(e){return+M()(e).format("0.000")},Q=function(e){var t=e.match(/\d+/g),n=e.match(/[a-zA-Z]+/g);if(n&&t&&z.includes(n[0]))return Object(C.a)({},n[0],t[0])},W=function(e,t){var n=(t||new Date).valueOf()/1e3,a=e.trim().split(" ").reduce((function(e,t){var n=Q(t);return n?Object(A.a)(Object(A.a)({},e),n):Object(A.a)({},e)}),{}),r=I.a.duration(a).asSeconds();return{start:n-r,end:n,step:F(r/N)||.001,date:G(t||new Date)}},G=function(e){return I()(e).utc().format(q)},V=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(" ")},J=function(e){return new Date(1e3*e)},X=function(e,t){t?window.localStorage.setItem(e,JSON.stringify({value:t})):Z([e])},K=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}},Z=function(e){return e.forEach((function(e){return window.localStorage.removeItem(e)}))},$=["BASIC_AUTH_DATA","BEARER_AUTH_DATA"],ee=n(152),te=n.n(ee),ne=n(137),ae=n.n(ne),re={query:"g0.expr","time.duration":"g0.range_input","time.period.date":"g0.end_input","time.period.step":"g0.step_input",displayType:"tab"},ce=function(e){var t=new Map(Object.entries(re)),n=[];t.forEach((function(t,a){var r=ae()(e,a,"");if(r){var c=encodeURIComponent(r);n.push("".concat(t,"=").concat(c))}})),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)}}(n.join("&"))},ie=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.location.search,a=te.a.parse(n,{ignoreQueryPrefix:!0});return ae()(a,e,t||"")},oe=ie("g0.range_input","1h"),se=(L=ie("g0.end_input",new Date(I()().utc().format(q))),I()(L).utcOffset(0,!0).local().format(q)),le=ie("g0.expr",""),ue={serverUrl:window.location.href.replace(/\/(?:prometheus\/)?(?:graph|vmui)\/.*/,"/prometheus/"),displayType:ie("tab","chart"),query:le,queryHistory:{index:0,values:[le]},time:{duration:oe,period:W(oe,new Date(se))},queryControls:{autoRefresh:!1,autocomplete:K("AUTOCOMPLETE")||!1,nocache:K("NO_CACHE")||!1}};function de(e,t){switch(t.type){case"SET_DISPLAY_TYPE":return Object(A.a)(Object(A.a)({},e),{},{displayType:t.payload});case"SET_SERVER":return Object(A.a)(Object(A.a)({},e),{
|