Files
object-browser/portal-ui/build/static/js/343.b753d8a6.chunk.js
2022-08-10 20:43:36 -07:00

2 lines
7.0 KiB
JavaScript

"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[343],{24065:function(e,t,n){n.r(t),n.d(t,{default:function(){return V}});var s=n(29439),o=n(1413),r=n(72791),a=n(60364),i=n(16871),c=n(11135),l=n(61889),u=n(81207),d=n(64554),h=n(38734),x=n(92983),f=n(21639),m=n(32291),Z=n(23814),p=n(25787),j=n(56028),v=n(21435),g=n(36151),w=n(40986),S=n(3579),y=n(20165),b=n(87995),C=n(25469),A=n(80184),P=(0,p.Z)((function(e){return(0,c.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},Z.ID),Z.DF),Z.bK),(0,Z.Bz)(e.spacing(4))))}))((function(e){var t=e.classes,n=e.open,o=e.closeModal,a=(0,C.TL)(),i=(0,r.useState)(""),c=(0,s.Z)(i,2),d=c[0],x=c[1],f=(0,r.useState)(""),m=(0,s.Z)(f,2),Z=m[0],p=m[1],P=(0,r.useState)(""),k=(0,s.Z)(P,2),I=k[0],N=k[1],F=(0,r.useState)(!1),T=(0,s.Z)(F,2),E=T[0],R=T[1],_=(0,r.useState)(!1),D=(0,s.Z)(_,2),M=D[0],O=D[1],L=localStorage.getItem("userLoggedIn")||"";return n?(0,A.jsxs)(j.Z,{title:"Change Password for ".concat(L),modalOpen:n,onClose:function(){p(""),N(""),x(""),o()},titleIcon:(0,A.jsx)(h.IaT,{}),children:[(0,A.jsx)("div",{children:"This will change your Console password. Please note your new password down, as it will be required to log into Console after this session."}),(0,A.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){if(e.preventDefault(),Z===I){if(Z.length<8)a((0,b.zb)({errorMessage:"Passwords must be at least 8 characters long",detailedError:""}));else if(!E){R(!0);var t={current_secret_key:d,new_secret_key:Z};u.Z.invoke("POST","/api/v1/account/change-password",t).then((function(){R(!1),p(""),N(""),x(""),o()})).catch((function(e){R(!1),p(""),N(""),x(""),a((0,b.zb)(e))}))}}else a((0,b.zb)({errorMessage:"New passwords don't match",detailedError:""}))}(e)},children:(0,A.jsxs)(l.ZP,{container:!0,children:[(0,A.jsxs)(l.ZP,{item:!0,xs:12,className:t.modalFormScrollable,children:[(0,A.jsx)(l.ZP,{item:!0,xs:12,className:t.formFieldRow,children:(0,A.jsx)(v.Z,{id:"current-password",name:"current-password",onChange:function(e){x(e.target.value)},label:"Current Password",type:M?"text":"password",value:d,overlayAction:function(){return O(!M)},overlayIcon:M?(0,A.jsx)(y.Z,{}):(0,A.jsx)(S.Z,{})})}),(0,A.jsx)(l.ZP,{item:!0,xs:12,className:t.formFieldRow,children:(0,A.jsx)(v.Z,{id:"new-password",name:"new-password",onChange:function(e){p(e.target.value)},label:"New Password",type:M?"text":"password",value:Z,overlayAction:function(){return O(!M)},overlayIcon:M?(0,A.jsx)(y.Z,{}):(0,A.jsx)(S.Z,{})})}),(0,A.jsx)(l.ZP,{item:!0,xs:12,className:t.formFieldRow,children:(0,A.jsx)(v.Z,{id:"re-new-password",name:"re-new-password",onChange:function(e){N(e.target.value)},label:"Type New Password Again",type:M?"text":"password",value:I,overlayAction:function(){return O(!M)},overlayIcon:M?(0,A.jsx)(y.Z,{}):(0,A.jsx)(S.Z,{})})})]}),(0,A.jsx)(l.ZP,{item:!0,xs:12,className:t.modalButtonBar,children:(0,A.jsx)(g.Z,{type:"submit",variant:"contained",color:"primary",disabled:E||!(d.length>0&&Z.length>0&&I.length>0),children:"Save"})}),E&&(0,A.jsx)(l.ZP,{item:!0,xs:12,children:(0,A.jsx)(w.Z,{})})]})})]}):null})),k=n(23804),I=n(74794),N=n(59114),F=n(75578),T=n(56087),E=n(38442),R=n(40603),_=n(58493),D=n(18303),M=n(14048),O=n(72455),L=n(46078),z=(0,F.Z)(r.lazy((function(){return n.e(3956).then(n.bind(n,23956))}))),B=(0,O.Z)((function(e){return(0,c.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},Z.OR),Z.qg),{},{searchField:(0,o.Z)((0,o.Z)({},Z.qg.searchField),{},{marginRight:"auto",maxWidth:380})},Z.VX),(0,Z.Bz)(e.spacing(4))))})),V=function(){var e=(0,C.TL)(),t=(0,i.s0)(),n=B(),o=(0,a.v9)(L.$4),c=(0,r.useState)([]),Z=(0,s.Z)(c,2),p=Z[0],j=Z[1],v=(0,r.useState)(!1),g=(0,s.Z)(v,2),w=g[0],S=g[1],y=(0,r.useState)(""),F=(0,s.Z)(y,2),O=F[0],V=F[1],q=(0,r.useState)(!1),K=(0,s.Z)(q,2),U=K[0],G=K[1],J=(0,r.useState)(null),W=(0,s.Z)(J,2),X=W[0],Y=W[1],$=(0,r.useState)(!1),H=(0,s.Z)($,2),Q=H[0],ee=H[1],te=(0,r.useState)([]),ne=(0,s.Z)(te,2),se=ne[0],oe=ne[1],re=(0,r.useState)(!1),ae=(0,s.Z)(re,2),ie=ae[0],ce=ae[1],le=(0,r.useState)(!1),ue=(0,s.Z)(le,2),de=ue[0],he=ue[1],xe=o&&o.includes("external-idp")||!1;(0,r.useEffect)((function(){fe()}),[]),(0,r.useEffect)((function(){w&&u.Z.invoke("GET","/api/v1/service-accounts").then((function(e){var t=e.sort(f.V2);S(!1),j(t)})).catch((function(t){e((0,b.Ih)(t)),S(!1)}))}),[w,S,j,e]);var fe=function(){S(!0)},me=[{type:"view",onClick:function(e){Y(e),he(!0)}},{type:"delete",onClick:function(e){Y(e),G(!0)}}],Ze=p.filter((function(e){return e.toLowerCase().includes(O.toLowerCase())}));return(0,A.jsxs)(r.Fragment,{children:[U&&(0,A.jsx)(z,{deleteOpen:U,selectedServiceAccount:X,closeDeleteModalAndRefresh:function(e){!function(e){G(!1),e&&fe()}(e)}}),ie&&(0,A.jsx)(D.Z,{deleteOpen:ie,selectedSAs:se,closeDeleteModalAndRefresh:function(t){ce(!1),t&&(e((0,b.y1)("Service accounts deleted successfully.")),oe([]),S(!0))}}),de&&(0,A.jsx)(M.Z,{open:de,selectedAccessKey:X,closeModalAndRefresh:function(){he(!1),S(!0)}}),(0,A.jsx)(P,{open:Q,closeModal:function(){return ee(!1)}}),(0,A.jsx)(m.Z,{label:"Service Accounts"}),(0,A.jsxs)(I.Z,{children:[(0,A.jsxs)(l.ZP,{item:!0,xs:12,className:n.actionsTray,children:[(0,A.jsx)(N.Z,{placeholder:"Search Service Accounts",onChange:V,overrideClass:n.searchField,value:O}),(0,A.jsxs)(d.Z,{sx:{display:"flex"},children:[" ",(0,A.jsx)(R.Z,{tooltip:"Delete Selected",onClick:function(){ce(!0)},text:"Delete Selected",icon:(0,A.jsx)(h.pJl,{}),color:"secondary",disabled:0===se.length,variant:"outlined"}),(0,A.jsx)(E.s,{scopes:[T.Ft.ADMIN_CREATE_USER],resource:T.C3,matchAll:!0,errorProps:{disabled:!0},children:(0,A.jsx)(R.Z,{onClick:function(){return ee(!0)},text:"Change Password",icon:(0,A.jsx)(h.tvm,{}),color:"primary",variant:"outlined",disabled:xe})}),(0,A.jsx)(R.Z,{onClick:function(e){t("".concat(T.gA.ACCOUNT_ADD))},text:"Create service account",icon:(0,A.jsx)(h.dtP,{}),color:"primary",variant:"contained"})]})]}),(0,A.jsx)(l.ZP,{item:!0,xs:12,className:n.tableBlock,children:(0,A.jsx)(x.Z,{isLoading:w,records:Ze,entityName:"Service Accounts",idField:"",columns:[{label:"Service Account",elementKey:""}],itemActions:me,selectedItems:se,onSelect:function(e){return(0,_._0)(e,oe,se)},onSelectAll:function(){se.length!==p.length?oe(p):oe([])}})}),(0,A.jsx)(l.ZP,{item:!0,xs:12,marginTop:"15px",children:(0,A.jsx)(k.Z,{title:"Learn more about SERVICE ACCOUNTS",iconComponent:(0,A.jsx)(h.frP,{}),help:(0,A.jsxs)(r.Fragment,{children:["MinIO service accounts are child identities of an authenticated MinIO user, including externally managed identities. Each service account inherits its privileges based on the policies attached to it\u2019s parent user or those groups in which the parent user has membership. Service accounts also support an optional inline policy which further restricts access to a subset of actions and resources available to the parent user.",(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),"You can learn more at our"," ",(0,A.jsx)("a",{href:"https://docs.min.io/minio/baremetal/security/minio-identity-management/user-management.html?ref=con#service-accounts",target:"_blank",rel:"noreferrer",children:"documentation"}),"."]})})})]})]})}}}]);
//# sourceMappingURL=343.b753d8a6.chunk.js.map