"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[4776],{94776:(e,t,n)=>{n.r(t),n.d(t,{default:()=>j,emptyContent:()=>u});var a=n(69060),s=n(66152),l=n(51560),o=n(21124),r=n(95705),c=n(66156),i=n(61628),p=n(52224),m=n(3428),x=n(48504),y=n(61180),d=n(78256),h=n(82496);const u='{\n    "bytes": ""\n}',j=()=>{const e=(0,c.Ab)(),t=(0,l.i6)(),[n,j]=(0,a.useState)(!1),[b,k]=(0,a.useState)(""),[K,f]=(0,a.useState)(u),g=""!==b.trim()&&-1===b.indexOf(" ");return(0,a.useEffect)((()=>{e((0,r.i8)("import_key"))}),[]),(0,h.jsx)(a.Fragment,{children:(0,h.jsxs)(s.yeN,{item:!0,xs:12,children:[(0,h.jsx)(m.c,{label:(0,h.jsx)(s.y_F,{onClick:()=>t(o.Ks.KMS_KEYS),label:"Keys"}),actions:(0,h.jsx)(x.c,{})}),(0,h.jsx)(s._al,{children:(0,h.jsx)(s.yE_,{title:"Import Key",icon:(0,h.jsx)(s.MV9,{}),helpBox:(0,h.jsx)(p.c,{helpText:"Encryption Key",contents:["Import a cryptographic key in the Key Management Service server connected to MINIO."]}),children:(0,h.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:n=>{(n=>{j(!0),n.preventDefault();let a=JSON.parse(K);y.m.kms.kmsImportKey(b,a).then((e=>{t("".concat(o.Ks.KMS_KEYS))})).catch((async t=>{const n=await t.json();e((0,r.aW)((0,d.K)(n)))})).finally((()=>j(!1)))})(n)},children:[(0,h.jsx)(s.q22,{id:"key-name",name:"key-name",label:"Key Name",autoFocus:!0,value:b,error:(e=>-1!==e.indexOf(" ")?"Key name cannot contain spaces":"")(b),onChange:e=>{k(e.target.value)}}),(0,h.jsx)(s.MlX,{label:"Set key Content",value:K,onChange:e=>{f(e)},editorHeight:"350px"}),(0,h.jsxs)(s.yeN,{item:!0,xs:12,sx:i.W2.modalButtonBar,children:[(0,h.jsx)(s.qaq,{id:"clear",type:"button",variant:"regular",onClick:()=>{k(""),f("")},label:"Clear"}),(0,h.jsx)(s.qaq,{id:"import-key",type:"submit",variant:"callAction",color:"primary",disabled:n||!g,label:"Import"})]})]})})})]})})}},52224:(e,t,n)=>{n.d(t,{c:()=>o});var a=n(69060),s=n(66152),l=n(82496);const o=e=>{let{helpText:t,contents:n}=e;return(0,l.jsx)(s.g1k,{iconComponent:(0,l.jsx)(s.cFZ,{}),title:t,help:(0,l.jsx)(a.Fragment,{children:n.map((e=>(0,l.jsx)(s.kvh,{sx:{paddingBottom:"20px"},children:e})))})})}}}]);
//# sourceMappingURL=4776.5ef55320.chunk.js.map