web-interface.assets.bb8c8232-9403.5b2c44c82fca60f630f3.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-9403"],{SfPIQIJE:(h,p,e)=>{e.d(p,{A:()=>P});var t=e("Z7aTuO5B"),l=e("J6y4/h8P"),d=e("rIl5IEuP"),i=e("ty2gyrHp"),u=e("IOI9nV80"),E=e("NV1/EHMi");const g=(0,l.default)(d.ButtonToolbar)`
margin-bottom: 10px;
`,v=(0,l.default)(d.Button)(({theme:a})=>(0,l.css)`
font-family: ${a.fonts.family.navigation};
font-size: ${a.fonts.size.navigation};
color: ${a.colors.variant.darker.default};
&:hover,
&:focus {
background: inherit;
text-decoration: none;
}
&:hover {
color: inherit;
${(0,E.WS)(a)}
}
&.active {
color: ${a.colors.global.textDefault};
${(0,E.at)(a)}
&:hover,
&:focus {
${(0,E.at)(a)}
}
`);v.displayName="Button";const P=({items:a})=>t.createElement(g,null,a.map(({path:m,title:R,permissions:D,exactPathMatch:T})=>m?t.createElement(u.Wj,{permissions:D!=null?D:[],key:m},t.createElement(i.m,{to:m,relativeActive:!T},t.createElement(v,{bsStyle:"link"},t.createElement(E.Ay,null,R)))):null))},RLbSMTbK:(h,p,e)=>{e.d(p,{A:()=>s});var t=e("Z7aTuO5B"),l=e("VPaD/Np4"),d=e.n(l),i=e("X8pjX0rJ"),u=e.n(i),E=e("ii0bleBb"),g=e.n(E),v=e("J6y4/h8P"),_=e("Lu0NTOJv"),P=e("rIl5IEuP"),a=e("IOI9nV80");const m=(0,v.default)(P.Button)`
margin-left: 15px;
`,R=v.default.div`
display: flex;
`,D=v.default.div`
display: flex;
align-items: center;
`,T=(0,v.default)(a.l6)`
flex: 1;
`,M=({label:n})=>t.createElement(D,null,n),B=(n,c,f)=>n.filter(O=>!c.includes(f(O))).toArray().map(O=>({label:O.name,value:O.name,role:O})),A=(n,c,f,O,C,y)=>{if(!n)return;const L=n.split(","),U=l.Set(u()(L.map(b=>c.find(S=>S.name===b))));if(U.size<=0){y(`Role assignment failed, because the roles ${n!=null?n:"(undefined)"} does not exist`);return}y(),C(!0),f(U).then(()=>{O(),C(!1)})},o=n=>{const c={page:1,perPage:0,query:""};_.A.loadRolesPaginated(c).then(n)},r=({assignedRolesIds:n,onSubmit:c,identifier:f,submitOnSelect:O})=>{const[C,y]=(0,t.useState)(),[L,U]=(0,t.useState)(),[b,S]=(0,t.useState)(!1),[I,N]=(0,t.useState)();(0,t.useEffect)(()=>o(y),[]);const K=W=>{O&&A(W,C.list,c,U,S,N),U(W)};if(!C)return t.createElement(a.y$,null);const F=()=>A(L,C.list,c,U,S,N),$=B(C.list,n,f);return t.createElement("div",null,t.createElement(R,null,t.createElement(T,{inputProps:{"aria-label":"Search for roles"},onChange:K,optionRenderer:M,options:$,placeholder:"Search for roles",multi:!0,value:L}),!O&&t.createElement(m,{bsStyle:"success",onClick:F,disabled:b||!L,title:"Assign Role",type:"button"},"Assign Role")),t.createElement(a.$p,{runtimeError:!0,onClose:N},I))};r.defaultProps={identifier:n=>n.id,submitOnSelect:!1},r.propTypes={identifier:g().func,onSubmit:g().func.isRequired,submitOnSelect:g().bool};const s=r},fdUTUHoJ:(h,p,e)=>{e.d(p,{A:()=>i});var t=e("Z7aTuO5B"),l=e("IOI9nV80");const i=()=>t.createElement(l.o$,{label:"E-Mail Address",name:"email",maxLength:254,type:"email",required:!0,help:"The user's email address."})},ob0PYlhL:(h,p,e)=>{e.d(p,{A:()=>i});var t=e("Z7aTuO5B"),l=e("IOI9nV80");const i=()=>t.createElement(l.o$,{label:"First Name",name:"first_name",maxLength:200,required:!0,help:"The user's first name."})},D4RgEuos:(h,p,e)=>{e.d(p,{A:()=>i});var t=e("Z7aTuO5B"),l=e("IOI9nV80");const i=()=>t.createElement(l.o$,{label:"Last Name",name:"last_name",maxLength:200,required:!0,help:"The user's last name."})},PQfI17l6:(h,p,e)=>{e.d(p,{Ay:()=>g,P8:()=>u});var t=e("Z7aTuO5B"),l=e("IOI9nV80"),d=e("rIl5IEuP");const i=6,u=(v,_,P)=>{const a={...v};return _&&_.lengtht.createElement(d.Input,{id:"password-field",label:"Password",help:`Passwords must be at least ${i} characters long. We recommend using a strong password.`,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},t.createElement(d.Row,{className:"no-bm"},t.createElement(d.Col,{sm:6},t.createElement(l.jF,{name:"password",id:"password",maxLength:100,type:"password",placeholder:"Password",required:!0,formGroupClassName:"form-group no-bm",wrapperClassName:"col-xs-12",minLength:i})),t.createElement(d.Col,{sm:6},t.createElement(l.jF,{name:"password_repeat",id:"password_repeat",maxLength:100,type:"password",placeholder:"Repeat password",formGroupClassName:"form-group no-bm",required:!0,wrapperClassName:"col-xs-12",minLength:i}))));E.defaultProps={passwordRef:void 0,passwordRepeatRef:void 0};const g=E},"6cfBHc3J":(h,p,e)=>{e.d(p,{A:()=>E});var t=e("Z7aTuO5B"),l=e("UiXZqrDE"),d=e("rIl5IEuP"),i=e("S6FuRS7B");const E=()=>{const[g,v]=(0,t.useState)(!1);return t.createElement(l.Field,{name:"service_account"},({field:{name:_,value:P,onChange:a}})=>{const m=T=>{(0,i.yG)(T.target)?v(!0):a(T)},R=()=>{a({target:{name:_,value:!0}}),v(!1)},D=()=>{a({target:{name:_,value:!1}}),v(!1)};return t.createElement(t.Fragment,null,t.createElement(d.Input,{id:"service-account-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Service Account"},t.createElement(d.Input,{label:"User is a Service Account",id:"service_account",type:"checkbox",wrapperClassName:"col-sm-9",name:"service_account",checked:P!=null?P:!1,help:"When checked, the user becomes a Service Account and will be unable to log into the web interface and edit their settings. (e.g., API tokens)",onChange:T=>m(T)})),t.createElement(d.BootstrapModalConfirm,{showModal:g,title:"Are you sure?",onConfirm:R,onCancel:D},"Changing this user to a Service Account prevents the user from logging into the web interface and editing their settings. (e.g., API tokens) Do you wish to proceed?"))})}},tgKevaL8:(h,p,e)=>{e.d(p,{A:()=>r});var t=e("Z7aTuO5B"),l=e("UiXZqrDE"),d=e("ii0bleBb"),i=e.n(d),u=e("rIl5IEuP"),E=e("J6y4/h8P"),g=e("IOI9nV80");const v=24*60*60*1e3,_=60*60*1e3,P=60*1e3,a=1e3,m=(0,E.default)(g.l6)`
width: 150px;
`,R=[{value:`${a}`,label:"Seconds"},{value:`${P}`,label:"Minutes"},{value:`${_}`,label:"Hours"},{value:`${v}`,label:"Days"}],T=s=>t.createElement(m,{...s,inputProps:{"aria-label":"Timeout unit"},options:R}),M=s=>s===0?a:s%v===0?v:s%_===0?_:s%P===0?P:a,B=({value:s,onChange:n})=>{const[c,f]=(0,t.useState)(s===-1),[O,C]=(0,t.useState)(M(s)),[y,L]=(0,t.useState)(s?Math.floor(s/Number(O)):0),U=I=>{f(I.target.checked),n&&I.target.checked&&n(-1)},b=I=>{L(Number(I.target.value)),n&&n(Number(I.target.value)*Number(O))},S=I=>{C(I),n&&n(y*Number(I))};return t.createElement(u.Input,{id:"timeout-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Sessions Timeout"},t.createElement(u.Row,{className:"no-bm"},t.createElement(u.Col,{xs:12},t.createElement(u.Alert,{bsStyle:"info",title:"Changing the session timeout"},"Changing the timeout setting for sessions will log the user out of Graylog and will invalidate all their current sessions. If you are changing the setting for your own user, you will be logged out at the moment of saving the setting. In that case, make sure to save any pending changes before changing the timeout."))),t.createElement(t.Fragment,null,t.createElement(u.Input,{type:"checkbox",id:"session-timeout-never",name:"session_timeout_never",label:"Sessions do not time out",help:"When checked, sessions never time out due to inactivity.",formGroupClassName:"no-bm",onChange:U,checked:c}),t.createElement("div",{className:"clearfix"},t.createElement(u.Col,{xs:2},t.createElement(u.Input,{type:"number",id:"timeout",placeholder:"Timeout amount",name:"timeout",min:1,formGroupClassName:"form-group no-bm",disabled:c,value:y,onChange:b})),t.createElement(u.Col,{xs:4},t.createElement(T,{disabled:c,value:String(O),onChange:S})),t.createElement(u.Row,{className:"no-bm"},t.createElement(u.Col,{xs:12},t.createElement(u.HelpBlock,null,"Session automatically end after this amount of time, unless they are actively used."))))))};B.propTypes={value:i().number,onChange:i().func},B.defaultProps={value:_,onChange:()=>{}};const A=B,r=()=>t.createElement(l.Field,{name:"session_timeout_ms"},({field:{name:s,value:n,onChange:c}})=>t.createElement(A,{value:n,onChange:f=>c({target:{name:s,value:f}})}))},"rLQ+VmDx":(h,p,e)=>{e.d(p,{A:()=>E});var t=e("Z7aTuO5B"),l=e("UiXZqrDE"),d=e("rIl5IEuP"),i=e("IOI9nV80");const E=()=>t.createElement(l.FastField,{name:"timezone"},({field:{name:g,value:v,onChange:_}})=>t.createElement(d.Input,{id:"timezone-select",label:"Time Zone",help:"Choose your local time zone or leave it as it is to use the system's default.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},t.createElement(i.o4,{className:"timezone-select",value:v,name:"timezone",onChange:P=>_({target:{name:g,value:P}})})))},WqhT36Vr:(h,p,e)=>{e.d(p,{A:()=>E});var t=e("Z7aTuO5B"),l=e("d4kzUuQm"),d=e("SfPIQIJE"),i=e("rIl5IEuP");const E=()=>{const g=[{title:"Users Overview",path:l.Ay.SYSTEM.USERS.OVERVIEW,permissions:"users:list"},{title:"Teams Overview",path:l.Ay.getPluginRoute("SYSTEM_TEAMS"),permissions:"teams:list"}];return t.createElement(i.Row,null,t.createElement(d.A,{items:g}))}},Lu0NTOJv:(h,p,e)=>{e.d(p,{A:()=>P});var t=e("KOKBnITH"),l=e("lDGobrly");const d=(0,l.A)({action:t.v.load,error:(a,m)=>({message:`Loading role with id "${m}" failed with status: ${a}`}),notFoundRedirect:!0}),i=(0,l.A)({action:t.v.delete,success:(a,m)=>({message:`Role "${m}" was deleted successfully`}),error:(a,m,R)=>({message:`Deleting role "${R}" failed with status: ${a}`})}),u=(0,l.A)({action:t.v.addMembers,success:(a,m)=>({message:`Users:"${m.join(", ")}" were assigned successfully`}),error:(a,m,R)=>({message:`Assigning users "${R.join(", ")}" failed with status: ${a}`})}),E=(0,l.A)({action:t.v.removeMember,success:(a,m)=>({message:`User "${m}" was unassigned successfully`}),error:(a,m,R)=>({message:`Unassign user "${R}" failed with status: ${a}`})}),g=(0,l.A)({action:t.v.loadUsersForRole,error:(a,m,R)=>({message:`Loading users for role "${R}" failed with status: ${a}`})}),v=(0,l.A)({action:t.v.loadRolesForUser,error:(a,m)=>({message:`Loading roles for user "${m}" failed with status: ${a}`})}),_=(0,l.A)({action:t.v.loadRolesPaginated,error:a=>({message:`Loading roles failed with status: ${a}`})}),P={load:d,delete:i,addMembers:u,removeMember:E,loadUsersForRole:g,loadRolesForUser:v,loadRolesPaginated:_}},MLDs3jaY:(h,p,e)=>{e.d(p,{A:()=>E});var t=e("Z7aTuO5B"),l=e("ibdPvtmL"),d=e("8fnsnG21");const i="org.graylog2.users.UserConfiguration",E=()=>{const g=(0,d.P)(l.H,_=>_==null?void 0:_.configuration[i]),v=(g==null?void 0:g.enable_global_session_timeout)||!1;return(0,t.useEffect)(()=>(l.t.list(i),()=>{}),[]),v}},KOKBnITH:(h,p,e)=>{e.d(p,{v:()=>m});var t=e("JnTtTRmZ"),l=e.n(t),d=e("VPaD/Np4"),i=e("eFxcQyPT"),u=e("U1Iufsob"),E=e("MdYBRjRJ"),g=e("IA3Ku5lS"),v=e("gyRmhZSW");class _{constructor(o,r,s,n,c){this._value={id:o,name:r,description:s,permissions:n,readOnly:c}}get id(){return this._value.id}get name(){return this._value.name}get description(){return this._value.description}get permissions(){return this._value.permissions}get readOnly(){return this._value.readOnly}toBuilder(){const{id:o,name:r,description:s,permissions:n,readOnly:c}=this._value;return new P(d.Map({id:o,name:r,description:s,permissions:n,readOnly:c}))}static create(o,r,s,n,c){return new _(o,r,s,n,c)}toJSON(){const{id:o,name:r,description:s,permissions:n,readOnly:c}=this._value;return{id:o,name:r,description:s,permissions:n,read_only:c}}static fromJSON(o){const{id:r,name:s,description:n,permissions:c,read_only:f}=o;return _.create(r,s,n,c,f)}static builder(){return new P}}class P{constructor(o=d.Map()){this.value=o}id(o){return new P(this.value.set("id",o))}name(o){return new P(this.value.set("name",o))}description(o){return new P(this.value.set("description",o))}permissions(o){return new P(this.value.set("permissions",o))}readOnly(o){return new P(this.value.set("readOnly",o))}build(){const{id:o,name:r,description:s,permissions:n,readOnly:c}=this.value.toObject();return new _(o,r,s,n,c)}}const m=(0,g.rN)("AuthzRoles",()=>l().createActions({load:{asyncResult:!0},delete:{asyncResult:!0},addMembers:{asyncResult:!0},removeMember:{asyncResult:!0},loadUsersForRole:{asyncResult:!0},loadRolesForUser:{asyncResult:!0},loadRolesPaginated:{asyncResult:!0}}));var R=e("nmSm+aR9");const D=({count:A,total:o,page:r,per_page:s,query:n,roles:c=[],context:f={users:void 0}})=>({list:d.List(c.map(O=>_.fromJSON(O))),pagination:{query:n,page:r,perPage:s,count:A,total:o},context:f}),T=({count:A,total:o,page:r,per_page:s,query:n,users:c})=>({list:d.List(c.map(f=>R.A.fromJSON(f))),pagination:{page:r,perPage:s,query:n,count:A,total:o}}),M=(A,o=[])=>{const r=o.map(s=>encodeURIComponent(s));return A(...r).url},B=(0,g.Bv)("AuthzRoles",()=>l().createStore({listenables:[m],load(A){const o=(0,E.H3)(M(u.A.AuthzRolesController.load,[A])),r=(0,i.Ay)("GET",o).then(_.fromJSON);return m.load.promise(r),r},delete(A){const o=(0,E.H3)(M(u.A.AuthzRolesController.delete,[A])),r=(0,i.Ay)("DELETE",o);return m.delete.promise(r),r},addMembers(A,o){const r=M(u.A.AuthzRolesController.addMembers,[A]),s=(0,i.Ay)("PUT",(0,E.H3)(r),o.toArray());return m.addMembers.promise(s),s},removeMember(A,o){const r=M(u.A.AuthzRolesController.removeMember,[A,o]),s=(0,i.Ay)("DELETE",(0,E.H3)(r));return m.removeMember.promise(s),s},loadUsersForRole(A,o,{page:r,perPage:s,query:n}){const c=M(u.A.AuthzRolesController.loadUsersForRole,[A]),f=(0,v.A)(c,r,s,n),O=(0,i.Ay)("GET",(0,E.H3)(f)).then(T);return m.loadUsersForRole.promise(O),O},loadRolesForUser(A,{page:o,perPage:r,query:s}){const n=M(u.A.AuthzRolesController.loadRolesForUser,[A]),c=(0,v.A)(n,o,r,s),f=(0,i.Ay)("GET",(0,E.H3)(c)).then(D);return m.loadRolesForUser.promise(f),f},loadRolesPaginated({page:A,perPage:o,query:r}){const s=M(u.A.AuthzRolesController.list),n=(0,v.A)(s,A,o,r),c=(0,i.Ay)("GET",(0,E.H3)(n)).then(D);return m.loadRolesPaginated.promise(c),c}}))}}]);})();
//# sourceMappingURL=bb8c8232-9403.5b2c44c82fca60f630f3.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy