Files
object-browser/portal-ui/build/static/js/1432.c59f4621.chunk.js
Alex cefb6d3c95 Release v0.26.2 (#2761)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
2023-04-05 14:12:30 -07:00

2 lines
30 KiB
JavaScript

"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1432],{14917:function(e,n,t){t(72791);var i=t(61889),o=t(72455),a=t(80184),r=(0,o.Z)((function(e){return{headerBarIcon:{marginRight:".7rem",color:e.palette.primary.main,"& .min-icon":{width:44,height:44},"@media (max-width: 600px)":{display:"none"}},headerBarSubheader:{color:"grey","@media (max-width: 900px)":{maxWidth:200}},stContainer:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:8,borderBottom:"1px solid #EAEAEA","@media (max-width: 600px)":{flexFlow:"column"}},titleColumn:{height:"auto",justifyContent:"center",display:"flex",flexFlow:"column",alignItems:"flex-start","& h1":{fontSize:19}},leftItems:{display:"flex",alignItems:"center","@media (max-width: 600px)":{flexFlow:"column",width:"100%"}},rightItems:{display:"flex",alignItems:"center","& button":{marginLeft:8},"@media (max-width: 600px)":{width:"100%"}}}}));n.Z=function(e){var n=e.icon,t=e.title,o=e.subTitle,l=e.actions,s=e.className,c=r();return(0,a.jsx)(i.ZP,{container:!0,children:(0,a.jsxs)(i.ZP,{item:!0,xs:12,className:"".concat(c.stContainer," ").concat(s||""),children:[(0,a.jsxs)("div",{className:c.leftItems,children:[n?(0,a.jsx)("div",{className:c.headerBarIcon,children:n}):null,(0,a.jsxs)("div",{className:c.titleColumn,children:[(0,a.jsx)("h1",{style:{margin:0},children:t}),(0,a.jsx)("span",{className:c.headerBarSubheader,children:o})]})]}),(0,a.jsx)("div",{className:c.rightItems,children:l})]})})}},50276:function(e,n,t){var i=t(1413),o=t(29439),a=t(72791),r=t(64554),l=t(43896),s=t(83449),c=t(47283),u=t(82851),d=t(25787),f=t(13967),p=t(11135),m=t(95193),h=t(57689),x=t(80184),g={minHeight:60};n.Z=(0,d.Z)((function(e){return(0,p.Z)({tabsContainer:{display:"flex",height:"100%",width:"100%"},tabsHeaderContainer:{width:"300px",background:"#F8F8F8",borderRight:"1px solid #EAEAEA","& .MuiTabs-root":{"& .MuiTabs-indicator":{display:"none"},"& .MuiTab-root":{display:"flex",flexFlow:"row",alignItems:"center",justifyContent:"flex-start",borderBottom:"1px solid #EAEAEA","& .MuiSvgIcon-root":{marginRight:8,marginBottom:0},"&.Mui-selected":{background:"#E5E5E5",fontWeight:600}},"&. MuiTabs-scroller":{display:"none"}}},tabContentContainer:{width:"100%","& .MuiTabPanel-root":{height:"100%"}},tabPanel:{height:"100%"},"@media (max-width: 900px)":{tabsContainer:{flexFlow:"column",flexDirection:"column"},tabsHeaderContainer:{width:"100%",borderBottom:" 1px solid #EAEAEA","& .MuiTabs-root .MuiTabs-scroller .MuiButtonBase-root":{borderBottom:" 0px"}}}})}))((function(e){var n=e.children,t=e.classes,d=e.selectedTab,p=void 0===d?"0":d,v=e.routes,b=e.isRouteTabs,y=(0,f.Z)(),j=(0,h.TH)().pathname,Z=void 0===j?"":j,k=(0,m.Z)(y.breakpoints.down("md")),C=(0,a.useState)(p),w=(0,o.Z)(C,2),_=w[0],E=w[1],S=[],T=[];if((0,a.useEffect)((function(){if(b){var e=n.find((function(e){return e.tabConfig.to===Z}));e&&E(e.tabConfig.value)}}),[b,n,Z]),!n)return null;n.forEach((function(e){S.push(e.tabConfig),T.push(e.content)}));return(0,x.jsx)(s.ZP,{value:"".concat(_),children:(0,x.jsxs)(r.Z,{className:t.tabsContainer,children:[(0,x.jsx)(r.Z,{className:t.tabsHeaderContainer,children:(0,x.jsx)(c.Z,{onChange:function(e,n){E(n)},orientation:k?"horizontal":"vertical",variant:k?"scrollable":"standard",scrollButtons:"auto",className:t.tabList,children:S.map((function(e,n){return e?(0,x.jsx)(l.Z,(0,i.Z)((0,i.Z)({className:t.tabHeader,value:"".concat(n),style:g},e),{},{disableRipple:!0,disableTouchRipple:!0,focusRipple:!0}),"v-tab-".concat(n)):null}))})}),(0,x.jsxs)(r.Z,{className:t.tabContentContainer,children:[b?null:T.map((function(e,n){return(0,x.jsx)(u.Z,{classes:(0,i.Z)({},t.tabPanel),value:"".concat(n),children:e||null},"v-tab-p-".concat(n))})),b?(0,x.jsx)("div",{className:t.tabPanel,children:v}):null]})]})})}))},11432:function(e,n,t){t.r(n),t.d(n,{default:function(){return J}});var i=t(1413),o=t(72791),a=t(11135),r=t(25787),l=t(61889),s=t(58493),c=t(23814),u=t(75952),d=t(57689),f=t(11087),p=t(50276),m=t(74794),h=t(14917),x=t(29439),g=t(26181),v=t.n(g),b=t(64554),y=t(81207),j=t(10091),Z=t(90767),k=t(87995),C=t(81551),w=t(93433),_=t(21435),E=t(56028),S=t(244),T=t(13901),A=t(36909),I=t(40986),F=t(80184),N=function(e){var n=e.open,t=e.type,a=e.onCloseEndpoint,r=(0,o.useState)(""),l=(0,x.Z)(r,2),s=l[0],d=l[1],f=(0,o.useState)(""),p=(0,x.Z)(f,2),m=p[0],h=p[1],g=(0,o.useState)(""),v=(0,x.Z)(g,2),b=v[0],j=v[1],Z=(0,o.useState)(!1),N=(0,x.Z)(Z,2),R=N[0],q=N[1],L=(0,o.useState)(["name","endpoint"]),D=(0,x.Z)(L,2),P=D[0],M=D[1],W=(0,o.useState)(["name","endpoint","auth-token"]),B=(0,x.Z)(W,2),z=B[0],O=B[1],H=(0,C.TL)(),K=function(e){O(z.filter((function(n){return n!==e})))},U=function(e,n){P.includes(e)&&n?M(P.filter((function(n){return n!==e}))):n||P.includes(e)||M([].concat((0,w.Z)(P),[e]))},V="Add new Webhook",G=(0,F.jsx)(S.Z,{});switch(t){case"logger_webhook":V="New Logger Webhook",G=(0,F.jsx)(T.Z,{});break;case"audit_webhook":V="New Audit Webhook",G=(0,F.jsx)(A.Z,{})}return(0,F.jsx)(o.Fragment,{children:(0,F.jsxs)(E.Z,{modalOpen:n,title:V,onClose:a,titleIcon:G,children:[(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:(0,i.Z)({},c.DF.formFieldRow),children:(0,F.jsx)(_.Z,{id:"name",name:"name",onChange:function(e){K("name"),d(e.target.value),U("name",e.target.validity.valid)},error:P.includes("name")&&!z.includes("name")?"Invalid Name":"",label:"Name",value:s,pattern:"^(?=.*[a-zA-Z0-9]).{1,}$",required:!0})}),(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:(0,i.Z)({},c.DF.formFieldRow),children:(0,F.jsx)(_.Z,{id:"endpoint",name:"endpoint",onChange:function(e){K("endpoint"),h(e.target.value),U("endpoint",e.target.validity.valid)},error:P.includes("endpoint")&&!z.includes("endpoint")?"Invalid Endpoint set":"",label:"Endpoint",value:m,pattern:"^(https?):\\/\\/([a-zA-Z0-9\\-.]+)(:[0-9]+)?(\\/[a-zA-Z0-9\\-.\\/]*)?$",required:!0})}),(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:(0,i.Z)({},c.DF.formFieldRow),children:(0,F.jsx)(_.Z,{id:"auth-token",name:"auth-token",onChange:function(e){K("auth-token"),j(e.target.value)},label:"Auth Token",value:b})}),R&&(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:{marginBottom:10},children:(0,F.jsx)(I.Z,{})}),(0,F.jsxs)(u.rjZ,{item:!0,xs:12,sx:{display:"flex",justifyContent:"flex-end"},children:[(0,F.jsx)(u.zxk,{id:"reset",type:"button",variant:"regular",disabled:R,onClick:a,label:"Cancel",sx:{marginRight:10}}),(0,F.jsx)(u.zxk,{id:"save-lifecycle",type:"submit",variant:"callAction",color:"primary",disabled:R||0!==P.length,label:"Save",onClick:function(){if(!R&&0===P.length)if(""!==s.trim())if(""!==m.trim()){q(!0);var e={key_values:[{key:"endpoint",value:m},{key:"auth_token",value:b}],arn_resource_id:s};y.Z.invoke("PUT","/api/v1/configs/".concat(t),e).then((function(e){q(!1),H((0,k.cN)(e.restart)),e.restart||H((0,k.y1)("Configuration saved successfully")),a(),H((0,k.Ie)(!0))})).catch((function(e){q(!1),H((0,k.Ih)(e))}))}else M([].concat((0,w.Z)(P),["endpoint"]));else M([].concat((0,w.Z)(P),["name"]))}})]})]})})},R=t(51691),q=t(23508),L=function(e){var n=e.modalOpen,t=e.onClose,i=e.selectedARN,a=(e.type,(0,o.useState)(!1)),r=(0,x.Z)(a,2),l=r[0],s=r[1],c=(0,C.TL)();(0,o.useEffect)((function(){l&&y.Z.invoke("POST","/api/v1/configs/".concat(i,"/reset")).then((function(){s(!1),c((0,k.cN)(!0)),c((0,k.Ie)(!0)),t()})).catch((function(e){s(!1),c((0,k.Ih)(e))}))}),[l,c,t,i]);var d=!i.includes(":"),f="Are you sure you want to delete the Configured Endpoint";return d&&(f="Are you sure you want to reset the Default"),(0,F.jsx)(q.Z,{title:d?"Reset Default Webhook":"Delete Webhook",confirmText:d?"Reset":"Delete",isOpen:n,isLoading:l,onConfirm:function(){s(!0)},titleIcon:(0,F.jsx)(u.NvT,{}),onClose:t,confirmationContent:(0,F.jsxs)(R.Z,{children:["".concat(f," "),(0,F.jsx)("strong",{children:i}),"?"]})})},D=t(81159),P=t(64163),M=function(e){var n,t,a,r=e.open,l=e.type,d=e.endpointInfo,f=e.onCloseEndpoint,p=(0,o.useState)(""),m=(0,x.Z)(p,2),h=m[0],g=m[1],v=(0,o.useState)(""),b=(0,x.Z)(v,2),j=b[0],Z=b[1],N=(0,o.useState)(""),R=(0,x.Z)(N,2),q=R[0],L=R[1],M=(0,o.useState)("on"),W=(0,x.Z)(M,2),B=W[0],z=W[1],O=(0,o.useState)(!1),H=(0,x.Z)(O,2),K=H[0],U=H[1],V=(0,o.useState)([]),G=(0,x.Z)(V,2),Y=G[0],$=G[1],Q=(0,C.TL)();(0,o.useEffect)((function(){if(d){var e=d.key_values.find((function(e){return"endpoint"===e.key})),n=d.key_values.find((function(e){return"auth_token"===e.key})),t=d.key_values.find((function(e){return"enable"===e.key})),i=[];if(e){var o=e.value;""===o?i.push("endpoint"):Z(o)}if(n){var a=n.value;""===a?i.push("auth-token"):L(a)}t&&"off"===t.value&&z(t.value),g(d.name||""),$(i)}}),[d]);var J=!h.includes(":"),X=d.key_values.filter((function(e){return!!e.env_override})),ee=(0,s.F_)(X),ne="Edit Webhook",te=(0,F.jsx)(S.Z,{});switch(l){case"logger_webhook":ne="Edit ".concat(J?" the Default ":"","Logger Webhook"),te=(0,F.jsx)(T.Z,{});break;case"audit_webhook":ne="Edit ".concat(J?" the Default ":"","Audit Webhook"),te=(0,F.jsx)(A.Z,{})}return X.length>0&&(ne="View env variable Webhook"),(0,F.jsx)(o.Fragment,{children:(0,F.jsx)(E.Z,{modalOpen:r,title:"".concat(ne).concat(J?"":" - ".concat(h)),onClose:f,titleIcon:te,children:X.length>0?(0,F.jsxs)(o.Fragment,{children:[(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:(0,i.Z)({},c.DF.formFieldRow),children:(0,F.jsx)(P.Z,{label:"Enabled",content:(null===(n=ee.enable)||void 0===n?void 0:n.value)||"-",actionButton:(0,F.jsx)(u.rjZ,{item:!0,sx:{display:"flex",justifyContent:"flex-end",paddingRight:"10px"},children:(0,F.jsx)(u.ua7,{tooltip:ee.enable?"This value is set from the ".concat(ee.enable.overrideEnv," environment variable"):"",placement:"left",children:(0,F.jsx)(u.zD0,{style:{width:20}})})})})}),(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:(0,i.Z)({},c.DF.formFieldRow),children:(0,F.jsx)(P.Z,{label:"Endpoint",content:(null===(t=ee.endpoint)||void 0===t?void 0:t.value)||"-",actionButton:(0,F.jsx)(u.rjZ,{item:!0,sx:{display:"flex",justifyContent:"flex-end",paddingRight:"10px"},children:(0,F.jsx)(u.ua7,{tooltip:ee.enable?"This value is set from the ".concat(ee.endpoint.overrideEnv," environment variable"):"",placement:"left",children:(0,F.jsx)(u.zD0,{style:{width:20}})})})})}),(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:(0,i.Z)({},c.DF.formFieldRow),children:(0,F.jsx)(P.Z,{label:"Auth Token",content:(null===(a=ee.auth_token)||void 0===a?void 0:a.value)||"-",actionButton:(0,F.jsx)(u.rjZ,{item:!0,sx:{display:"flex",justifyContent:"flex-end",paddingRight:"10px"},children:(0,F.jsx)(u.ua7,{tooltip:ee.enable?"This value is set from the ".concat(ee.auth_token.overrideEnv," environment variable"):"",placement:"left",children:(0,F.jsx)(u.zD0,{style:{width:20}})})})})})]}):(0,F.jsxs)(o.Fragment,{children:[(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:(0,i.Z)({},c.DF.formFieldRow),children:(0,F.jsx)(D.Z,{onChange:function(e){var n=e.target.checked?"on":"off";z(n)},id:"endpoint_enabled",name:"endpoint_enabled",label:"Enabled",value:"switch_on",checked:"on"===B})}),(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:(0,i.Z)({},c.DF.formFieldRow),children:(0,F.jsx)(_.Z,{id:"endpoint",name:"endpoint",onChange:function(e){Z(e.target.value),function(e,n){Y.includes(e)&&n?$(Y.filter((function(n){return n!==e}))):n||Y.includes(e)||$([].concat((0,w.Z)(Y),[e]))}("endpoint",e.target.validity.valid)},error:Y.includes("endpoint")?"Invalid Endpoint set":"",label:"Endpoint",value:j,pattern:"^(https?):\\/\\/([a-zA-Z0-9\\-.]+)(:[0-9]+)?(\\/[a-zA-Z0-9\\-.\\/]*)?$",required:!0})}),(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:(0,i.Z)({},c.DF.formFieldRow),children:(0,F.jsx)(_.Z,{id:"auth-token",name:"auth-token",onChange:function(e){L(e.target.value)},label:"Auth Token",value:q})}),K&&(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:{marginBottom:10},children:(0,F.jsx)(I.Z,{})}),(0,F.jsxs)(u.rjZ,{item:!0,xs:12,sx:{display:"flex",justifyContent:"flex-end"},children:[(0,F.jsx)(u.zxk,{id:"reset",type:"button",variant:"regular",disabled:K,onClick:f,label:"Cancel",sx:{marginRight:10}}),(0,F.jsx)(u.zxk,{id:"save-lifecycle",type:"submit",variant:"callAction",color:"primary",disabled:K||0!==Y.length,label:"Update",onClick:function(){if(!K&&0===Y.length)if(j&&""!==j.trim()){U(!0);var e={key_values:[{key:"endpoint",value:j},{key:"auth_token",value:q},{key:"enable",value:B}]};y.Z.invoke("PUT","/api/v1/configs/".concat(h),e).then((function(e){U(!1),Q((0,k.cN)(e.restart)),e.restart||Q((0,k.y1)("Configuration saved successfully")),f(),Q((0,k.Ie)(!0))})).catch((function(e){U(!1),Q((0,k.Ih)(e))}))}else $([].concat((0,w.Z)(Y),["endpoint"]))}})]})]})})})},W=function(e){e.setResetConfigurationOpen;var n=e.WebhookSettingslist,t=e.type,i=(0,o.useState)(!1),a=(0,x.Z)(i,2),r=a[0],l=a[1],s=(0,o.useState)(!1),c=(0,x.Z)(s,2),d=c[0],f=c[1],p=(0,o.useState)(!1),m=(0,x.Z)(p,2),h=m[0],g=m[1],v=(0,o.useState)(""),b=(0,x.Z)(v,2),y=b[0],j=b[1],Z=(0,o.useState)(null),k=(0,x.Z)(Z,2),C=k[0],w=k[1],_=[{type:"view",onClick:function(e){e.name&&(g(!0),w(e))}},{type:"delete",onClick:function(e){e.name&&(f(!0),j(e.name))},disableButtonFunction:function(e){var t=n.find((function(n){return n.name===e}));return!!t&&t.key_values.filter((function(e){return!!e.env_override})).length>0}}];return(0,F.jsxs)(u.rjZ,{container:!0,children:[r&&(0,F.jsx)(N,{open:r,type:t,onCloseEndpoint:function(){l(!1)}}),d&&(0,F.jsx)(L,{modalOpen:d,onClose:function(){f(!1),j("")},selectedARN:y,type:t}),h&&C&&(0,F.jsx)(M,{open:h,type:t,endpointInfo:C,onCloseEndpoint:function(){g(!1),w(null)}}),(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:{display:"flex",justifyContent:"flex-end"},children:(0,F.jsx)(u.zxk,{id:"newWebhook",variant:"callAction",onClick:function(){l(!0)},children:"New Endpoint"})}),(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:{padding:"0 10px 10px"},children:(0,F.jsxs)(o.Fragment,{children:[(0,F.jsx)("h3",{children:"Currently Configured Endpoints"}),(0,F.jsx)(u.wQF,{columns:[{label:"Status",elementKey:"key_values",renderFunction:function(e){var n=e.find((function(e){return"enable"===e.key}));if(null!==n&&void 0!==n&&n.env_override){var t=null!==n&&void 0!==n&&n.env_override.value&&"on"!==(null===n||void 0===n?void 0:n.env_override.value)&&null!==n&&void 0!==n&&n.env_override.value?"Disabled":"Enabled";return(0,F.jsxs)(u.rjZ,{container:!0,sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyItems:"start",fontSize:"8px"},children:[(0,F.jsx)(u.zD0,{style:{fill:"#052F51",width:"14px"}}),t?"Enabled":"Disabled"]})}return n&&"on"!==n.value&&n.value?(0,F.jsxs)(u.rjZ,{container:!0,sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyItems:"start",fontSize:"8px"},children:[(0,F.jsx)(u.qwj,{style:{fill:"#C83B51",width:14,height:14}}),"Disabled"]}):(0,F.jsxs)(u.rjZ,{container:!0,sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyItems:"start",fontSize:"8px"},children:[(0,F.jsx)(u.Yp9,{style:{fill:"#4CCB92",width:14,height:14}}),"Enabled"]})},width:50},{label:"Name",elementKey:"name"},{label:"Endpoint",elementKey:"key_values",renderFunction:function(e){var n=e.find((function(e){return"endpoint"===e.key}));return n?n.env_override?n.env_override.value:n.value:""}}],itemActions:_,idField:"name",isLoading:!1,records:n,entityName:"endpoints",customPaperHeight:"calc(100vh - 750px)"})]})})]})},B=t(78687),z=(0,r.Z)((function(e){return(0,a.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},c.YI),c.Je),{},{settingsFormContainer:{display:"grid",gridTemplateColumns:"1fr",gridGap:"10px"}}))}))((function(e){var n=e.selectedConfiguration,t=e.classes,i=e.className,a=void 0===i?"":i,r=(0,C.TL)(),c=(0,d.s0)(),f=(0,d.TH)().pathname,p=void 0===f?"":f,m=p.substring(p.lastIndexOf("/")+1);m="settings"===m?"region":m;var h=(0,o.useState)([]),g=(0,x.Z)(h,2),w=g[0],_=g[1],E=(0,o.useState)(!1),S=(0,x.Z)(E,2),T=S[0],A=S[1],I=(0,o.useState)([]),N=(0,x.Z)(I,2),R=N[0],q=N[1],L=(0,o.useState)([]),D=(0,x.Z)(L,2),P=D[0],M=D[1],z=(0,o.useState)(!1),O=(0,x.Z)(z,2),H=O[0],K=O[1],U=(0,o.useState)({}),V=(0,x.Z)(U,2),G=V[0],Y=V[1],$=(0,B.v9)((function(e){return e.system.loadingConfigurations}));(0,o.useEffect)((function(){r((0,k.Ie)(!0))}),[m,r]),(0,o.useEffect)((function(){if($){var e=v()(n,"configuration_id",!1);if(e)return void y.Z.invoke("GET","/api/v1/configs/".concat(e)).then((function(n){M(n);var t=v()(n[0],"key_values",[]),i=s.DP[e].map((function(e){var n=t.find((function(n){return n.key===e.name})),i=(null===n||void 0===n?void 0:n.value)||"";return{key:e.name,value:e.customValueProcess?e.customValueProcess(i):i}}));q(i),Y((0,s.F_)(i)),r((0,k.Ie)(!1))})).catch((function(e){r((0,k.Ie)(!1)),r((0,k.Ih)(e))}));r((0,k.Ie)(!1))}}),[$,n,r]),(0,o.useEffect)((function(){if(T){var e={key_values:(0,s.DD)(w)};y.Z.invoke("PUT","/api/v1/configs/".concat(n.configuration_id),e).then((function(e){A(!1),r((0,k.cN)(e.restart)),r((0,k.Ie)(!0)),e.restart||r((0,k.y1)("Configuration saved successfully"))})).catch((function(e){A(!1),r((0,k.Ih)(e))}))}}),[T,r,n,w,c]);var Q=(0,o.useCallback)((function(e){_(e)}),[_]),J=function(){K(!0)};return(0,F.jsxs)(o.Fragment,{children:[H&&(0,F.jsx)(Z.Z,{configurationName:n.configuration_id,closeResetModalAndRefresh:function(e){K(!1),r((0,k.cN)(e)),e&&r((0,k.Ie)(!0))},resetOpen:H}),$?(0,F.jsx)(l.ZP,{item:!0,xs:12,sx:{textAlign:"center",paddingTop:"15px"},children:(0,F.jsx)(u.aNw,{})}):(0,F.jsx)(b.Z,{sx:{padding:"15px",height:"100%"},children:"logger_webhook"===n.configuration_id||"audit_webhook"===n.configuration_id?(0,F.jsx)(W,{WebhookSettingslist:P,setResetConfigurationOpen:J,type:n.configuration_id}):(0,F.jsx)(o.Fragment,{children:(0,F.jsxs)("form",{noValidate:!0,onSubmit:function(e){e.preventDefault(),A(!0)},className:a,style:{height:"100%",display:"flex",flexFlow:"column"},children:[(0,F.jsx)(l.ZP,{item:!0,xs:12,className:t.settingsFormContainer,children:(0,F.jsx)(j.default,{fields:s.DP[n.configuration_id],onChange:Q,defaultVals:R,overrideEnv:G})}),(0,F.jsxs)(l.ZP,{item:!0,xs:12,sx:{paddingTop:"15px ",textAlign:"right",maxHeight:"60px",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:[(0,F.jsx)(u.zxk,{id:"restore-defaults",variant:"secondary",onClick:J,label:"Restore Defaults"}),"\xa0 \xa0",(0,F.jsx)(u.zxk,{id:"save",type:"submit",variant:"callAction",disabled:T,label:"Save"})]})]})})})]})})),O=function(){var e=(0,d.TH)().pathname,n=void 0===e?"":e,t=n.substring(n.lastIndexOf("/")+1),i=s.bx.find((function(e){return e.configuration_id===t})),o="".concat(t);return(0,F.jsx)(u.rjZ,{item:!0,xs:12,sx:{height:"100%","& .identity_ldap, .api":{"& label":{minWidth:220,marginRight:0}}},children:i&&(0,F.jsx)(z,{className:"".concat(o),selectedConfiguration:i})})},H=t(56087),K=t(47974),U=t(9505),V=t(45248),G=t(99779),Y=t(27454),$=function(){var e=(0,B.I0)(),n=(0,U.Z)((function(e){(0,V.zZ)(new Blob([window.atob(e.value)]),"minio-server-config-".concat(G.ou.now().toFormat("LL-dd-yyyy-HH-mm-ss"),".conf"))}),(function(n){e((0,k.Ih)(n))})),t=(0,x.Z)(n,2),i=t[0],o=t[1];return(0,F.jsx)(Y.Z,{tooltip:"Warning!. The resulting file would contain server configuration information in plain text.",children:(0,F.jsx)(u.zxk,{id:"export-config",onClick:function(){o("GET","api/v1/configs/export")},icon:(0,F.jsx)(u.rG2,{}),label:"Export",variant:"regular",disabled:i})})},Q=function(){var e=(0,d.s0)(),n=(0,B.I0)(),t=(0,B.v9)((function(e){return e.system.serverNeedsRestart})),i=(0,o.useState)(void 0),a=(0,x.Z)(i,2),r=a[0],l=a[1],s=(0,o.useRef)(null),c=(0,U.Z)((function(e){n((0,k.cN)(!0)),l(!0)}),(function(e){n((0,k.Ih)(e))})),f=(0,x.Z)(c,2),p=f[0],m=f[1];(0,o.useEffect)((function(){!t&&r&&e(0)}),[t,r,e]);return(0,F.jsxs)(o.Fragment,{children:[(0,F.jsx)("input",{type:"file",onChange:function(e){if(null!==e&&void 0!==e&&null!==e.target.files&&void 0!==e.target.files){e.preventDefault();var n=(0,x.Z)(e.target.files,1)[0],t=new FormData,i=new Blob([n],{type:n.type});t.append("file",i,n.name),m("POST","api/v1/configs/import",t),e.target.value=""}},style:{display:"none"},ref:s}),(0,F.jsx)(Y.Z,{tooltip:"The file must be valid and should have valid config values",children:(0,F.jsx)(u.zxk,{id:"import-config",onClick:function(){s&&s.current&&s.current.click()},icon:(0,F.jsx)(u._8t,{}),label:"Import",variant:"regular",disabled:p})})]})},J=(0,r.Z)((function(e){return(0,a.Z)((0,i.Z)((0,i.Z)((0,i.Z)({settingsOptionsContainer:{display:"flex",flexDirection:"row",justifyContent:"flex-start",flexWrap:"wrap",border:"#E5E5E5 1px solid",borderRadius:2,backgroundColor:"#fff"}},c.qg),c.OR),c.Bz))}))((function(e){var n=e.classes,t=(0,d.TH)().pathname,i=void 0===t?"":t,a=i.substring(i.lastIndexOf("/")+1);return a="settings"===a?"region":a,(0,F.jsxs)(o.Fragment,{children:[(0,F.jsx)(K.Z,{label:"Settings"}),(0,F.jsxs)(m.Z,{children:[(0,F.jsx)(l.ZP,{item:!0,xs:12,children:(0,F.jsxs)("div",{id:"settings-container",className:n.settingsOptionsContainer,children:[(0,F.jsx)(h.Z,{icon:(0,F.jsx)(u.ewm,{}),title:"MinIO Configuration:",actions:(0,F.jsxs)(b.Z,{sx:{display:"flex",gap:2},children:[(0,F.jsx)(Q,{}),(0,F.jsx)($,{})]})}),(0,F.jsx)(p.Z,{selectedTab:a,isRouteTabs:!0,routes:(0,F.jsxs)(d.Z5,{children:[s.bx.map((function(e){return(0,F.jsx)(d.AW,{path:"".concat(e.configuration_id),element:(0,F.jsx)(O,{})},"configItem-".concat(e.configuration_label))})),(0,F.jsx)(d.AW,{path:"/",element:(0,F.jsx)(d.Fg,{to:"".concat(H.gA.SETTINGS,"/region")})})]}),children:s.bx.map((function(e){var n,t=e.configuration_id;return{tabConfig:{label:e.configuration_label,value:t,icon:e.icon,component:f.rU,to:(n=t,"".concat(H.gA.SETTINGS,"/").concat(n))}}}))})]})}),(0,F.jsx)(l.ZP,{item:!0,xs:12,sx:{paddingTop:"15px"},children:(0,F.jsx)(u.KfX,{title:"Learn more about Configurations",iconComponent:(0,F.jsx)(u.ewm,{}),help:(0,F.jsxs)(o.Fragment,{children:["MinIO supports a variety of configurations ranging from encryption, compression, region, notifications, etc.",(0,F.jsx)("br",{}),(0,F.jsx)("br",{}),"You can learn more at our"," ",(0,F.jsx)("a",{href:"https://min.io/docs/minio/linux/reference/minio-mc-admin/mc-admin-config.html?ref=con#id4",target:"_blank",rel:"noopener",children:"documentation"}),"."]})})})]})]})}))},58493:function(e,n,t){t.d(n,{DD:function(){return v},DP:function(){return g},F_:function(){return y},_0:function(){return b},bx:function(){return x}});var i=t(4942),o=t(1413),a=t(93433),r=(t(72791),t(87569)),l=t(61809),s=t(31292),c=t(98095),u=t(67055),d=t(21141),f=t(36909),p=t(13901),m=t(75952),h=t(80184),x=[{icon:(0,h.jsx)(r.Z,{}),configuration_id:"region",configuration_label:"Region"},{icon:(0,h.jsx)(l.Z,{}),configuration_id:"compression",configuration_label:"Compression"},{icon:(0,h.jsx)(s.Z,{}),configuration_id:"api",configuration_label:"API"},{icon:(0,h.jsx)(c.Z,{}),configuration_id:"heal",configuration_label:"Heal"},{icon:(0,h.jsx)(u.Z,{}),configuration_id:"scanner",configuration_label:"Scanner"},{icon:(0,h.jsx)(d.Z,{}),configuration_id:"etcd",configuration_label:"Etcd"},{icon:(0,h.jsx)(p.Z,{}),configuration_id:"logger_webhook",configuration_label:"Logger Webhook"},{icon:(0,h.jsx)(f.Z,{}),configuration_id:"audit_webhook",configuration_label:"Audit Webhook"},{icon:(0,h.jsx)(m.I$E,{className:"MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiTab-iconWrapper css-i4bv87-MuiSvgIcon-root",style:{width:24,height:24}}),configuration_id:"audit_kafka",configuration_label:"Audit Kafka"}],g={region:[{name:"name",required:!0,label:"Server Location",tooltip:'Name of the location of the server e.g. "us-west-rack2"',type:"string",placeholder:"e.g. us-west-rack-2"},{name:"comment",required:!1,label:"Comment",tooltip:"You can add a comment to this setting",type:"comment",placeholder:"Enter custom notes if any"}],compression:[{name:"extensions",required:!1,label:"Extensions",tooltip:'Extensions to compress e.g. ".txt",".log" or ".csv", you can write one per field',type:"csv",placeholder:"Enter an Extension",withBorder:!0},{name:"mime_types",required:!1,label:"Mime Types",tooltip:'Mime types e.g. "text/*","application/json" or "application/xml", you can write one per field',type:"csv",placeholder:"Enter a Mime Type",withBorder:!0}],api:[{name:"requests_max",required:!1,label:"Requests Max",tooltip:"Maximum number of concurrent requests, e.g. '1600'",type:"number",placeholder:"Enter Requests Max"},{name:"cors_allow_origin",required:!1,label:"Cors Allow Origin",tooltip:"List of origins allowed for CORS requests",type:"csv",placeholder:"Enter allowed origin e.g. https://example.com"},{name:"replication_workers",required:!1,label:"Replication Workers",tooltip:"Number of replication workers, defaults to 100",type:"number",placeholder:"Enter Replication Workers"},{name:"replication_failed_workers",required:!1,label:"Replication Failed Workers",tooltip:"Number of replication workers for recently failed replicas, defaults to 4",type:"number",placeholder:"Enter Replication Failed Workers"}],heal:[{name:"bitrotscan",required:!1,label:"Bitrot Scan",tooltip:"Perform bitrot scan on disks when checking objects during scanner",type:"on|off"},{name:"max_sleep",required:!1,label:"Max Sleep",tooltip:"Maximum sleep duration between objects to slow down heal operation. eg. 2s",type:"duration",placeholder:"Enter Max Sleep duration"},{name:"max_io",required:!1,label:"Max IO",tooltip:"Maximum IO requests allowed between objects to slow down heal operation. eg. 3",type:"number",placeholder:"Enter Max IO"}],scanner:[{name:"delay",required:!1,label:"Delay multiplier",tooltip:"Scanner delay multiplier, defaults to '10.0'",type:"number",placeholder:"Enter Delay"},{name:"max_wait",required:!1,label:"Max Wait",tooltip:"Maximum wait time between operations, defaults to '15s'",type:"duration",placeholder:"Enter Max Wait"},{name:"cycle",required:!1,label:"Cycle",tooltip:"Time duration between scanner cycles, defaults to '1m'",type:"duration",placeholder:"Enter Cycle"}],etcd:[{name:"endpoints",required:!0,label:"Endpoints",tooltip:'List of etcd endpoints e.g. "http://localhost:2379", you can write one per field',type:"csv",placeholder:"Enter Endpoint"},{name:"path_prefix",required:!1,label:"Path Prefix",tooltip:'Namespace prefix to isolate tenants e.g. "customer1/"',type:"string",placeholder:"Enter Path Prefix"},{name:"coredns_path",required:!1,label:"Coredns Path",tooltip:'Shared bucket DNS records, default is "/skydns"',type:"string",placeholder:"Enter Coredns Path"},{name:"client_cert",required:!1,label:"Client Cert",tooltip:"Client cert for mTLS authentication",type:"string",placeholder:"Enter Client Cert"},{name:"client_cert_key",required:!1,label:"Client Cert Key",tooltip:"Client cert key for mTLS authentication",type:"string",placeholder:"Enter Client Cert Key"},{name:"comment",required:!1,label:"Comment",tooltip:"You can add a comment to this setting",type:"comment",multiline:!0,placeholder:"Enter custom notes if any"}],logger_webhook:[{name:"endpoint",required:!0,label:"Endpoint",type:"string",placeholder:"Enter Endpoint"},{name:"auth_token",required:!0,label:"Auth Token",type:"string",placeholder:"Enter Auth Token"}],audit_webhook:[{name:"endpoint",required:!0,label:"Endpoint",type:"string",placeholder:"Enter Endpoint"},{name:"auth_token",required:!0,label:"Auth Token",type:"string",placeholder:"Enter Auth Token"}],audit_kafka:[{name:"enable",required:!1,label:"Enable",tooltip:"Enable audit_kafka target",type:"on|off",customValueProcess:function(e){return""===e||"on"===e?"on":"off"}},{name:"brokers",required:!0,label:"Brokers",type:"csv",placeholder:"Enter Kafka broker"},{name:"topic",required:!1,label:"Topic",type:"string",placeholder:"Enter Kafka Topic",tooltip:"Kafka topic used for bucket notifications"},{name:"sasl",required:!1,label:"Use SASL",tooltip:"Enable SASL authentication",type:"on|off"},{name:"sasl_username",required:!1,label:"SASL Username",type:"string",placeholder:"Enter SASL Username",tooltip:"Username for SASL/PLAIN or SASL/SCRAM authentication"},{name:"sasl_password",required:!1,label:"SASL Password",type:"password",placeholder:"Enter SASL Password",tooltip:"Password for SASL/PLAIN or SASL/SCRAM authentication"},{name:"sasl_mechanism",required:!1,label:"SASL Mechanism",type:"string",placeholder:"Enter SASL Mechanism",tooltip:"SASL authentication mechanism"},{name:"tls",required:!1,label:"Use TLS",tooltip:"Enable TLS",type:"on|off"},{name:"tls_skip_verify",required:!1,label:"Skip TLS Verification",tooltip:"Trust server TLS without verification",type:"on|off"},{name:"client_tls_cert",required:!1,label:"Client Cert",tooltip:"Client cert for mTLS authentication",type:"string",placeholder:"Enter Client Cert"},{name:"client_tls_key",required:!1,label:"Client Cert Key",tooltip:"Client cert key for mTLS authentication",type:"string",placeholder:"Enter Client Cert Key"},{name:"tls_client_auth",required:!1,label:"TLS Client Auth",tooltip:"ClientAuth determines the Kafka server's policy for TLS client auth",type:"string"},{name:"version",required:!1,label:"Version",tooltip:"Specify the version of the Kafka cluster",type:"string"}]},v=function(e){return e.filter((function(e){return""!==e.value}))},b=function(e,n,t){var i=e.target,o=i.value,r=i.checked,l=(0,a.Z)(t);return r?l.push(o):l=l.filter((function(e){return e!==o})),n(l),l},y=function(e){var n={};return e.forEach((function(e){if(e.env_override){var t={value:e.env_override.value,overrideEnv:e.env_override.name};n=(0,o.Z)((0,o.Z)({},n),{},(0,i.Z)({},e.key,t))}})),n}},90767:function(e,n,t){var i=t(29439),o=t(1413),a=t(72791),r=t(40986),l=t(51691),s=t(11135),c=t(25787),u=t(23814),d=t(81207),f=t(23508),p=t(75952),m=t(87995),h=t(81551),x=t(80184);n.Z=(0,c.Z)((function(e){return(0,s.Z)((0,o.Z)({wrapText:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"}},u.Qw))}))((function(e){var n=e.classes,t=e.configurationName,o=e.closeResetModalAndRefresh,s=e.resetOpen,c=(0,h.TL)(),u=(0,a.useState)(!1),g=(0,i.Z)(u,2),v=g[0],b=g[1];(0,a.useEffect)((function(){v&&d.Z.invoke("POST","/api/v1/configs/".concat(t,"/reset")).then((function(e){b(!1),o(!0)})).catch((function(e){b(!1),c((0,m.Ih)(e))}))}),[o,t,v,c]);return(0,x.jsx)(f.Z,{title:"Restore Defaults",confirmText:"Yes, Reset Configuration",isOpen:s,titleIcon:(0,x.jsx)(p.NvT,{}),isLoading:v,onConfirm:function(){b(!0)},onClose:function(){o(!1)},confirmationContent:(0,x.jsxs)(a.Fragment,{children:[v&&(0,x.jsx)(r.Z,{}),(0,x.jsxs)(l.Z,{children:["Are you sure you want to restore these configurations to default values?",(0,x.jsx)("br",{}),(0,x.jsx)("b",{className:n.wrapText,children:"Please note that this may cause your system to not be accessible"})]})]})})}))}}]);
//# sourceMappingURL=1432.c59f4621.chunk.js.map