"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[9322],{67650:function(e,n,i){i.r(n),i.d(n,{default:function(){return w}});var t=i(49058),r=i(50418),a=i(57223),s=i(67066),l=i.n(s),o=i(11927),c=i(4481),d=i(46266),u=i(76701),m=i(73130),h=i(35563),p=i(36045),x=i(33097),y=i(16180),g=i.n(y),f=i(70783),v=i(70466),j=i(18054),b=(0,c.Z)((function(e){return(0,o.Z)({container:{display:"flex",flexFlow:"column",padding:"20px 0 8px 0"},inputWithCopy:{"& .MuiInputBase-root ":{width:"100%",background:"#FBFAFA","& .MuiInputBase-input":{height:".8rem"},"& .MuiInputAdornment-positionEnd":{marginRight:".5rem","& .MuiButtonBase-root":{height:"2rem"}}},"& .MuiButtonBase-root .min-icon":{width:".8rem",height:".8rem"}},inputLabel:(0,t.Z)((0,t.Z)({},v.YI.inputLabel),{},{fontSize:".8rem"})})}))((function(e){var n=e.label,i=void 0===n?"":n,t=e.value,r=void 0===t?"":t,a=e.classes,s=void 0===a?{}:a;return(0,j.jsxs)("div",{className:s.container,children:[(0,j.jsxs)("div",{className:s.inputLabel,children:[i,":"]}),(0,j.jsx)("div",{className:s.inputWithCopy,children:(0,j.jsx)(h.Z,{value:r,readOnly:!0,endAdornment:(0,j.jsx)(p.Z,{position:"end",children:(0,j.jsx)(g(),{text:r,children:(0,j.jsx)(x.Z,{"aria-label":"copy",tooltip:"Copy",onClick:function(){},onMouseDown:function(){},edge:"end",children:(0,j.jsx)(f.TI,{})})})})})})]})})),Z=i(85029),w=(0,c.Z)((function(e){return(0,o.Z)({warningBlock:{color:"red",fontSize:".85rem",margin:".5rem 0 .5rem 0",display:"flex",alignItems:"center","& svg ":{marginRight:".3rem",height:16,width:16}},credentialTitle:{padding:".8rem 0 0 0",fontWeight:600,fontSize:".9rem"},buttonContainer:{textAlign:"right",marginTop:"1rem"},credentialsPanel:{overflowY:"auto",maxHeight:350},promptTitle:{display:"flex",alignItems:"center"},buttonSpacer:{marginRight:".9rem"},promptIcon:{marginRight:".1rem",display:"flex",alignItems:"center",height:"2rem",width:"2rem"}})}))((function(e){var n=e.classes,i=e.newServiceAccount,s=e.open,o=e.closeModal,c=e.entity;if(!i)return null;var h=l()(i,"console",null),p=l()(i,"idp",!1);return(0,j.jsx)(u.Z,{modalOpen:s,onClose:function(){o()},title:(0,j.jsx)("div",{className:n.promptTitle,children:(0,j.jsxs)("div",{children:["\u65b0\u7684 ",c," \u5df2\u521b\u5efa\u4e00\u4e2a\u65b0\u7684"]})}),titleIcon:(0,j.jsx)(f.tV,{}),children:(0,j.jsxs)(m.ZP,{container:!0,children:[(0,j.jsxs)(m.ZP,{item:!0,xs:12,className:n.formScrollable,children:["\u4e00\u4e2a\u65b0\u7684 ",c," \u5df2\u521b\u5efa\uff0c\u4ee5\u4e0b\u662f\u8be6\u60c5:",!p&&h&&(0,j.jsx)(a.Fragment,{children:(0,j.jsxs)(m.ZP,{item:!0,xs:12,className:n.credentialsPanel,children:[(0,j.jsx)("div",{className:n.credentialTitle,children:"\u63a7\u5236\u53f0\u51ed\u636e"}),Array.isArray(h)&&h.map((function(e,n){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b,{label:"\u8bbf\u95ee\u5bc6\u94a5",value:e.accessKey}),(0,j.jsx)(b,{label:"\u5bc6\u94a5",value:e.secretKey})]})})),!Array.isArray(h)&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b,{label:"\u8bbf\u95ee\u5bc6\u94a5",value:h.accessKey}),(0,j.jsx)(b,{label:"\u5bc6\u94a5",value:h.secretKey})]})]})}),p?(0,j.jsx)("div",{className:n.warningBlock,children:"Please Login via the configured external identity provider."}):(0,j.jsxs)("div",{className:n.warningBlock,children:[(0,j.jsx)(Z.Z,{}),(0,j.jsx)("span",{children:"Write these down, as this is the only time the secret will be displayed."})]})]}),(0,j.jsxs)(m.ZP,{item:!0,xs:12,className:n.buttonContainer,children:[(0,j.jsx)(d.Z,{id:"done-button",variant:"outlined",className:n.buttonSpacer,onClick:function(){o()},color:"primary",children:"\u5b8c\u6210"}),!p&&(0,j.jsx)(d.Z,{id:"download-button",onClick:function(){var e={};if(h)if(Array.isArray(h)){var n=h.map((function(e){return{url:e.url,access_key:e.accessKey,secret_key:e.secretKey,api:"s3v4",path:"auto"}}));e={console:(0,r.Z)(n)}}else e={console:[{url:h.url,access_key:h.accessKey,secret_key:h.secretKey,api:"s3v4",path:"auto"}]};!function(e,n){var i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(n)),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}("credentials.json",JSON.stringify((0,t.Z)({},e)))},endIcon:(0,j.jsx)(f._8,{}),variant:"contained",color:"primary",children:"\u4e0b\u8f7d"})]})]})})}))}}]);
//# sourceMappingURL=9322.922d8743.chunk.js.map