web-interface.assets.bb8c8232-6368.70a35aa295fcb97f3029.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-6368"],{"Yul/IdmX":(ve,C,t)=>{t.r(C),t.d(C,{default:()=>se});var e=t("Z7aTuO5B"),g=t("ty2gyrHp"),S=t("d4kzUuQm"),P=t("E+CaPsQD"),o=t("rIl5IEuP"),d=t("IOI9nV80"),b=t("J6y4/h8P"),A=t("VPaD/Np4"),R=t("UiXZqrDE"),T=t("QL8i6bcz"),F=t("RCNj0OY4"),N=t("vMorKP/N"),I=t("92lPlKXC"),O=t("a/tXGb/M"),M=t("RLbSMTbK"),Y=t("cSDA0Pof"),L=t("eZ5nxjAy"),D=t("/7OuCFNo"),V=t("MdYBRjRJ"),B=t("8OvTct/Z"),x=t("0t7Ye+61"),z=t("v4GbOr/o"),Q=t("rLQ+VmDx"),W=t("tgKevaL8"),j=t("ob0PYlhL"),H=t("D4RgEuos"),J=t("fdUTUHoJ"),p=t("PQfI17l6");const $=()=>e.createElement(d.o$,{label:"Username",name:"username",required:!0,help:"Select a unique user name used to log in with."});var K=t("6cfBHc3J"),U=t("QBkUz07U"),X=t("MLDs3jaY");const Z=(0,b.default)(d.WY)`
margin-bottom: 20px;
.read-only-value-col {
padding-top: 0;
}
`,E=F.A.isCloud(),s=E?T.d.exports("cloud")[0].oktaUserForm:null,w=(r,l,u,i)=>{let a={...l,roles:u.toJS(),permissions:[]};if(delete a.password_repeat,E&&s){const{onCreate:m}=s;a=m(a)}else a.username=a.username.trim();return i(null),I.A.create(a).then(()=>{r.push(S.Ay.SYSTEM.USERS.OVERVIEW)},m=>i(m))},k=async(r,l)=>{const u={...r};try{await Y.M.loadByUsername(l),u.username="Username is already taken"}catch{}return u},q=(0,L.A)(k,600),_=async r=>{let l={};const{password:u,password_repeat:i,username:a}=r;if(a&&(l=await q(l,a)),E&&s){const{validations:{password:m}}=s;l=m(l,u,i)}else l=(0,p.P8)(l,u,i);return l},ee=()=>{if(E&&s){const{fields:{password:r}}=s;return e.createElement(r,null)}return e.createElement(p.Ay,null)},te=()=>{if(E&&s){const{fields:{username:r}}=s;return r&&e.createElement(r,null)}return e.createElement($,null)},le=()=>{if(E&&s){const{fields:{email:r}}=s;return r&&e.createElement(r,null)}return e.createElement(J.A,null)},ne=()=>{const r={name:"Reader",description:"Grants basic permissions for every Graylog user (built-in)",id:""},[l,u]=(0,e.useState)(N.A.empty().toBuilder().roles(A.Set([r.name])).build()),[i,a]=(0,e.useState)(),[m,y]=(0,e.useState)(A.Set([r])),h=(0,D.A)(),{pathname:oe}=(0,x.A)(),ae=(0,B.A)(),me=(0,X.A)(),ue=n=>{y(m.union(n));const v=n.map(c=>c.name);return Promise.resolve(u(l.toBuilder().roles(l.roles.union(v)).build()))},ie=n=>{y(m.remove(n)),u(l.toBuilder().roles(l.roles.remove(n==null?void 0:n.name)).build())},ce=()=>h.push(S.Ay.SYSTEM.USERS.OVERVIEW),G=m.size>0&&m.filter(n=>n.name==="Reader"||n.name==="Admin"),de=n=>{var v,c;if(E&&s){const{extractSubmitError:f}=s;return f(n)}return(c=(v=n==null?void 0:n.additional)==null?void 0:v.res)==null?void 0:c.text},Ee=n=>{w(h,n,l.roles,a),ae(z.g.USERS.USER_CREATED,{app_pathname:(0,V.i)(oe),app_action_value:"user-create-form"})};return e.createElement(o.Row,{className:"content"},e.createElement(o.Col,{lg:8},e.createElement(R.Formik,{onSubmit:Ee,validate:_,initialValues:{}},({isSubmitting:n,isValid:v})=>e.createElement(R.Form,{className:"form form-horizontal"},e.createElement("div",null,e.createElement(U.$,null,"Profile"),e.createElement(j.A,null),e.createElement(H.A,null),e.createElement(te,null),e.createElement(le,null)),e.createElement("div",null,e.createElement(U.$,null,"Settings"),me?e.createElement(Z,{label:"Sessions Timeout",value:e.createElement(d.EO,null,"User session timeout is not editable because the",e.createElement(d.Wj,{permissions:["clusterconfigentry:read"]},e.createElement(g.N,{to:S.Ay.SYSTEM.CONFIGURATIONS},"global session timeout"))," is enabled.")}):e.createElement(W.A,null),e.createElement(Q.A,null),e.createElement(K.A,null)),e.createElement("div",null,e.createElement(U.$,null,"Roles"),e.createElement(o.Input,{id:"roles-selector-input",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Assign Roles"},e.createElement(M.A,{onSubmit:ue,assignedRolesIds:l.roles,identifier:c=>c.name,submitOnSelect:!0})),e.createElement(o.Input,{id:"selected-roles-overview",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Selected Roles"},e.createElement(e.Fragment,null,m.map(c=>e.createElement(O.A,{item:c,onDeleteItem:f=>ie(f),key:c.id})),!G&&e.createElement(o.Alert,{bsStyle:"danger"},"You need to select at least one of the ",e.createElement("em",null,"Reader")," or ",e.createElement("em",null,"Admin")," roles.")))),e.createElement("div",null,e.createElement(U.$,null,"Password"),e.createElement(ee,null)),i&&e.createElement(o.Row,null,e.createElement(o.Col,{xs:9,xsOffset:3},e.createElement(o.Alert,{bsStyle:"danger",title:"Failed to create user"},de(i)))),e.createElement(o.Row,null,e.createElement(o.Col,{md:9,mdOffset:3},e.createElement(d.hP,{disabledSubmit:!v||!G,submitButtonText:"Create user",submitLoadingText:"Creating user...",isSubmitting:n,isAsyncSubmit:!0,onCancel:ce})))))))};var re=t("WqhT36Vr");const se=()=>e.createElement(d.Qc,{title:"Create New User"},e.createElement(re.A,null),e.createElement(d.zY,{title:"Create New User",actions:e.createElement(g.m,{to:S.Ay.SYSTEM.USERS.CREATE},e.createElement(o.Button,{bsStyle:"success"},"Create user")),documentationLink:{title:"Permissions documentation",path:P.A.PAGES.USERS_ROLES}},e.createElement("span",null,"Use this page to create new Graylog users. The users and their permissions created here are not limited to the web interface but valid and required for the REST APIs of your Graylog server nodes, too.")),e.createElement(ne,null))}}]);})();
//# sourceMappingURL=bb8c8232-6368.70a35aa295fcb97f3029.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy