mirror of
https://github.com/OpenMaxIO/openmaxio-object-browser
synced 2026-07-01 07:41:18 -07:00
2 lines
3.6 KiB
JavaScript
2 lines
3.6 KiB
JavaScript
"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[7515],{67515:(e,t,n)=>{n.r(t),n.d(t,{default:()=>b});var i=n(65043),a=n(89923),o=n(56629),l=n(85330),r=n(53518),s=n(77403),c=n(64159),d=n(21383),u=n(94141),m=n(70579);const b=e=>{let{open:t,bucketName:n,closeModalAndRefresh:b}=e;const p=(0,d.jL)(),[h,g]=(0,i.useState)(!1),[j,f]=(0,i.useState)(!0),[x,v]=(0,i.useState)(l.BT.Compliance),[y,C]=(0,i.useState)(l.wg.Days),[k,S]=(0,i.useState)(1),[w,_]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{Number.isNaN(k)||(k||1)<1?_(!1):_(!0)}),[k]),(0,i.useEffect)((()=>{j&&o.F.buckets.getBucketRetentionConfig(n).then((e=>{f(!1),v(e.data.mode),S(e.data.validity),C(e.data.unit)})).catch((()=>{f(!1)}))}),[j,n]),(0,m.jsx)(u.A,{title:"Set Retention Configuration",modalOpen:t,onClose:()=>{b()},children:j?(0,m.jsx)(a.aHM,{style:{width:16,height:16}}):(0,m.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),h||(g(!0),o.F.buckets.setBucketRetentionConfig(n,{mode:x||l.BT.Compliance,unit:y||l.wg.Days,validity:k||1}).then((()=>{g(!1),b()})).catch((e=>{g(!1),p((0,c.Dy)((0,r.S)(e.error)))})))},children:(0,m.jsxs)(a.Hbc,{containerPadding:!1,withBorders:!1,children:[(0,m.jsx)(a.z6M,{currentValue:x,id:"retention_mode",name:"retention_mode",label:"Retention Mode",onChange:e=>{v(e.target.value)},selectorOptions:[{value:"compliance",label:"Compliance"},{value:"governance",label:"Governance"}],helpTip:(0,m.jsxs)(i.Fragment,{children:[" ",(0,m.jsx)("a",{href:"https://min.io/docs/minio/macos/administration/object-management/object-retention.html#minio-object-locking-compliance",target:"blank",children:"Compliance"})," ","lock protects Objects from write operations by all users, including the MinIO root user.",(0,m.jsx)("br",{}),(0,m.jsx)("br",{}),(0,m.jsx)("a",{href:"https://min.io/docs/minio/macos/administration/object-management/object-retention.html#minio-object-locking-governance",target:"blank",children:"Governance"})," ","lock protects Objects from write operations by non-privileged users."]}),helpTipPlacement:"right"}),(0,m.jsx)(a.z6M,{currentValue:y,id:"retention_unit",name:"retention_unit",label:"Retention Unit",onChange:e=>{C(e.target.value)},selectorOptions:[{value:"days",label:"Days"},{value:"years",label:"Years"}]}),(0,m.jsx)(a.cl_,{type:"number",id:"retention_validity",name:"retention_validity",onChange:e=>{S(e.target.valueAsNumber)},label:"Retention Validity",value:String(k),required:!0,min:"1"}),(0,m.jsxs)(a.xA9,{item:!0,xs:12,sx:s.Uz.modalButtonBar,children:[(0,m.jsx)(a.$nd,{id:"cancel",type:"button",variant:"regular",disabled:h,onClick:()=>{b()},label:"Cancel"}),(0,m.jsx)(a.$nd,{id:"set",type:"submit",variant:"callAction",color:"primary",disabled:h||!w,label:"Set"})]}),h&&(0,m.jsx)(a.xA9,{item:!0,xs:12,children:(0,m.jsx)(a.z21,{})})]})})})}},94141:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(65043),a=n(22166),o=n(89923),l=n(21383),r=n(64159),s=n(49555),c=n(70579);const d=e=>{let{onClose:t,modalOpen:n,title:d,children:u,wideLimit:m=!0,titleIcon:b=null,iconColor:p="default",sx:h}=e;const g=(0,l.jL)(),[j,f]=(0,i.useState)(!1),x=(0,a.d4)((e=>e.system.modalSnackBar));(0,i.useEffect)((()=>{g((0,r.h0)(""))}),[g]),(0,i.useEffect)((()=>{if(x){if(""===x.message)return void f(!1);"error"!==x.type&&f(!0)}}),[x]);let v="";return x&&(v=x.detailedErrorMsg,(""===v||v&&v.length<5)&&(v=x.message)),(0,c.jsxs)(o.ngX,{onClose:t,open:n,title:d,titleIcon:b,widthLimit:m,sx:h,iconColor:p,children:[(0,c.jsx)(s.A,{isModal:!0}),(0,c.jsx)(o.qb_,{onClose:()=>{f(!1),g((0,r.h0)(""))},open:j,message:v,mode:"inline",variant:"error"===x.type?"error":"default",autoHideDuration:"error"===x.type?10:5,condensed:!0}),u]})}}}]);
|
|
//# sourceMappingURL=7515.3c5e861f.chunk.js.map
|