mirror of
https://github.com/OpenMaxIO/openmaxio-object-browser
synced 2026-07-01 07:41:18 -07:00
2 lines
3.0 KiB
JavaScript
2 lines
3.0 KiB
JavaScript
"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[8296],{8296:(e,t,l)=>{l.r(t),l.d(t,{default:()=>x});var a=l(72791),s=l(29945),n=l(87995),i=l(44690),c=l(31776),r=l(66315),o=l(56028),u=l(23814),d=l(80184);const x=e=>{let{open:t,selectedBucket:l,closeModalAndRefresh:x}=e;const b=(0,i.TL)(),[m,h]=(0,a.useState)(!1),[f,p]=(0,a.useState)(""),[j,v]=(0,a.useState)(""),[g,k]=(0,a.useState)(""),[S,C]=(0,a.useState)([]),[F,E]=(0,a.useState)([]),L=(0,a.useCallback)((()=>{h(!0),c.h.admin.arnList().then((e=>{null!==e.data.arns&&E(e.data.arns),h(!1)})).catch((e=>{h(!1),b((0,n.zb)(e))}))}),[b]);(0,a.useEffect)((()=>{L()}),[L]);const R=[{label:"PUT - Object Uploaded",value:r.Ln.Put},{label:"GET - Object accessed",value:r.Ln.Get},{label:"DELETE - Object Deleted",value:r.Ln.Delete},{label:"REPLICA - Object Replicated",value:r.Ln.Replica},{label:"ILM - Object Transitioned",value:r.Ln.Ilm},{label:"SCANNER - Object has too many versions / Prefixes has too many sub-folders",value:r.Ln.Scanner}],D=null===F||void 0===F?void 0:F.map((e=>({label:e,value:e})));return(0,d.jsx)(o.Z,{modalOpen:t,onClose:()=>{x()},title:"Subscribe To Bucket Events",titleIcon:(0,d.jsx)(s.c3W,{}),children:(0,d.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),m||(h(!0),c.h.buckets.createBucketEvent(l,{configuration:{arn:g,events:S,prefix:f,suffix:j},ignoreExisting:!0}).then((()=>{h(!1),x()})).catch((e=>{h(!1),b((0,n.zb)(e))})))},children:(0,d.jsxs)(s.rjZ,{container:!0,children:[(0,d.jsxs)(s.rjZ,{item:!0,xs:12,sx:u.oO.formScrollable,children:[(0,d.jsx)(s.rjZ,{item:!0,xs:12,sx:{...u.DF.formFieldRow,"& div div .MuiOutlinedInput-root":{padding:0}},children:(0,d.jsx)(s.F2H,{onChange:e=>{k(e)},id:"select-access-policy",name:"select-access-policy",label:"ARN",value:g,options:D||[],helpTip:(0,d.jsx)(a.Fragment,{children:(0,d.jsx)("a",{target:"blank",href:"https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html",children:"Amazon Resource Name"})})})}),(0,d.jsx)(s.rjZ,{item:!0,xs:12,sx:u.DF.formFieldRow,children:(0,d.jsx)(s.Wzg,{id:"prefix-input",name:"prefix-input",label:"Prefix",value:f,onChange:e=>{p(e.target.value)}})}),(0,d.jsx)(s.rjZ,{item:!0,xs:12,sx:u.DF.formFieldRow,children:(0,d.jsx)(s.Wzg,{id:"suffix-input",name:"suffix-input",label:"Suffix",value:j,onChange:e=>{v(e.target.value)}})}),(0,d.jsx)(s.rjZ,{item:!0,xs:12,sx:u.DF.formFieldRow,children:(0,d.jsx)(s.wQF,{columns:[{label:"Event",elementKey:"label"}],idField:"value",records:R,onSelect:e=>{const t=e.target,l=t.value,a=t.checked;let s=[...S];a?s.push(l):s=s.filter((e=>e!==l)),C(s)},selectedItems:S,noBackground:!0,customPaperHeight:"260px"})})]}),(0,d.jsxs)(s.rjZ,{item:!0,xs:12,sx:u.ID.modalButtonBar,children:[(0,d.jsx)(s.zxk,{id:"cancel-add-event",type:"button",variant:"regular",disabled:m,onClick:()=>{x()},label:"Cancel"}),(0,d.jsx)(s.zxk,{id:"save-event",type:"submit",variant:"callAction",disabled:m||""===g||0===S.length,label:"Save"})]})]})})})}}}]);
|
|
//# sourceMappingURL=8296.e55a5bf1.chunk.js.map
|