summaryrefslogtreecommitdiffstats
path: root/web/gui/v2/9020.618bce1feb9efd7ead50.chunk.js
blob: cb41e0bb1401f738d2e2ee7d9abcf1c3d21ab70b (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]="6318f37b-c085-40d8-9cf9-ff420fe82250",e._sentryDebugIdIdentifier="sentry-dbid-6318f37b-c085-40d8-9cf9-ff420fe82250")}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([[9020],{9020:function(e,t,n){n.r(t),n.d(t,{default:function(){return de}});n(21249),n(57640),n(9924);var a=n(67294),l=n(93416),o=n(91008),r=n(25185),s=n(87462),i=n(29439),c=n(45987),u=(n(69720),n(50308)),d=n.n(u),m=n(82351),f=n(35539),p=["scope","setScope","isDisabled"],b=function(e){var t=e.scope,n=e.setScope,o=void 0===n?d():n,r=e.isDisabled,u=(0,c.Z)(e,p);return a.createElement(l.Flex,(0,s.Z)({gap:3},u),Object.entries(f.k0).map((function(e){var n=(0,i.Z)(e,2),s=n[0],c=n[1],u=c.text,d=c.tooltip;return a.createElement(l.RadioButton,{key:s,checked:s===t,onChange:function(){return o(s)},disabled:r},a.createElement(m.Z,{content:d,align:"bottom"},a.createElement(l.TextSmall,{color:"textDescription"},u)))})))},g=n(36412),h=(n(38862),n(46667)),v=n(4942),E=function(e){var t=e.selectedKey,n=e.selectedValue,o=e.onAddHostLabel,r=void 0===o?d():o,s=e.onRemoveHostLabel,c=void 0===s?d():s,u=e.isDefault,f=void 0!==u&&u,p=e.showPlaceholder,b=void 0===p?d():p,h=e.isDisabled,E=(0,a.useState)(t||""),C=(0,i.Z)(E,2),D=C[0],x=C[1],y=(0,a.useState)(n||""),Z=(0,i.Z)(y,2),S=Z[0],O=Z[1],k=function(){D&&S&&(r((0,v.Z)({},D,S)),b())};return a.createElement(l.Flex,{gap:2},a.createElement(g.Z,{component:"input",onChange:x,onBlur:k,placeholder:"Host key",value:D,disabled:h||!f}),a.createElement(g.Z,{component:"input",onChange:O,onBlur:k,placeholder:"Host value",value:S,disabled:h||!f||!D}),f?a.createElement(m.Z,{content:"Save label pair",align:"bottom"},a.createElement(l.Button,{flavour:"borderless",disabled:!D||!S},a.createElement(l.Icon,{name:"check",color:"primary",size:"small"}))):a.createElement(m.Z,{content:"Remove label pair",align:"bottom"},a.createElement(l.Button,{flavour:"borderless",onClick:function(){return c(t)}},a.createElement(l.Icon,{name:"x",color:"primary",size:"small"}))))},C=function(e){var t=e.hostLabels,n=e.onAddHostLabel,l=e.onRemoveHostLabel;return Object.entries(t).map((function(e){var t=(0,i.Z)(e,2),o=t[0],r=t[1];return a.createElement(E,{key:o,onAddHostLabel:n,selectedKey:o,selectedValue:r,onRemoveHostLabel:l})}))},D=function(e){var t=e.hostLabels,n=e.onAddHostLabel,o=void 0===n?d():n,r=e.onRemoveHostLabel,s=void 0===r?d():r,c=e.isEdit,u=e.isDisabled,m=!!Object.entries(t||{}).length,f=(0,h.Z)(!1),p=(0,i.Z)(f,3),b=p[0],g=p[2];return a.createElement(l.Flex,{column:!0,gap:1},a.createElement(l.TextSmall,{color:"textLite"},"Host labels"),m&&a.createElement(C,{hostLabels:t,onAddHostLabel:o,onRemoveHostLabel:s}),(!m||b)&&a.createElement(E,{key:JSON.stringify(t),onAddHostLabel:o,isDefault:!0,showPlaceholder:g,isDisabled:u}),c&&!b&&m&&a.createElement(l.Flex,{justifyContent:"end"},a.createElement(l.Button,{flavour:"borderless",onClick:g},"Add host label")))},x=n(95665);function y(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),a=e.getDate(),l=new Date(0);return l.setFullYear(t,n,a+1),l.setHours(0,0,0,0),l}var Z=n(69119),S=n(29422),O=n(4822),k=Object.entries(f.lI).map((function(e){var t=(0,i.Z)(e,2),n=t[0];return{label:t[1],value:n}})),w=y(),L=(0,Z.default)((0,S.Z)(w,{years:1})),A=function(e){var t=e.duration,n=e.setDuration,o=e.setDate,r=e.endDate,s=e.isDisabled,i=(0,O.by)("offset");return a.createElement(l.Flex,{gap:2},a.createElement(g.Z,{component:"select",title:"Duration",onChange:n,options:k,placeholder:"Select duration",value:t,isDisabled:s}),"custom"===t.value&&a.createElement(l.Flex,{alignSelf:"end"},a.createElement(x.Z,{isSinglePicker:!0,values:{singleDate:r},minDate:w,maxDate:L,utc:i,onChange:o,isPlaying:!1,accessorProps:f.mD,padding:[4,0],width:"auto",accessorTooltipContent:"Select end date"})))};function R(){return(0,Z.default)(Date.now())}var H=R(),I=y(),j=function(e){var t=e.start,n=e.end,o=e.onChange,r=e.isDisabled,s=e.isEdit,c=(0,a.useState)(s?"schedule":f.JG),u=(0,i.Z)(c,2),d=u[0],p=u[1],b=(0,a.useState)(f.yu),g=(0,i.Z)(b,2),h=g[0],v=g[1],E=(0,a.useState)(0),C=(0,i.Z)(E,2),D=C[0],k=C[1],w=(0,O.by)("offset"),L=(0,a.useState)(t?new Date(t):s?null:H),j=(0,i.Z)(L,2),P=j[0],F=j[1],_=(0,a.useState)(n?new Date(n):s?null:I),N=(0,i.Z)(_,2),U=N[0],B=N[1],M=(0,a.useState)((0,Z.default)((0,S.Z)(P,{days:1}))),T=(0,i.Z)(M,2),z=T[0],K=T[1];(0,a.useEffect)((function(){var e=(0,S.Z)(P,{days:1});K(e),!s&&P>=U&&B(e)}),[P]),(0,a.useEffect)((function(){o({start:P,end:U,scheduleOption:d,duration:h})}),[P,U,d,h]);var V=y(),Q=(0,Z.default)((0,S.Z)(V,{years:1}));return a.createElement(l.Flex,{column:!0,gap:3},!s&&a.createElement(l.Flex,{gap:3},Object.entries(f.Zg).map((function(e){var t=(