1
|
!function(){try{var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="0b7ee5cc-170e-42f2-9b17-9ba9a29bc682",n._sentryDebugIdIdentifier="sentry-dbid-0b7ee5cc-170e-42f2-9b17-9ba9a29bc682")}catch(n){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"6845f9ce010d5a446e5d4a40f17204cb8341a07a"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[2008],{48450:function(n,t,e){e.d(t,{Kp:function(){return l},MN:function(){return k},ND:function(){return p},hN:function(){return g},jc:function(){return w},sr:function(){return v},uk:function(){return d}});var r=e(4942),o=(e(21249),e(57640),e(9924),e(41539),e(88674),e(92087),e(74916),e(15306),e(92222),e(82481),e(47941),e(82526),e(57327),e(88449),e(2490),e(59849),e(38880),e(15581),e(34514),e(54747),e(49337),e(33321),e(69070),e(26398)),a=e(66152),u=e(78710);function i(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,r)}return e}function c(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?i(Object(e),!0).forEach((function(t){(0,r.Z)(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):i(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}var s=function(n){return{id:n.roomID,alertCounter:n.alarmCounter,unreachableCount:n.unreachableCount,state:n.state}},f=function(n){return{results:(n.results||[]).map(s)}},l=function(n){return(0,u.Ly)(n)?Promise.resolve({data:{results:[]}}):o.Z.get("/api/v2/spaces/".concat(n,"/alarms"),{transform:f})},d=function(n){return(0,u.Ly)(n)?Promise.resolve({data:null}):o.Z.get("/api/v2/spaces/".concat(n,"/alarms/metas"))},p={contexts:null,names:null,roles:null},y=function(n){var t=n.alerts,e=void 0===t?[]:t,r=n.nodes,o=void 0===r?[]:r,u=n.alert_instances,i=void 0===u?[]:u;return(0,a.k5)(i.map((function(n){var t=n.ni,r=n.ati,a=n.tr_i,u=n.tr_v,i=n.tr_t,c=n.cfg,s=n.info,f=n.fami,l=n.ch,d=n.ch_n,p=void 0===d?l:d,y=n.ctx,v=n.v,m=n.t,g=n.flags,b=n.st,w=n.src,k=n.units,h=n.to,O=n.cl,_=n.cm,C=n.tp,L=o[t],I=e[r],U=I.nm,j=I.cr,Z=I.wr,E=I.cl,P=I.er,D=I.in,S=I.nd,A=I.cfg;return{mg:L.mg,nd:L.nd,nodeId:L.nd||L.mg,id:a,context:y,value:v,status:b.toLowerCase(),name:U,displayName:(U||"unknown_alert").replace(/_/g," "),alert:alert,criticalCount:j,warningCount:Z,clearCount:E,errorCount:P,instanceCount:D,nodeCount:S,configCount:A,lastStatusChangeValue:u,lastStatusChange:i,configHash:c,info:s,family:f,instance:l,instanceName:p,lastUpdated:m,flags:g,units:k,source:w,recipient:h,class:O,component:_,type:C}})))},v=function(n,t){return(0,u.Ly)(n)?o.Z.get("/api/v2/alerts?options=summary,instances,values,minify&status=raised",{baseURL:window.envSettings.agentApiUrl,transform:y}):o.Z.post("/api/v2/spaces/".concat(n,"/rooms/").concat(t,"/alerts"),{scope:{nodes:[],contexts:[]},selectors:{status:["raised"]},options:["summary","values","instances"]},{transform:y})},m=function(n){var t=n.transitions,e=void 0===t?[]:t;if(!e[0])return{};var r=e[0],o=r.config_hash_id,a=r.context,u=r.machine_guid,i=r.info,c=r.transition_id,s=r.node_id,f=r.alert,l=r.new,d=l.status,p=l.value,y=r.when,v=r.old,m=v.status,g=v.value,b=v.duration,w=r.instance,k=r.instance_n,h=void 0===k?w:k,O=r.units;return{configHash:o,context:a,name:f,id:c,mg:u,nodeId:s||u,nd:s,alert:f,info:i,displayName:(f||"unknown_alert").replace(/_/g," "),status:d.toLowerCase(),lastStatusChange:y,lastStatusChangeValue:p,prevStatus:m.toLowerCase(),prevValue:g,prevDuration:b,instance:w,instanceName:h,units:O}},g=function(n,t,e){return(0,u.Ly)(n)?o.Z.get("/api/v2/alert_transitions?options=minify&transition=".concat(e),{baseURL:window.envSettings.agentApiUrl,transform:m}).then((function(e){var r=e.data;return O(n,t,r.configHash,r)})):o.Z.post("/api/v2/spaces/".concat(n,"/rooms/").concat(t,"/alert_transitions"),{transition:e},{transform:m}).then((function(e){var r=e.data;return O(n,t,r.configHash,r)}))},b=function(n){var t=n.alerts;return(void 0===t?[]:t).map((function(n){var t=n.nm,e=n.cr,r=n.wr,o=n.cl,a=n.er,u=n.in,i=n.nd,c=n.cfg;return{name:t,displayName:(t||"unknown_alert").replace(/_/g," "),criticalCount:e,warningCount:r,clearCount:o,errorCount:a,instanceCount:u,nodeCount:i,configCount:c}}))},w=function(n,t){return(0,u.Ly)(n)?o.Z.get("/api/v2/alerts?options=minify",{baseURL:window.envSettings.agentApiUrl,transform:b}).then((function(n){return n.data})):o.Z.post("/api/v2/spaces/".concat(n,"/rooms/").concat(t,"/alerts"),{scope:{nodes:[]}},{transform:b}).then((function(n){return n.data}))},k=function(n,t,e){return(0,u.Ly)(n)?o.Z.get("/api/v2/alerts?options=summary,values,instances,minify&alert=".concat(e),{baseURL:window.envSettings.agentApiUrl,transform:y}).then((function(n){return n.data})):o.Z.post("/api/v2/spaces/".concat(n,"/rooms/").concat(t,"/alerts"),{scope:{nodes:[]},selectors:{alert:[e]},options:["summary","instances","values"]},{transform:y}).then((function(n){return n.data}))},h=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var e=t.class,r=t.component,o=t.type,a=t.info,u=t.value,i=u.calc,s=void 0===i?"":i,f=u.update_every,l=u.units,d=u.db,p=t.status,y=t.notification||{},v=y.type,m=y.exec,g=y.to,b=y.delay,w=y.repeat||{},k=w.warn,h=w.crit,O=p||{},_=O.warn,C=O.crit,L=O.green,I=O.red,U=d||{},j=U.dimensions,Z=U.method,E=U.after,P=U.before,D=U.options;return c(c({info:a},n),{},{configInfo:a,class:e,component:r,type:o,calculation:s,updateEvery:f,units:l,warning:_,critical:C,lookupDimensions:j,lookupMethod:Z,lookupAfter:E,lookupBefore:P,lookupOptions:D,notificationType:v,exec:m,recipient:g,delay:b,warnRepeatEvery:k,critRepeatEvery:h,green:L,red:I})}},O=function(n,t,e){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,u.Ly)(n)?o.Z.get("/api/v2/alert_config?options=minify&config=".concat(e),{baseURL:window.envSettings.agentApiUrl,transform:h(r)}):o.Z.post("/api/v2/spaces/".concat(n,"/rooms/").concat(t,"/alert_config"),{config:e},{transform:h(r)})}},84074:function(n,t,e){e.d(t,{E3:function(){return u},Gs:function(){return l},HI:function(){return f},IG:function(){return s},bc:function(){return i},p$:function(){return c}});var r=e(4480),o=e(80239),a=e(48450),u={id:null,loaded:!1,nodeId:null,instance:null,instanceName:null,name:"",calculation:"",lookupAfter:0,lookupBefore:0,status:"unknown",date:"",fullyLoaded:!1,fullyLoading:!1,info:"",configInfo:"",warning:"",critical:"",updateEvery:0,source:"",recipient:"Unknown",units:"",delayUpDuration:null,delayDownDuration:null,delayMaxDuration:null,delayMultiplier:null,delayUpToTimestamp:null,lookupDimensions:"",lookupMethod:"",lookupOptions:"",class:"Unknown",type:"Unknown",component:"Unknown"};t.ZP=(0,r.cn)({key:"alert",default:{}});var i=(0,r.cn)({key:"selectedAlert",default:null}),c=(0,r.cn)({key:"alertsTabsAtom",default:o.U}),s=(0,r.xu)({key:"alertConfigurations",default:function(n){var t=n.spaceId,e=n.roomId;return(0,a.jc)(t,e)}}),f=(0,r.xu)({key:"alertInstances",default:function(n){var t=n.spaceId,e=n.roomId,r=n.name;return(0,a.MN)(t,e,r)}}),l=(0,r.xu)({key:"selectedAlertConfiguration",default:{alertName:null,nodeId:null}})},12008:function(n,t,e){e.d(t,{Bk:function(){return I},E5:function(){return b},ER:function(){return h},E_:function(){return C},JU:function(){return E},O0:function(){return w},__:function(){return P},fp:function(){return g},n_:function(){return j},sb:function(){return _},v3:function(){return D},w4:function(){return Z},yx:function(){return O}});var r=e(4942),o=(e(21249),e(57640),e(9924),e(57327),e(41539),e(88449),e(2490),e(59849),e(85827),e(25387),e(72608),e(47941),e(82526),e(38880),e(15581),e(34514),e(54747),e(49337),e(33321),e(69070),e(67294)),a=e(4480),u=e(37518),i=e(96929),c=e(99322),s=e(97945),f=e(80239),l=e(74059),d=e(84074),p=e(48450),y=e(45771);function v(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,r)}return e}function m(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?v(Object(e),!0).forEach((function(t){(0,r.Z)(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):v(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}var g=(0,a.CG)({key:"alertState",get:function(n){var t=n.id,e=n.key;return function(n){var r=(0,n.get)(d.ZP)[t]||d.E3;return e?r[e]:r}},set:function(n){var t=n.id,e=n.key;return function(n,o){var a=n.set;a(d.ZP,e?"function"!==typeof o?function(n){return m(m({},n),{},(0,r.Z)({},t,m(m({},n[t]),{},(0,r.Z)({},e,o))))}:function(n){return m(m({},n),{},(0,r.Z)({},t,m(m({},n[t]),{},(0,r.Z)({},e,o(n[t][e])))))}:function(n){return m(m({},n),{},(0,r.Z)({},t,m(m(m({},d.E3),n[t]),o)))})}}}),b=function(n,t){return(0,a.sJ)(g({id:n,key:t}))},w=function(){return(0,a.FV)(d.bc)},k=(0,a.CG)({key:"alertsState",get:function(n){return function(t){var e=t.get;return n.map((function(n){return e(g({id:n}))}))}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),h=function(n){return(0,a.sJ)(k(n))},O=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.spaceId,r=t.roomId,i=(0,l.th)();e=e||i;var c=(0,u.UL)();r=r||c;var s=(0,a._8)((function(t){var o=t.set;return function(){o(g({id:n,key:"fullyLoading"}),!0);var t=(0,p.hN)(e,r,n);return t.then((function(t){var e=t.data;return o(g({id:n}),m(m({},e),{},{fullyLoaded:!0,fullyLoading:!1,loaded:!0}))})).catch((function(){return o(g({id:n,key:"fullyLoading"}),!1)})),function(){return t.cancel()}}}),[r,e]);(0,o.useEffect)((function(){n&&s()}),[n,s])},_=function(){var n=L(),t=(0,i.zN)(),e=(0,s.Ne)(t);return(0,o.useMemo)((function(){return e.map((function(t){var e=n.filter((function(n){return n.nodeId===t.id}));if(!e.length)return t;var o=e.map((function(n){return n.status}));return m(m({},t),{},(0,r.Z)({},f.nb.alertStatus,(0,y.j)(o)))}))}),[n,e])},C=(0,a.CG)({key:"roomAlerts",get:function(n){return function(t){var e=t.get,r=e((0,c.e8)({id:n,key:"ids"}));return e(k(r))}}}),L=function(){var n=(0,u.UL)();return(0,a.sJ)(C(n))},I=function(){var n=(0,u.UL)();return(0,a.sJ)((0,c.e8)({id:n,key:"loaded"}))},U={warning:0,critical:0,clear:0},j=function(n){var t=h(n);return(0,o.useMemo)((function(){return t.reduce((function(n,t){var e=t.status;return n[e]=n[e]+1,n}),m({},U))}),[n])},Z=function(){var n=(0,l.th)(),t=(0,u.UL)();return(0,a.sJ)((0,d.IG)({spaceId:n,roomId:t}))},E=function(n,t){var e=(0,l.th)(),r=(0,u.UL)(),i=(0,a.sJ)((0,d.HI)({spaceId:e,roomId:r,name:n}));return(0,o.useMemo)((function(){return t?i.filter((function(n){return n.nodeId===t})):i}),[i,t])},P=function(){var n=(0,u.UL)();return(0,a.FV)((0,d.Gs)(n))},D=function(){var n=(0,u.UL)();return(0,a.rb)((0,d.Gs)(n))}},99322:function(n,t,e){e.d(t,{e8:function(){return u},uy:function(){return i}});var r=e(4480),o=e(37518),a={ids:(0,r.xu)({key:"roomAlertIds",default:[]}),error:(0,r.xu)({key:"roomAlertError",default:null}),updatedAt:(0,r.xu)({key:"roomAlertsUpdatedAt",default:""}),loaded:(0,r.xu)({key:"roomAlertsLoaded",default:!1})},u=(0,r.CG)({key:"roomAlertState",get:function(n){var t=n.id,e=n.key;return function(n){return(0,n.get)(a[e](t))}},set:function(n){var t=n.id,e=n.key;return function(n,r){(0,n.set)(a[e](t),r)}}}),i=function(n){return function(n,t){return(0,r.sJ)(u({id:n,key:t}))}((0,o.UL)(),n)}}}]);
|