summaryrefslogtreecommitdiffstats
path: root/web/gui/v2/3360.6cced5680aec91f164f2.chunk.js
blob: cf81bf1568255c5fa8325e49487b4de73486d4c0 (plain)
1
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="14f848fe-beba-4cc9-9325-700155db4266",e._sentryDebugIdIdentifier="sentry-dbid-14f848fe-beba-4cc9-9325-700155db4266")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"0c0a7a41a0e7ecb4870dbce38dbd7d5e0913bb7f"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[3360],{85287:function(e,t,n){n.d(t,{d:function(){return a}});n(40658);var r=["","k","m","B","T","P","E"],a=function(e){if(!e)return 0;var t=Math.log10(Math.abs(e))/3|0;if(!t)return e;var n=r[t];return(e/Math.pow(10,3*t)).toFixed(1)+n}},61294:function(e,t,n){n.d(t,{Z:function(){return D}});var r=n(87462),a=n(29439),o=n(67294),l=n(61152),i=n(59978),u=n(12008),c=n(16645),f=n(7693),s=n(20686),d=n(32071),m=n(78266),g=n(92253),b=n(39840),v=(0,o.memo)((function(e){var t=e.id,n=(0,u.E5)(t),r=n.fullyLoaded,a=n.nodeId,l=n.instance,i=n.lastStatusChangeValue,c=n.lastStatusChange,f=n.units,s=n.context,d=n.value,m=n.lastUpdated,v=n.status,p=(0,b.pK)(d,f),h=(0,b.pK)(i,f);return o.createElement(g.Z,{instance:l,context:s,formattedLastValue:p,formattedLastStatusChangeValue:h,lastStatusChange:c,lastUpdated:m,isFormattedValueLoaded:"clear"===v||r,nodeId:a,status:v,testid:"alertDetailsModal"})})),p=(n(92222),n(41539),n(88674),n(17727),n(74059)),h=n(37518),y=n(89250),w=n(87267),Z=function(e){var t=e.alertId,n=e.testid,r=(0,p.uk)(),a=(0,h.vf)(),l="/spaces/".concat(r,"/rooms/").concat(a,"/alerts/").concat(t),u=(0,y.s0)(),c=(0,w.Z)(),f=c.sendButtonClickedLog,s=c.isReady,d=(0,o.useCallback)((function(e){e.preventDefault(),f({dataGa:"".concat(n,"::view-alert-button")}).finally((function(){u(l)}))}),[u,l,s]);return o.createElement(i.Button,{as:"a","data-testid":"".concat(n,"-view-alert-button"),"data-ga":"".concat(n,"::view-alert-button"),href:l,onClick:d,label:"View alert page",width:"224px"})},E=n(80854),I=n(29876),k=n(50709),C=n(63346),O=function(e){var t=e.alertId,n=e.onClose,r=(0,u.E5)(t),a=r.name,l=void 0===a?"unknown alert":a,g=r.status,b=r.fullyLoaded,p=r.info;return(0,u.yx)(t),o.createElement(c.u6,{right:!0,closeOnEsc:!0,closeOnOverlayClick:!0,onClose:n},o.createElement(C.ZP,{mode:"AlertDetailsModal"},o.createElement(f.x,{onClose:n,title:l,"data-testid":"alertDetailsModal-alertName"},o.createElement(s.Z,{type:"".concat(g,"AlertsTable"),icon:"alarm_bell","data-testid":"alertDetailsModal-alertPill"},g)),o.createElement(c.TZ,{overflow:{vertical:"auto"},hasModalTitle:!1,gap:2,hasFooter:!0},!b&&o.createElement(m.Z,{title:"Loading alert..."}),b&&o.createElement(o.Fragment,null,o.createElement(E.Z,{iconName:"monitoring",iconSize:"20px"},"Time Values"),o.createElement(I.Z,{alertId:t}),o.createElement(E.Z,{iconName:"documentation"},"Alert Description"),o.createElement(i.Text,{"data-testid":"alertDetailsModal-info"},p),o.createElement(k.Z,{alertId:t})),b&&o.createElement(v,{id:t}),b&&o.createElement(d.Z,{id:t})),o.createElement(c.ZW,null,o.createElement(Z,{alertId:t,testid:"alertDetailsModal"}))))},D=function(){var e=(0,l.Z)("alertDetailsModal"),t=(0,a.Z)(e,5),n=t[0],i=t[2],u=t[3],c=t[4],f=(0,o.useCallback)((function(e){var t=e.alertId;i("",{alertId:t})}),[]),s=(0,o.useMemo)((function(){return o.createElement(O,(0,r.Z)({onClose:u},c))}),[c]);return[n,f,u,s]}},597:function(e,t,n){n.d(t,{K:function(){return g}});n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),a=n(29439),o=(n(26699),n(32023),n(92222),n(41539),n(64211),n(2490),n(41874),n(85827),n(25387),n(72608),n(47941),n(21249),n(57640),n(9924),n(57327),n(88449),n(59849),n(4480)),l=n(4822),i=n(37518),u=n(12008);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var s=function(e){return function(t,n){return!Array.isArray(n)||!n.length||n.includes(t[e])}},d={alertStatuses:s("status"),alertClasses:s("class"),alertRoles:s("recipient"),alertTypeComponents:function(e,t){return!Array.isArray(t)||!t.length||t.includes("".concat(e.type,"|").concat(e.component))},selectedNodeIds:s("nodeId")},m=(0,o.CG)({key:"alertsFiltered",get:function(e){var t=e.extraKey,n=e.roomId,r=e.omit,o=void 0===r?[]:r,i=e.keepAll;return function(e){var r,c=e.get,s=c((0,l.dz)({key:n,extraKey:t,flavour:"arr"})),m=Object.keys(s).reduce((function(e,t){return o.includes(t)||e.push([t,s[t]]),e}),[]),g=c((0,u.E_)(n));if(!o.includes("selectedNodeIds")&&(null===(r=s.selectedNodeIds)||void 0===r||!r.length)){var b=c((0,l.dz)({key:n,param:"selectedNodeIds",flavour:"arr"}));null!==b&&void 0!==b&&b.length&&m.push(["selectedNodeIds",b])}if(!m.length)return g;var v=function(e){return function(t){return!e.some((function(e){var n=(0,a.Z)(e,2),r=n[0],o=n[1];return!!d[r]&&!d[r](t,o)}))}}(m);return i?g.map((function(e){return v(e)?e:f(f({},e),{},{hidden:!0})})):g.filter(v)}}}),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.extraKey,n=e.omit,r=void 0===n?[]:n,a=e.keepAll,l=void 0!==a&&a,u=(0,i.UL)();return(0,o.sJ)(m({extraKey:t,roomId:u,omit:r,keepAll:l}))}},62340:function(e,t){t.Z={clear:"clear",normal:"normal",warning:"warning",critical:"critical",unreachable:"unreachable"}},25517:function(e,t,n){n.d(t,{ZP:function(){return y},$B:function(){return v},bG:function(){return h}});var r=n(15861),a=n(29439),o=n(93433),l=n(64687),i=n.n(l),u=(n(91058),n(21249),n(57640),n(9924),n(2707),n(57327),n(41539),n(88449),n(2490),n(59849),n(92222),n(67294)),c=n(4822),f=n(2077),s=function(e){var t=e.after,n=e.before,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{offset:6e4,limit:Date.now()},a=r.offset,o=function(e,t){var n=t.offset,r=t.limit,a=n/2;return e+a<=r?a:r<e?0:r-e}(n,{offset:a,limit:r.limit});return[t-(a-o),n+o]},d=n(87267),m=n(16294),g=function(e,t){return e||t?s({after:parseInt(e),before:parseInt(t)},function(e){var t=Date.now();return{limit:t,offset:t-e<6e4?3e4:15e3}}(t)):b},b=[null,null],v=function(){var e=(0,c.by)(),t=e.after,n=e.before,r=e.highlight;if(!r.after||!r.before)return b;if(t<0){var a=Date.now();if(r.before<a+t)return b;if(r.after>a)return b}else{if(r.before<t)return b;if(r.after>n)return b}return[r.after,r.before]},p=function(e,t){if(e<0){var n=Date.now();e=1e3*Math.floor(n/1e3+e),t=1e3*Math.floor(n/1e3)}return{after:e,before:t}},h=function(e,t,n){var l=(0,u.useState)(),s=(0,a.Z)(l,2),b=s[0],h=s[1],y=(0,u.useState)(!1),w=(0,a.Z)(y,2),Z=w[0],E=w[1],I=(0,d.Z)().sendLog,k=function(){var e=v();return(0,u.useMemo)((function(){return g.apply(void 0,(0,o.Z)(e))}),(0,o.Z)(e))}(),C=(0,a.Z)(k,2),O=C[0],D=C[1],x=(0,c.by)(),A=x.after,S=x.before,M=(0,f.VG)({nodeIds:n,flavour:"rhs"},e,t),j=(0,a.Z)(M,1)[0],N=function(){var e=(0,r.Z)(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p(A,S),E(!0),e.prev=2,e.next=5,j({flavour:"rhs",highlightAfter:O||t.after,highlightBefore:D||t.before,baselineAfter:O?t.after:null,baselineBefore:D?t.before:null,method:"anomaly-rate",aggregation:"avg",group:"average",nodeIds:n,options:["raw","null2zero"],groupBy:["context"]});case 5:E(!1),I({action:m.Nw.elementViewed,feature:"AnomalyRates-TOC",isSuccess:!0},!0),e.next=16;break;case 9:if(e.prev=9,e.t0=e.catch(2),!e.t0.isCancel){e.next=13;break}return e.abrupt("return");case 13:h(e.t0),E(!1),I({action:m.Nw.elementViewed,feature:"AnomalyRates-TOC",isFailure:!0},!0);case 16:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}();return[N,Z,b]},y=function(e,t,n){var r=function(){var e=(0,u.useState)(0),t=(0,a.Z)(e,2),n=t[0],r=t[1];return[n,(0,u.useCallback)((function(){return r((function(e){return e+1}))}),[])]}(),o=(0,a.Z)(r,2),l=o[0],i=o[1],s=(0,u.useState)(),m=(0,a.Z)(s,2),g=m[0],b=m[1],p=v(),h=(0,a.Z)(p,2),y=h[0],w=h[1],Z=(0,c.by)(),E=Z.after,I=Z.before,k=(0,f.d5)({nodeIds:n,flavour:"anomaly"},e,t),C=k.contexts,O=k.metadata,D=k.getWeights,x=k.loading,A=(0,d.Z)(),S=A.sendLog,M=A.isReady;return(0,u.useEffect)((function(){if(y&&w&&w&&y)try{S({feature:"AnomalyAdvisor",isStart:!0}),D({highlightAfter:y,highlightBefore:w,baselineAfter:E,baselineBefore:I,method:"anomaly-rate",aggregation:"avg",group:"average",nodeIds:n,options:["null2zero","raw"],groupBy:["context","dimension"]})}catch(e){if(S({feature:"AnomalyAdvisor",isFailure:!0}),e.isCancel)return;b(e)}}),[n.length,w,y,l,M]),[(0,u.useMemo)((function(){return C.filter((function(e){var t;return((null===(t=O[e])||void 0===t?void 0:t.weight)||0)>0})).sort((function(e,t){var n=O[e].weight||0,r=O[t].weight||0;return n!=r?n>r?-1:1:0})).map((function(e){var t=e.split(",");return t.length>1?"".concat(t[1],"::").concat(t[0]):e}))}),[C,O]),C,O,x,g,i]}},44109:function(e,t,n){n.d(t,{e:function(){return r}});n(54678);var r=function(e){return function(e){return new Intl.NumberFormat("en-US",{style:"percent",maximumFractionDigits:e})}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:2).format(e)};t.Z=function(e){return e&&"0"!==e?"".concat(parseFloat(e).toFixed(2),"%"):"-"}}}]);