summaryrefslogtreecommitdiffstats
path: root/web/gui/v2/3253.48f218e54858427e997b.chunk.js
blob: 2bdb7fa43f9be5e7e4324b30893e7e42098051c3 (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]="31541361-6bca-432e-9c9f-f691452341e3",e._sentryDebugIdIdentifier="sentry-dbid-31541361-6bca-432e-9c9f-f691452341e3")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"8b7b01b6c705cf50f8050ce0fb8fc6b58fe68567"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[3253],{16978:function(e,t,n){var l=n(87462),a=n(45987),r=n(67294),i=n(54576),o=n(70486),c=n(86954),u=n(20581),s=n(16374),d=n(1981),m=n(28138),p=n(18892),h=n(63076),g=n(65855),v=["width","height"],f=(0,r.forwardRef)((function(e,t){var n=e.width,i=e.height,o=(0,a.Z)(e,v);return r.createElement(c.ChartWrapper,{width:n,height:i},r.createElement(g.x1,(0,l.Z)({hasHeader:!1,hasFilters:!1,hasFooter:!1,width:n,height:i},o,{ref:t})))})),E=(0,o.default)(f,{tile:!0}),x={dygraph:g.ZP,easypiechart:m.ZP,gauge:s.ZP,number:p.ZP,groupBoxes:u.ZP,d3pie:d.default,bars:h.ZP},b=function(e){var t=(0,i.useChart)(),n=(0,r.useMemo)((function(){if(!t)return null;var e=t.getAttributes(),n=e.chartLibrary;return e.sparkline?E:x[n]}),[t]);return n?r.createElement(n,(0,l.Z)({},e,{chart:t})):null};t.Z=(0,i.withChartProvider)((0,r.memo)(b))},54244:function(e,t,n){var l=n(67294),a=n(93416);t.Z=function(e){var t=e.flavour,n=e.icon,r=e.children;return l.createElement(a.Pill,{icon:n,textProps:{textTransform:"capitalize"},flavour:t},r)}},92253:function(e,t,n){var l=n(4942),a=(n(92222),n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(67294)),r=n(16978),i=n(50308),o=n.n(i),c=n(93416),u=n(91128),s=n(78266),d=n(74059),m=n(37518),p=n(9058),h=n(22648),g=n(39840);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,l)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var E=function(e){return function(t){return"alert-modal::".concat(e.getAttribute("id"),"::").concat(t)}},x={width:"108px",height:"77px"};t.Z=function(e){var t=e.instance,n=e.context,l=e.isFormattedValueLoaded,i=e.nodeId,v=e.status,b=e.lastStatusChange,y=e.formattedLastStatusChangeValue,C=e.lastUpdated,w=e.spaceId,D=e.roomId,S=e.setChartSelected,T=void 0===S?o():S,I=(0,d.th)();w=w||I;var k=(0,m.UL)();D=D||k;var A=(0,h.m)(),F=(0,p.e)(),O=(0,u.Z)();(0,a.useEffect)((function(){return O(),O}),[]);var Z=(0,d.Q6)(),z=(0,a.useMemo)((function(){if(l){var e=F.makeChart({attributes:{nodeId:i,contextScope:[n],selectedInstances:t&&i?["".concat(t,"@").concat(i)]:[],id:t,roomId:D,enabledResetRange:!1,overlays:{proceeded:{type:"proceeded"},alarm:{type:"alarm",status:v,value:y,when:b}},host:Z?"".concat(window.envSettings.agentApiUrl,"/api/v2"):"".concat(window.envSettings.apiUrl,"/api/v3/spaces/").concat(w,"/rooms/").concat(D),nodesScope:[i],toolboxElements:[],sparkline:A,hasToolbox:!A},makeTrack:E});return F.getRoot().appendChild(e),e}}),[t,l]);return(0,g.Wi)({lastUpdated:C,lastStatusChange:b},l),(0,a.useEffect)((function(){return T((function(e){return f(f({},e),z)})),function(){z&&z.destroy(),T(null)}}),[z]),a.createElement(c.Flex,{flex:!1,width:"100%",height:75},l&&z?a.createElement(r.Z,{"data-chartid":t,chart:z,hasHeader:!A,hasFooter:!A}):a.createElement(s.Z,{iconProps:x,title:"Loading chart..."}))}},77625:function(e,t,n){n.r(t),n.d(t,{default:function(){return fe}});var l=n(67294),a=n(93416),r=n(29439),i=n(5312),o=n(46667),c=n(37518),u=n(16978),s=n(9058),d=n(64504),m=function(){var e=(0,i.Lb)().getAttribute("id"),t=(0,c.UL)(),n=(0,d.u)(),a=(0,s.e)(),r=(0,l.useMemo)((function(){var l=a.makeChart({attributes:{contextScope:[e],height:80,id:e,roomId:t}});return n.appendChild(l),l}),[n,t,e]);return l.createElement(u.Z,{margin:[0,0,2],chart:r,"data-chartid":e,"data-track":r.track("container")})},p=(0,l.memo)(m),h=n(12008),g=n(92253),v=n(39840),f=n(74059),E=function(e){var t=e.alertId,n=(0,f.th)(),o=(0,c.UL)(),u=(0,i.rJ)(),s=(0,r.Z)(u,2)[1],d=(0,h.E5)(t),m=d.fullyLoaded,p=void 0!==m&&m,E=d.units,x=d.lastStatusChangeValue,b=d.lastStatusChange,y=d.context,C=d.instance,w=d.nodeId,D=d.status,S=d.lastUpdated,T=d.value;(0,h.yx)(t,{spaceId:n,roomId:o});var I=(0,v.pK)(T,E),k=(0,v.pK)(x,E);return p?l.createElement(g.Z,{id:t,context:y,instance:C,formattedLastValue:I,formattedLastStatusChangeValue:k,lastStatusChange:b,lastUpdated:S,isFormattedValueLoaded:p,nodeId:w,status:D,testid:"alertView",spaceId:n,roomId:o,setChartSelected:s}):l.createElement(a.Flex,{height:"200px"},"Loading chart...")},x=function(e){var t=e.title,n=void 0===t?"Chart preview":t,c=(0,o.Z)(!0),u=(0,r.Z)(c,2),s=u[0],d=u[1],m=(0,i.Lb)();return l.createElement(a.Flex,{column:!0,gap:2,padding:[2,0]},l.createElement(a.Flex,{gap:1,alignItems:"center",cursor:"pointer",onClick:d},l.createElement(a.Box,null,n),l.createElement(a.Icon,{name:"chevron_down",size:"small",color:"textLite",rotate:s?2:0})),l.createElement(a.Flex,{height:s?"auto":"0px",overflow:"hidden"},null!==m&&void 0!==m&&m.alertId?l.createElement(E,{alertId:m.alertId}):l.createElement(p,null)))},b=n(87462),y=n(45987),C=(n(21249),n(57640),n(9924),["title","showAdvanced","children"]),w=function(e){var t=e.title,n=void 0===t?"":t,i=e.showAdvanced,c=e.children,u=(0,y.Z)(e,C),s=(0,o.Z)(!1),d=(0,r.Z)(s,2),m=d[0],p=d[1];return l.createElement(a.Flex,(0,b.Z)({column:!0,gap:2,padding:[2,0]},u),l.createElement(a.Flex,{alignItems:"center",justifyContent:"between"},l.createElement(a.Flex,{alignItems:"center",gap:2},l.createElement(a.Icon,{name:"dot",width:"8px",color:"primary"}),l.createElement(a.Text,{strong:!0},n)),i&&l.createElement(a.Checkbox,{label:"Show advanced",checked:m,onChange:p})),l.createElement(a.Flex,{padding:[0,0,0,4]},l.Children.map(c,(function(e){return l.isValidElement(e)?l.cloneElement(e,{advanced:m}):e}))))},D=["isVertical"],S=function(e){var t=e.isVertical,n=(0,y.Z)(e,D);return l.createElement(a.Box,(0,b.Z)({as:"hr",height:t?"100%":"1px",width:t?"1px":"100%",sx:{borderWidth:t?"0px 0px 0px 1px":"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}},n))},T=n(60593),I=function(){var e=(0,i.qS)(),t=e.detectionMethod,n=e.setDetectionMethod;return l.createElement(a.Flex,{column:!0,gap:2},l.createElement(a.Flex,null,l.createElement(a.ButtonGroup,{items:T._L,checked:t,onChange:n})),l.createElement(a.TextSmall,{color:"textLite"},"An alert is triggered whenever a metric crosses a threshold"))},k=n(71893),A=n(93433),F=(n(69720),n(92222),n(57327),n(41539),n(88449),n(2490),n(59849),n(877)),O=function(e){return l.createElement(F.c.Option,e,l.createElement(a.Flex,{gap:2},l.createElement(a.Checkbox,{checked:e.isSelected,onChange:function(){}}),l.createElement(a.TextSmall,null,e.label)))},Z=function(e){return l.createElement(a.Select,(0,b.Z)({components:{Option:O}},e))},z=function(){var e=(0,i.rJ)(),t=(0,r.Z)(e,1)[0],n=t.getAttribute&&t.getAttribute("nodes")||[],a=Object.entries(n).map((function(e){var t=(0,r.Z)(e,2),n=t[0];return{label:t[1].nm,value:n}})),o={label:"".concat(a.length," ").concat(a.length>1?"Nodes":"Node"),value:""},c=[o].concat((0,A.Z)(a)),u=(0,i.Bf)(),s=u.metrics.hosts,d=u.setHosts,m=(0,l.useMemo)((function(){return null!==s&&void 0!==s&&s.length?s.filter((function(e){return e.value})):o}),[s,o.label]);return l.createElement(Z,{options:c,value:m,onChange:d,styles:{size:"tiny"},isDisabled:!1,isMulti:!0,closeMenuOnSelect:!1})},L=function(){var e=(0,i.rJ)(),t=(0,r.Z)(e,1)[0],n=t.getAttribute&&t.getAttribute("instances")||[],a=Object.entries(n).map((function(e){var t=(0,r.Z)(e,2),n=t[0];return{label:t[1].nm,value:n}})),o={label:"".concat(a.length," ").concat(a.length>1?"Instances":"Instance"),value:""},c=[o].concat((0,A.Z)(a)),u=(0,i.Bf)(),s=u.metrics.charts,d=u.setCharts,m=(0,l.useMemo)((function(){return null!==s&&void 0!==s&&s.length?s.filter((function(e){return e.value})):o}),[s,o.label]);return l.createElement(Z,{options:c,value:m,onChange:d,styles:{size:"tiny"},isDisabled:!1,isMulti:!0,closeMenuOnSelect:!1})},V=(n(47941),function(){var e=(0,i.rJ)(),t=(0,r.Z)(e,1)[0],n=t.getAttribute&&t.getAttribute("labels")||[],a=Object.keys(n).map((function(e){return{label:e,value:e}})),o={label:"".concat(a.length," ").concat(a.length>1?"Labels":"Label"),value:""},c=[o].concat((0,A.Z)(a)),u=(0,i.Bf)(),s=u.metrics.chartLabels,d=u.setChartLabels,m=(0,l.useMemo)((function(){return null!==s&&void 0!==s&&s.length?s.filter((function(e){return e.value})):o}),[s,o.label]);return l.createElement(Z,{options:c,value:m,onChange:d,styles:{size:"tiny"},isDisabled:!1,isMulti:!0,closeMenuOnSelect:!1})}),M=function(){var e=(0,i.Bf)(),t=e.metrics.os,n=e.setOs,a=(0,l.useMemo)((function(){return null!==t&&void 0!==t&&t.length?t.filter((function(e){return e.value})):T.Gx}),[t]);return l.createElement(Z,{options:T.yi,value:a,onChange:n,styles:{size:"tiny"},isDisabled:!1,isMulti:!0,closeMenuOnSelect:!1})},B=(0,k.default)(a.Box).withConfig({displayName:"sources__Wrapper",componentId:"sc-vkadr6-0"})(["display:grid;grid-template-columns:repeat(4,1fr);column-gap:8px;"]),N=function(){return l.createElement(B,null,l.createElement(a.Box,null,l.createElement(z,null)),l.createElement(a.Box,null,l.createElement(L,null)),l.createElement(a.Box,null,l.createElement(V,null)),l.createElement(a.Box,null,l.createElement(M,null)))},U=function(e){var t=e.advanced,n=(0,i.rJ)(),o=(0,r.Z)(n,1)[0],c=o.getAttribute?o.getAttribute("id"):"",u=(0,i.Bf)().setOn;return(0,l.useEffect)((function(){u(c)}),[]),l.createElement(a.Flex,{column:!0,gap:2},l.createElement(a.Flex,{alignItems:"center",gap:2},l.createElement(a.Box,{width:"200px"},l.createElement(a.TextInput,{value:c,onChange:function(e){return u(e.target.value)},disabled:!0,size:"tiny"})),l.createElement(a.Text,null,t?"from":"on"),!t&&l.createElement(a.TextInput,{value:"each system everywhere",onChange:function(){},disabled:!0,size:"tiny"})),t&&l.createElement(N,null))},R=function(){var e=(0,i.Bf)(),t=e.metrics.lookup,n=e.setLookup,r=(t||{}).aggregation;return l.createElement(a.Select,{options:T.w6,value:r,onChange:function(e){return n({aggregation:e})},styles:{minWidth:"80px",size:"tiny"},isDisabled:!1})},P=function(){var e=(0,i.Bf)(),t=e.metrics.lookup,n=e.setLookup,r=(t||{}).denoter;return l.createElement(a.Select,{options:T.Vt,value:r,onChange:function(e){return n({denoter:e})},styles:{minWidth:"80px",size:"tiny"},isDisabled:!1})},_=function(){var e=(0,i.rJ)(),t=(0,r.Z)(e,1)[0],n=(t.getAttribute&&t.getAttribute("dimensionIds")||[]).map((function(e){return{label:e,value:e}})),a={label:"All Dimensions",value:""},o=[a].concat((0,A.Z)(n)),c=(0,i.Bf)(),u=c.metrics.lookup,s=c.setLookup,d=(u||{}).dimensions,m=(0,l.useMemo)((function(){return null!==d&&void 0!==d&&d.length?d.filter((function(e){return e.value})):a}),[d,a.label]);return l.createElement(Z,{options:o,value:m,onChange:function(e){return s({dimensions:e})},styles:{size:"tiny"},isDisabled:!1,isMulti:!0,closeMenuOnSelect:!1})},W=function(){var e=(0,i.Bf)(),t=e.metrics.lookup,n=e.setLookup,r=(t||{}).timePeriod;return l.createElement(a.Select,{options:T.nb,value:r,onChange:function(e){return n({timePeriod:e})},styles:{minWidth:"80px",size:"tiny"},isDisabled:!1})},j=function(){var e=(0,i.Bf)(),t=e.metrics.lookup,n=e.setLookup,a=(t||{}).options;return l.createElement(Z,{options:T.bo,value:a,placeholder:"Options",onChange:function(e){return n({options:e})},styles:{size:"tiny"},isDisabled:!1,isMulti:!0,closeMenuOnSelect:!1})},J=function(){return l.createElement(a.Flex,{flexWrap:!0,alignItems:"center",gap:2},l.createElement(a.Text,null,"Evaluate the"),l.createElement(R,null),l.createElement(a.Text,null,"of"),l.createElement(P,null),l.createElement(a.Text,null,"of"),l.createElement(_,null),l.createElement(a.Text,null,"over the last"),l.createElement(W,null),l.createElement(j,null))},K=function(){var e=(0,i.Bf)(),t=e.metrics,n=t.calc,r=t.units,o=e.setCalcActive,c=e.setCalcValue,u=e.setUnitsValue,s=n||{},d=s.active,m=s.value;return l.createElement(a.Flex,{column:!0,gap:2},l.createElement(a.Toggle,{labelRight:"Add formula",colored:!0,checked:d,onChange:function(e){return o(e.target.checked)}}),l.createElement(a.Flex,{gap:2},l.createElement(a.Flex,{column:!0,gap:1},l.createElement(a.Text,null,"Formula"),l.createElement(a.Box,{width:"500px"},l.createElement(a.TextInput,{value:m,placeholder:"$this",onChange:function(e){return c(e.target.value)},size:"tiny",disabled:!d}))),l.createElement(a.Flex,{column:!0,gap:1},l.createElement(a.Text,null,"Units"),l.createElement(a.Box,{width:"80px"},l.createElement(a.TextInput,{value:r,onChange:function(e){return u(e.target.value)},size:"tiny",disabled:!d})))))},G=function(e){var t=e.advanced;return l.createElement(a.Flex,{column:!0,gap:3},l.createElement(U,{advanced:t}),l.createElement(J,null),t&&l.createElement(K,null))},H=function(e){var t=e.value,n=e.onChange;return l.createElement(a.Select,{options:T.KW,value:t,onChange:n,styles:{size:"tiny"}})},q=n(54244),Q=n(82351),Y={denoter:T.Iu.thresholds.below,value:75},$=function(e){var t=e.recovery,n=e.onRecoveryThresholdAdd,r=e.onDenoterChange,i=e.onValueChange,o=t||{},c=o.denoter,u=o.value;return t?l.createElement(a.Flex,{alignItems:"center",gap:2},l.createElement(a.Pill,{flavour:"success",hollow:!0,icon:"reload"},"Recovery Threshold"),l.createElement(H,{value:c,onChange:r}),l.createElement(a.TextInput,{onChange:function(e){return i(e.target.value)},value:u,type:"number",min:0,size:"tiny",metaShrinked:!0,containerStyles:{width:"80px"}}),l.createElement(Q.Z,{content:"Remove recovery threshold"},l.createElement(a.Button,{icon:"trashcan",flavour:"borderless",onClick:function(){return n(null)},iconColor:"textLite",iconSize:"small"}))):l.createElement(a.Button,{label:"Recovery Threshold",icon:"plus",flavour:"borderless",onClick:function(){return n(Y)}})},X=n(64637),ee=function(e){var t=e.type,n=e.advanced,r=(0,i.zk)(),o=r.isEdit,c=r.alertingConditions,u=r.setCriticalThresholdDenoter,s=r.setCriticalThresholdValue,d=r.setCriticalRecoveryThreshold,m=r.setWarningThresholdDenoter,p=r.setWarningThresholdValue,h=r.setWarningRecoveryThreshold,g=r.setCriticalRecoveryThresholdDenoter,v=r.setCriticalRecoveryThresholdValue,f=r.setWarningRecoveryThresholdDenoter,E=r.setWarningRecoveryThresholdValue,x=c[t]||{},b=x.denoter,y=x.value,C=x.recovery,w="critical"==t?u:m,D="critical"==t?s:p,S="critical"==t?d:h,T="critical"==t?g:f,I="critical"==t?v:E;return l.createElement(a.Flex,{alignItems:"center",gap:2,height:"34px"},l.createElement(a.Box,null,l.createElement(q.Z,{width:"80px",flavour:t,textSize:"small"},(0,X.fm)(t,!0))),o?l.createElement(a.TextInput,{onChange:function(e){return D(e.target.value)},value:y,size:"tiny",containerStyles:{width:"360px"},metaShrinked:!0}):l.createElement(l.Fragment,null,n?l.createElement(H,{value:b,onChange:w}):l.createElement(a.TextInput,{value:null===b||void 0===b?void 0:b.label,size:"tiny",containerStyles:{width:"160px"},disabled:!0,metaShrinked:!0}),l.createElement(a.TextInput,{onChange:function(e){return D(e.target.value)},value:y,type:"number",min:0,size:"tiny",metaShrinked:!0,containerStyles:{width:"80px"}}),n&&l.createElement($,{recovery:C,onRecoveryThresholdAdd:S,onDenoterChange:T,onValueChange:I})))},te=function(e){var t=e.advanced;return l.createElement(a.Flex,{column:!0,gap:2},l.createElement(ee,{type:"critical",advanced:t}),l.createElement(ee,{type:"warning",advanced:t}))},ne=n(50308),le=n.n(ne),ae=function(e){var t=e.label,n=void 0===t?"":t,r=e.value,i=e.onValueChange,o=void 0===i?le():i,c=e.unit,u=e.onUnitChange,s=void 0===u?le():u,d=e.unitsOptions,m=void 0===d?T.hq:d,p=e.isDisabled;return l.createElement(a.Flex,{column:!0,gap:2},l.createElement(a.Text,{color:p?"textLite":"text"},n),l.createElement(a.Flex,{gap:2},l.createElement(a.TextInput,{value:r,onChange:function(e){return o(e.target.value)},type:"number",min:0,size:"tiny",containerStyles:{width:"60px"},disabled:p}),l.createElement(a.Select,{options:m,value:c,onChange:function(e){return s(e)},styles:{size:"tiny"},isDisabled:p})))},re=function(e){var t=e.advanced,n=(0,i.zk)(),a=n.alertingConditions.interval,r=a.value,o=a.unit,c=n.setIntervalValue,u=n.setIntervalUnit;return l.createElement(ae,{label:"Check interval",value:r,onValueChange:c,unit:o,onUnitChange:u,isDisabled:!t})},ie=n(88387),oe=(0,k.default)(a.Box).withConfig({displayName:"delayNotification__Grid",componentId:"sc-4dhott-0"})(["display:grid;grid-template-columns:repeat(2,1fr);gap:8px 16px;"]),ce=function(){var e=(0,i.zk)(),t=e.alertingConditions.delayNotification,n=e.setDelayNotificationActive,r=e.setDelayNotificationUpValue,o=e.setDelayNotificationUpUnit,c=e.setDelayNotificationDownValue,u=e.setDelayNotificationDownUnit,s=e.setDelayNotificationMaxDelayValue,d=e.setDelayNotificationMaxDelayUnit,m=e.setDelayNotificationMultiplier,p=t.active,h=t.up,g=t.down,v=t.multiplier,f=t.max,E=!p,x=(0,ie.t7)(n),b=(0,ie.An)(m);return l.createElement(a.Flex,{column:!0,gap:2},l.createElement(a.Toggle,{labelRight:"Delay Notification",colored:!0,checked:p,onChange:x}),l.createElement(oe,null,l.createElement(ae,{label:"Initial Delay on Alert Severity Escalation",value:null===h||void 0===h?void 0:h.value,onValueChange:r,unit:null===h||void 0===h?void 0:h.unit,onUnitChange:o,isDisabled:E}),l.createElement(a.Flex,{column:!0,gap:2},l.createElement(a.Text,{color:E?"textLite":"text"},"Delay Multiplier on successive delays"),l.createElement(a.TextInput,{value:v,onChange:b,type:"number",min:0,step:.1,size:"tiny",containerStyles:{width:"60px"},disabled:E})),l.createElement(ae,{label:"Initial Delay on Alert Severity De-escalation",value:null===g||void 0===g?void 0:g.value,onValueChange:c,unit:null===g||void 0===g?void 0:g.unit,onUnitChange:u,isDisabled:E}),l.createElement(ae,{label:"Limit Maximum Delay",value:null===f||void 0===f?void 0:f.value,onValueChange:s,unit:null===f||void 0===f?void 0:f.unit,onUnitChange:d,isDisabled:E})))},ue=function(){var e=(0,i.zk)(),t=e.alertingConditions.agentOptions,n=e.setAgentOptionsActive,r=e.setAgentOptionsRepeatNotification,o=e.setAgentOptionsWarningAlertsDurationValue,c=e.setAgentOptionsWarningAlertsDurationUnit,u=e.setAgentOptionsCriticalAlertsDurationValue,s=e.setAgentOptionsCriticalAlertsDurationUnit,d=e.setAgentOptionsSendToValue,m=e.setAgentOptionsSendToClearNotifications,p=e.setAgentOptionsExecScriptActive,h=e.setAgentOptionsExecScriptPath,g=t.active,v=t.off,f=t.warningAlertsDuration,E=t.criticalAlertsDuration,x=t.sendTo,b=t.execScript,y=!g,C=y||v,w=(0,ie.t7)(n),D=(0,ie.t7)(r,!0),S=(0,ie.t7)(m,!0),T=(0,ie.An)(d),I=(0,ie.t7)(p),k=(0,ie.An)(h);return l.createElement(a.Flex,{column:!0,gap:2},l.createElement(a.Toggle,{labelRight:"Agent Specific Options",colored:!0,checked:g,onChange:w}),l.createElement(a.Flex,{column:!0,gap:2,width:"100%"},l.createElement(a.Checkbox,{label:"Repeat Alert Notifications",checked:!v,onChange:D,disabled:y}),l.createElement(a.Flex,{gap:4},l.createElement(ae,{label:"Warning Alerts Duration isActive",value:null===f||void 0===f?void 0:f.value,onValueChange:o,unit:null===f||void 0===f?void 0:f.unit,onUnitChange:c,isDisabled:C}),l.createElement(ae,{label:"Critical Alerts Duration isActive",value:null===E||void 0===E?void 0:E.value,onValueChange:u,unit:null===E||void 0===E?void 0:E.unit,onUnitChange:s,isDisabled:C})),l.createElement(a.Flex,{column:!0,gap:1},l.createElement(a.Text,{color:y?"textLite":"text"},"Send to"),l.createElement(Q.Z,{content:"Insert space separated roles (already defined on the agent)",align:"top"},l.createElement(a.Flex,{alignItems:"center",gap:2},l.createElement(a.TextInput,{value:null===x||void 0===x?void 0:x.value,placeholder:"Roles",onChange:T,disabled:y,size:"tiny"}),l.createElement(a.Checkbox,{label:"Don't send Clear notifications",checked:!(null!==x&&void 0!==x&&x.clearNotifications),onChange:S,disabled:y})))),l.createElement(a.Flex,{alignItems:"center",gap:4},l.createElement(a.Checkbox,{label:"Exec script",checked:null===b||void 0===b?void 0:b.active,onChange:I,disabled:y}),l.createElement(a.Box,{width:"500px"},l.createElement(a.TextInput,{value:null===b||void 0===b?void 0:b.path,placeholder:"/path/to/script",onChange:k,disabled:y,size:"tiny"})))))},se=function(e){var t=e.advanced,n=(0,i.zk)(),r=n.alertingConditions.denoter,o=n.setMainDenoter;return l.createElement(a.Flex,{column:!0,gap:4},l.createElement(a.Flex,{alignItems:"center",gap:2},l.createElement(a.Text,null,"Trigger when the evaluated value is"),l.createElement(H,{value:r,onChange:o}),l.createElement(a.Text,null,"the threshold")),l.createElement(te,{advanced:t}),l.createElement(re,{advanced:t}),t&&l.createElement(l.Fragment,null,l.createElement(ce,null),l.createElement(ue,null)))},de=function(){var e=(0,i.PK)(),t=e.templateName,n=e.templateDescription,r=e.setTemplateName,o=e.setTemplateDescription;return l.createElement(a.Flex,{column:!0,gap:2,width:"100%"},l.createElement(a.Flex,{column:!0,gap:1,width:"100%"},l.createElement(a.Text,null,"Template Name"),l.createElement(a.TextInput,{value:t,onChange:function(e){return r(e.target.value)},size:"tiny"})),l.createElement(a.Flex,{column:!0,gap:1,width:"100%"},l.createElement(a.Text,null,"Template Description"),l.createElement(a.TextInput,{value:n,onChange:function(e){return o(e.target.value)},size:"tiny"}),l.createElement(a.TextSmall,{color:"textLite"},"Select an appropriate Template Description")))},me=k.default.div.withConfig({displayName:"styled__StyledTerminalCommand",componentId:"sc-jb3u29-0"})(["display:flex;position:relative;flex-direction:column;color:",";background:",";border:1px solid ",";border-radius:4px;cursor:pointer;overflow-wrap:anywhere;white-space:pre-wrap;padding:16px 16px 24px;width:100%;height:100%;font-family:Courier New,monospace;font-weight:bold;letter-spacing:0.09px;line-height:18px;font-size:14px;word-break:break-word;overflow-y:auto;"],(0,a.getColor)("primary"),(0,a.getColor)("terminalGreen"),(0,a.getColor)("primary")),pe=(0,k.default)(a.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-jb3u29-1"})(["display:flex;align-self:flex-end;cursor:pointer;position:absolute;bottom:16px;right:16px;"]),he=n(52428),ge=function(){var e=(0,i.Jx)(),t=(0,r.Z)(e,1)[0],n=(0,l.useMemo)((function(){return(0,ie.RW)(t)}),[t]);return l.createElement(me,{onClick:(0,he.J)(n,{text:"Config copied to your clipboard."})},n,l.createElement(pe,{name:"copy",size:"small",color:"textLite",onClick:(0,he.J)(n,{text:"Config copied to your clipboard."})}))},ve=function(){return l.createElement(a.Flex,{width:"100%",column:!0,gap:3},l.createElement(a.Text,null,"Configuration"),l.createElement(ge,null))},fe=function(){return l.createElement(a.Flex,{gap:3,height:"100%"},l.createElement(a.Flex,{width:"70%",height:"100%",column:!0,gap:2,padding:[2,2,2,0],overflow:{vertical:"auto"}},l.createElement(x,null),l.createElement(S,null),l.createElement(w,{title:"Select the Detection Method"},l.createElement(I,null)),l.createElement(S,null),l.createElement(w,{title:"Select and define the metric to alert on",showAdvanced:!0},l.createElement(G,null)),l.createElement(S,null),l.createElement(w,{title:"Define alerting conditions",showAdvanced:!0},l.createElement(se,null)),l.createElement(S,null),l.createElement(w,{title:"Description"},l.createElement(de,null))),l.createElement(S,{isVertical:!0}),l.createElement(a.Flex,{width:"30%",padding:[2,0]},l.createElement(ve,null)))}},64504:function(e,t,n){n.d(t,{B:function(){return o},u:function(){return i}});n(69826),n(41539),n(31672),n(2490),n(59461),n(74916),n(4723);var l=n(4480),a=n(9058),r=(0,l.cn)({key:"currentChartsContainerKey",default:null}),i=function(){var e=(0,a.e)(),t=(0,l.sJ)(r);return e&&e.getRoot().getChildren().find((function(e){return e.match({id:t})}))},o=function(){return(0,l.Zl)(r)}}}]);