Files
openmaxio-object-browser/web-app/build/static/js/7659.9554f8f3.chunk.js
Alex 3db998f9c4 Release v1.6.2 (#3407)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2024-07-12 12:43:59 -07:00

2 lines
9.6 KiB
JavaScript

(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[7659],{97659:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>b});var n=o(65043),r=o(56629),a=o(85330),i=o(53518),l=o(89923),c=o(77403),s=o(64159),u=o(21383),p=o(95316),f=o(94141),d=o(41206),y=o(70579);const b=e=>{let{open:t,bucketName:o,actualPolicy:b,actualDefinition:m,closeModalAndRefresh:h}=e;const g=(0,u.jL)(),[v,C]=(0,n.useState)(!1),[j,x]=(0,n.useState)(""),[w,O]=(0,n.useState)(p.U);return(0,n.useEffect)((()=>{x(b),O(m?JSON.stringify(JSON.parse(m),null,4):p.U)}),[x,b,O,m]),(0,y.jsx)(f.A,{title:"Change Access Policy",modalOpen:t,onClose:()=>{h()},titleIcon:(0,y.jsx)(l.uYH,{}),children:(0,y.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),!v&&j&&(C(!0),r.F.buckets.bucketSetPolicy(o,{access:j,definition:w}).then((()=>{C(!1),h()})).catch((e=>{C(!1),g((0,s.Dy)((0,i.S)(e.error)))})))},children:[(0,y.jsxs)(l.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,y.jsx)(l.l6P,{value:j,label:"Access Policy",id:"select-access-policy",name:"select-access-policy",onChange:e=>{x(e)},options:[{value:a.jz.PRIVATE,label:"Private"},{value:a.jz.PUBLIC,label:"Public"},{value:a.jz.CUSTOM,label:"Custom"}]}),"PUBLIC"===j&&(0,y.jsx)(l.azJ,{className:"muted",style:{marginTop:"25px",fontSize:"14px",fontStyle:"italic"},children:"* Warning: With Public access anyone will be able to upload, download and delete files from this Bucket *"}),"CUSTOM"===j&&(0,y.jsx)(l.xA9,{item:!0,xs:12,children:(0,y.jsx)(d.A,{label:"Write Policy",value:w,onChange:e=>{O(e)},editorHeight:"300px",helptip:(0,y.jsx)(n.Fragment,{children:(0,y.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/identity-access-management/policy-based-access-control.html#policy-document-structure",children:"Guide to access policy structure"})})})})]}),(0,y.jsxs)(l.azJ,{sx:c.Uz.modalButtonBar,children:[(0,y.jsx)(l.$nd,{id:"cancel",type:"button",variant:"regular",onClick:()=>{h()},disabled:v,label:"Cancel"}),(0,y.jsx)(l.$nd,{id:"set",type:"submit",variant:"callAction",disabled:v||"CUSTOM"===j&&!w,label:"Set"})]})]})})}},41206:(e,t,o)=>{"use strict";o.d(t,{A:()=>s});var n=o(65043),r=o(89923),a=o(61476),i=o.n(a),l=o(6681),c=o(70579);const s=e=>{let{value:t,label:o="",tooltip:a="",mode:s="json",onChange:u,editorHeight:p=250,helptip:f}=e;return(0,c.jsx)(r.BYM,{value:t,onChange:e=>u(e),mode:s,tooltip:a,editorHeight:p,label:o,helpTools:(0,c.jsx)(n.Fragment,{children:(0,c.jsx)(l.A,{tooltip:"Copy to Clipboard",children:(0,c.jsx)(i(),{text:t,children:(0,c.jsx)(r.$nd,{type:"button",id:"copy-code-mirror",icon:(0,c.jsx)(r.TdU,{}),color:"primary",variant:"regular"})})})}),helpTip:f,helpTipPlacement:"right"})}},94141:(e,t,o)=>{"use strict";o.d(t,{A:()=>u});var n=o(65043),r=o(22166),a=o(89923),i=o(21383),l=o(64159),c=o(49555),s=o(70579);const u=e=>{let{onClose:t,modalOpen:o,title:u,children:p,wideLimit:f=!0,titleIcon:d=null,iconColor:y="default",sx:b}=e;const m=(0,i.jL)(),[h,g]=(0,n.useState)(!1),v=(0,r.d4)((e=>e.system.modalSnackBar));(0,n.useEffect)((()=>{m((0,l.h0)(""))}),[m]),(0,n.useEffect)((()=>{if(v){if(""===v.message)return void g(!1);"error"!==v.type&&g(!0)}}),[v]);let C="";return v&&(C=v.detailedErrorMsg,(""===C||C&&C.length<5)&&(C=v.message)),(0,s.jsxs)(a.ngX,{onClose:t,open:o,title:u,titleIcon:d,widthLimit:f,sx:b,iconColor:y,children:[(0,s.jsx)(c.A,{isModal:!0}),(0,s.jsx)(a.qb_,{onClose:()=>{g(!1),m((0,l.h0)(""))},open:h,message:C,mode:"inline",variant:"error"===v.type?"error":"default",autoHideDuration:"error"===v.type?10:5,condensed:!0}),p]})}},95316:(e,t,o)=>{"use strict";o.d(t,{U:()=>n});const n='{\n "Version": "2012-10-17",\n "Statement": [\n \n ]\n}'},75270:(e,t,o)=>{"use strict";var n=o(40139),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var o,a,i,l,c,s,u=!1;t||(t={}),o=t.debug||!1;try{if(i=n(),l=document.createRange(),c=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),"undefined"===typeof n.clipboardData){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=r[t.format]||r.default;window.clipboardData.setData(a,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(s),l.selectNodeContents(s),c.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(p){o&&console.error("unable to copy using execCommand: ",p),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(p){o&&console.error("unable to copy using clipboardData: ",p),o&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{c&&("function"==typeof c.removeRange?c.removeRange(l):c.removeAllRanges()),s&&document.body.removeChild(s),i()}return u}},24480:(e,t,o)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=l(o(65043)),a=l(o(75270)),i=["text","onCopy","options","children"];function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function s(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?c(Object(o),!0).forEach((function(t){m(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):c(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function u(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},a=Object.keys(e);for(n=0;n<a.length;n++)o=a[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)o=a[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function p(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function d(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,r=b(e);if(t){var a=b(this).constructor;o=Reflect.construct(r,arguments,a)}else o=r.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}(this,o)}}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function m(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var h=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(c,e);var t,o,n,l=d(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return m(y(e=l.call.apply(l,[this].concat(o))),"onClick",(function(t){var o=e.props,n=o.text,i=o.onCopy,l=o.children,c=o.options,s=r.default.Children.only(l),u=(0,a.default)(n,c);i&&i(n,u),s&&s.props&&"function"===typeof s.props.onClick&&s.props.onClick(t)})),e}return t=c,(o=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),o=u(e,i),n=r.default.Children.only(t);return r.default.cloneElement(n,s(s({},o),{},{onClick:this.onClick}))}}])&&p(t.prototype,o),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.default.PureComponent);t.CopyToClipboard=h,m(h,"defaultProps",{onCopy:void 0,options:void 0})},61476:(e,t,o)=>{"use strict";var n=o(24480).CopyToClipboard;n.CopyToClipboard=n,e.exports=n},40139:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,o=[],n=0;n<e.rangeCount;n++)o.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||o.forEach((function(t){e.addRange(t)})),t&&t.focus()}}}}]);
//# sourceMappingURL=7659.9554f8f3.chunk.js.map