web-interface.assets.1255d548-8890.3145c797c153dced9084.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["1255d548-8890"],{"dan3/ZI+":(D,E,t)=>{t.d(E,{Z:()=>i,_:()=>e._});var e=t("xfUIbHjs");const i=e.Z},RLbSMTbK:(D,E,t)=>{t.d(E,{Z:()=>U});var e=t("Z7aTuO5B"),i=t("VPaD/Np4"),d=t.n(i),m=t("X8pjX0rJ"),u=t.n(m),a=t("ii0bleBb"),f=t.n(a),s=t("J6y4/h8P"),r=t("Lu0NTOJv"),O=t("uZqmR+ju"),g=t("/GOzvPf6");const T=(0,s.default)(O.Button)`
margin-left: 15px;
`,I=s.default.div`
display: flex;
`,S=s.default.div`
display: flex;
align-items: center;
`,P=(0,s.default)(g.Ph)`
flex: 1;
`,X=({label:v})=>e.createElement(S,null,v),x=(v,b,B)=>v.filter(R=>!b.includes(B(R))).toArray().map(R=>({label:R.name,value:R.name,role:R})),y=(v,b,B,R,Z,G)=>{if(!v)return;const z=v.split(","),W=i.Set(u()(z.map(V=>b.find(K=>K.name===V))));if(W.size<=0){G(`Role assignment failed, because the roles ${v!=null?v:"(undefined)"} does not exist`);return}G(),Z(!0),B(W).then(()=>{R(),Z(!1)})},Q=v=>{const b={page:1,perPage:0,query:""};r.Z.loadRolesPaginated(b).then(v)},$=({assignedRolesIds:v,onSubmit:b,identifier:B,submitOnSelect:R})=>{const[Z,G]=(0,e.useState)(),[z,W]=(0,e.useState)(),[V,K]=(0,e.useState)(!1),[L,Y]=(0,e.useState)();(0,e.useEffect)(()=>Q(G),[]);const se=re=>{R&&y(re,Z.list,b,W,K,Y),W(re)};if(!Z)return e.createElement(g.$j,null);const oe=()=>y(z,Z.list,b,W,K,Y),le=x(Z.list,v,B);return e.createElement("div",null,e.createElement(I,null,e.createElement(P,{inputProps:{"aria-label":"Search for roles"},onChange:se,optionRenderer:X,options:le,placeholder:"Search for roles",multi:!0,value:z}),!R&&e.createElement(T,{bsStyle:"success",onClick:oe,disabled:V||!z,title:"Assign Role",type:"button"},"Assign Role")),e.createElement(g.hW,{runtimeError:!0,onClose:Y},L))};$.defaultProps={identifier:v=>v.id,submitOnSelect:!1},$.propTypes={identifier:f().func,onSubmit:f().func.isRequired,submitOnSelect:f().bool};const U=$},BmExNlEo:(D,E,t)=>{t.d(E,{Z:()=>s});var e=t("DUKaTDO2"),i=t("jAGDuYSC"),d=t("pUKP3+Pg");const u=r=>{if(r)return r.entrySeq().flatMap(([O,g])=>g.map(T=>`${O}:${T}`)).toArray()},a={pagination:{total:0},elements:[],attributes:[]},s=(r,{enabled:O}={enabled:!0})=>{const{data:g,refetch:T,isInitialLoading:I}=(0,e.useQuery)(["streams","overview",r],()=>d.ZP.searchPaginated(r.page,r.pageSize,r.query,{sort:r==null?void 0:r.sort.attributeId,order:r==null?void 0:r.sort.direction,filters:u(r.filters)}),{onError:S=>{i.Z.error(`Loading streams failed with status: ${S}`,"Could not load streams")},keepPreviousData:!0,enabled:O});return{data:g!=null?g:a,refetch:T,isInitialLoading:I}}},P7lYJiUi:(D,E,t)=>{t.d(E,{Z:()=>f});var e=t("Z7aTuO5B"),i=t("E+CaPsQD"),d=t("7dh0vSOR"),m=t("uZqmR+ju"),u=t("/GOzvPf6");const f=()=>e.createElement(m.Row,{className:"content"},e.createElement(m.Col,{xs:12},e.createElement(m.Alert,{bsStyle:"info",title:"Granting Permissions"},"With Graylog 4.0, we've updated the permissions system. Granting permissions for an entity like streams and dashboards is no longer part of the user edit page. It can now be configured using the ",e.createElement("b",null,e.createElement(u.JO,{name:"user-plus"})," Share")," button of an entity. You can find the button e.g. on the entities overview page. Learn more in the ",e.createElement(d.Z,{page:i.Z.PAGES.PERMISSIONS,text:"documentation"}),".")))},OC6EEUte:(D,E,t)=>{t.d(E,{Z:()=>a});var e=t("Z7aTuO5B"),i=t("/GOzvPf6"),d=t("uZqmR+ju");const m=e.createElement(d.Popover,{id:"role-search-query-help",title:"Search Syntax Help"},e.createElement("p",null,e.createElement("strong",null,"Available search fields")),e.createElement(d.Table,{condensed:!0},e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Field"),e.createElement("th",null,"Description"))),e.createElement("tbody",null,e.createElement("tr",null,e.createElement("td",null,"name"),e.createElement("td",null,"Role name")),e.createElement("tr",null,e.createElement("td",null,"description"),e.createElement("td",null,"Description of the Role")))),e.createElement("p",null,e.createElement("strong",null,"Examples")),e.createElement("p",null,"Find roles with a description containing creator:",e.createElement("br",null),e.createElement("kbd",null,"description:creator"),e.createElement("br",null))),a=()=>e.createElement(i.Ox,{trigger:"click",rootClose:!0,placement:"right",overlay:m},e.createElement(d.Button,{bsStyle:"link"},e.createElement(i.JO,{name:"question-circle"})))},fdUTUHoJ:(D,E,t)=>{t.d(E,{Z:()=>m});var e=t("Z7aTuO5B"),i=t("/GOzvPf6");const m=()=>e.createElement(i.Fe,{label:"E-Mail Address",name:"email",maxLength:254,type:"email",required:!0,help:"The user's email address."})},ob0PYlhL:(D,E,t)=>{t.d(E,{Z:()=>m});var e=t("Z7aTuO5B"),i=t("/GOzvPf6");const m=()=>e.createElement(i.Fe,{label:"First Name",name:"first_name",maxLength:200,required:!0,help:"The user's first name."})},D4RgEuos:(D,E,t)=>{t.d(E,{Z:()=>m});var e=t("Z7aTuO5B"),i=t("/GOzvPf6");const m=()=>e.createElement(i.Fe,{label:"Last Name",name:"last_name",maxLength:200,required:!0,help:"The user's last name."})},PQfI17l6:(D,E,t)=>{t.d(E,{ZP:()=>f,jy:()=>u});var e=t("Z7aTuO5B"),i=t("/GOzvPf6"),d=t("uZqmR+ju");const m=6,u=(s,r,O)=>{const g={...s};return r&&r.lengthe.createElement(d.Input,{id:"password-field",label:"Password",help:`Passwords must be at least ${m} characters long. We recommend using a strong password.`,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},e.createElement(d.Row,{className:"no-bm"},e.createElement(d.Col,{sm:6},e.createElement(i.jc,{name:"password",id:"password",maxLength:100,type:"password",placeholder:"Password",required:!0,formGroupClassName:"form-group no-bm",wrapperClassName:"col-xs-12",minLength:m})),e.createElement(d.Col,{sm:6},e.createElement(i.jc,{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:m}))));a.defaultProps={passwordRef:void 0,passwordRepeatRef:void 0};const f=a},"6cfBHc3J":(D,E,t)=>{t.d(E,{Z:()=>a});var e=t("Z7aTuO5B"),i=t("UiXZqrDE"),d=t("uZqmR+ju"),m=t("S6FuRS7B");const a=()=>{const[f,s]=(0,e.useState)(!1);return e.createElement(i.Field,{name:"service_account"},({field:{name:r,value:O,onChange:g}})=>{const T=P=>{(0,m.n6)(P.target)?s(!0):g(P)},I=()=>{g({target:{name:r,value:!0}}),s(!1)},S=()=>{g({target:{name:r,value:!1}}),s(!1)};return e.createElement(e.Fragment,null,e.createElement(d.Input,{id:"service-account-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Service Account"},e.createElement(d.Input,{label:"User is a Service Account",id:"service_account",type:"checkbox",wrapperClassName:"col-sm-9",name:"service_account",checked:O!=null?O:!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:P=>T(P)})),e.createElement(d.BootstrapModalConfirm,{showModal:f,title:"Are you sure?",onConfirm:I,onCancel:S},"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:(D,E,t)=>{t.d(E,{Z:()=>$});var e=t("Z7aTuO5B"),i=t("UiXZqrDE"),d=t("ii0bleBb"),m=t.n(d),u=t("uZqmR+ju"),a=t("J6y4/h8P"),f=t("/GOzvPf6");const s=24*60*60*1e3,r=60*60*1e3,O=60*1e3,g=1e3,T=(0,a.default)(f.Ph)`
width: 150px;
`,I=[{value:`${g}`,label:"Seconds"},{value:`${O}`,label:"Minutes"},{value:`${r}`,label:"Hours"},{value:`${s}`,label:"Days"}],P=U=>e.createElement(T,{...U,inputProps:{"aria-label":"Timeout unit"},options:I}),X=U=>U===0?g:U%s===0?s:U%r===0?r:U%O===0?O:g,x=({value:U,onChange:v})=>{const[b,B]=(0,e.useState)(U===-1),[R,Z]=(0,e.useState)(X(U)),[G,z]=(0,e.useState)(U?Math.floor(U/Number(R)):0),W=L=>{B(L.target.checked),v&&L.target.checked&&v(-1)},V=L=>{z(Number(L.target.value)),v&&v(Number(L.target.value)*Number(R))},K=L=>{Z(L),v&&v(G*Number(L))};return e.createElement(u.Input,{id:"timeout-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Sessions Timeout"},e.createElement(u.Row,{className:"no-bm"},e.createElement(u.Col,{xs:12},e.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."))),e.createElement(e.Fragment,null,e.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:W,checked:b}),e.createElement("div",{className:"clearfix"},e.createElement(u.Col,{xs:2},e.createElement(u.Input,{type:"number",id:"timeout",placeholder:"Timeout amount",name:"timeout",min:1,formGroupClassName:"form-group no-bm",disabled:b,value:G,onChange:V})),e.createElement(u.Col,{xs:4},e.createElement(P,{disabled:b,value:String(R),onChange:K})),e.createElement(u.Row,{className:"no-bm"},e.createElement(u.Col,{xs:12},e.createElement(u.HelpBlock,null,"Session automatically end after this amount of time, unless they are actively used."))))))};x.propTypes={value:m().number,onChange:m().func},x.defaultProps={value:r,onChange:()=>{}};const y=x,$=()=>e.createElement(i.Field,{name:"session_timeout_ms"},({field:{name:U,value:v,onChange:b}})=>e.createElement(y,{value:v,onChange:B=>b({target:{name:U,value:B}})}))},"rLQ+VmDx":(D,E,t)=>{t.d(E,{Z:()=>a});var e=t("Z7aTuO5B"),i=t("UiXZqrDE"),d=t("uZqmR+ju"),m=t("/GOzvPf6");const a=()=>e.createElement(i.FastField,{name:"timezone"},({field:{name:f,value:s,onChange:r}})=>e.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"},e.createElement(m.Cc,{className:"timezone-select",value:s,name:"timezone",onChange:O=>r({target:{name:f,value:O}})})))},ynz3ptM5:(D,E,t)=>{t.d(E,{Z:()=>a});var e=t("Z7aTuO5B"),i=t("ty2gyrHp"),d=t("d4kzUuQm"),m=t("uZqmR+ju");const a=({userId:f,userIsReadOnly:s})=>e.createElement(m.ButtonToolbar,null,e.createElement(i.J,{to:d.ZP.SYSTEM.USERS.show(f)},e.createElement(m.Button,{bsStyle:"success"},"View Details")),!s&&e.createElement(i.J,{to:d.ZP.SYSTEM.USERS.edit(f)},e.createElement(m.Button,{bsStyle:"success"},"Edit User")),e.createElement(i.J,{to:d.ZP.SYSTEM.USERS.TOKENS.edit(f)},e.createElement(m.Button,{bsStyle:"success"},"Edit Tokens")))},"5tMkU7QT":(D,E,t)=>{t.d(E,{Z:()=>g});var e=t("Z7aTuO5B"),i=t("UiXZqrDE"),d=t("2dBXfbRP"),m=t("QBkUz07U"),u=t("/GOzvPf6"),a=t("uZqmR+ju"),f=t("2aaiYHqX"),s=t("RCNj0OY4"),r=t("Vmfu2XtV");const g=()=>{const[T,I]=(0,e.useState)(void 0),{enabled:S}=s.Z.telemetry()||{},P=(0,d.U0)();if((0,e.useEffect)(()=>{f.W.get().then(y=>{I(y)})},[]),(0,e.useEffect)(()=>{S&&(T!=null&&T.telemetry_enabled)&&(P!=null&&P.has_opted_out_capturing())&&P.opt_in_capturing()},[S,P,T==null?void 0:T.telemetry_enabled]),!T)return e.createElement(u.$j,null);const X=y=>{P&&S&&!y.telemetry_enabled&&(P.capture("$opt_out"),P.opt_out_capturing())},x=(y,{setSubmitting:Q})=>{X(y),f.W.update(y).then(()=>{Q(!1),window.location.reload()})};return e.createElement(m.Z,{title:"Telemetry"},e.createElement(r.Z,null),e.createElement(i.Formik,{onSubmit:x,initialValues:T},({isSubmitting:y,isValid:Q})=>e.createElement(i.Form,{className:"form form-horizontal"},e.createElement(a.Input,{id:"timeout-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Enable telemetry"},e.createElement(u.Fe,{label:"enabled",name:"telemetry_enabled",disabled:!S,formGroupClassName:"form-group no-bm",type:"checkbox"})),e.createElement(a.Row,{className:"no-bm"},e.createElement(a.Col,{xs:12},e.createElement("div",{className:"pull-right"},e.createElement(a.Button,{bsStyle:"success",disabled:y||!Q||!S,title:"Update Preferences",type:"submit"},"Update telemetry")))))))}},M4KelNzO:(D,E,t)=>{t.r(E),t.d(E,{default:()=>Ye});var e=t("Z7aTuO5B"),i=t("cSDA0Pof"),d=t("c9JM82dZ"),m=t("E+CaPsQD"),u=t("92lPlKXC"),a=t("/GOzvPf6"),f=t("q2j1bVbz"),s=t("uZqmR+ju"),r=t("QBkUz07U"),O=t("J1ga+jW6"),g=t("5tMkU7QT");const I=({fullName:n})=>e.createElement(s.Row,{className:"content"},e.createElement(s.Col,{xs:12},e.createElement(s.Alert,{bsStyle:"danger"},"The selected user ",n," can't be edited.")));var S=t("UiXZqrDE"),P=t("J6y4/h8P"),X=t("d4kzUuQm"),x=t("rLQ+VmDx"),y=t("tgKevaL8"),Q=t("6cfBHc3J"),$=t("Q1zRxDOP"),U=t("5W3DTPWj"),v=t("dsvqAVKU"),b=t("hhdCSTZj"),B=t("+gqrR506"),R=t("BmExNlEo"),Z=t("crOrxG1u");const G=P.default.div`
display: flex;
align-items: center;
`,z=(0,P.default)(b.Z)`
width: 200px;
margin-right: 3px;
`,W=(0,P.default)(b.Z)`
width: 400px;
`,V=(0,P.default)(s.Button)`
margin-left: 5px;
`,K={page:1,perPage:1e4,query:""},L=n=>(0,$.C)(n).id,Y=({id:n,title:o})=>({value:L(n),label:o}),se=[{value:"dashboard",label:"Dashboard"},{value:"stream",label:"Stream"},{value:"search",label:"Search"}],oe="*",le=(n,o)=>{var l,c,h;const{values:{startpage:p}}=(0,S.useFormikContext)(),C=o.includes(oe),[M,N]=(0,e.useState)([]),[A,w]=(0,e.useState)([]),[J,k]=(0,e.useState)([]),[j,te]=(0,e.useState)(!1),{data:_,isInitialLoading:H}=(0,B.Z)({query:"",page:1,pageSize:0,sort:{direction:"asc",attributeId:"title"}},{enabled:C}),{data:ne,isInitialLoading:de}=(0,R.Z)({query:"",page:1,pageSize:0,sort:{direction:"asc",attributeId:"title"}},{enabled:C}),{data:ae,isInitialLoading:ke}=(0,Z.Z)({query:"",page:1,pageSize:0,sort:{direction:"asc",attributeId:"title"}},{enabled:C}),qe=((l=_==null?void 0:_.list)!=null?l:[]).map(({id:F,title:q})=>({value:F,label:q})),et=((c=ne==null?void 0:ne.elements)!=null?c:[]).map(({id:F,title:q})=>({value:F,label:q})),tt=((h=ae==null?void 0:ae.list)!=null?h:[]).map(({id:F,title:q})=>({value:F,label:q}));return(0,e.useEffect)(()=>{C||(te(!0),U.Z.loadUserSharesPaginated(n,{...K,additionalQueries:{entity_type:"dashboard"}}).then(({list:F})=>N(F.map(Y).toArray())).then(()=>U.Z.loadUserSharesPaginated(n,{...K,additionalQueries:{entity_type:"stream"}}).then(({list:F})=>{w(F.map(Y).toArray())})).then(()=>U.Z.loadUserSharesPaginated(n,{...K,additionalQueries:{entity_type:"search"}}).then(({list:F})=>{te(!1),k(F.map(Y).toArray())})))},[C,n]),{options:(()=>{switch(p==null?void 0:p.type){case"dashboard":return[...M,...qe];case"search":return[{value:"default",label:"New Search"},...J,...tt];case"stream":return[...A,...et];default:return[]}})(),isLoading:j||H||ke||de}},ue=({userId:n,permissions:o})=>{const{options:l,isLoading:c}=le(n,o);return c?e.createElement(v.Z,null):e.createElement(S.Field,{name:"startpage"},({field:{name:h,value:p,onChange:C},meta:M})=>{var N,A;const w=(N=p==null?void 0:p.type)!=null?N:"dashboard",J=p!=null&&p.id&&l.findIndex(({value:j})=>j===p.id)<0?e.createElement(s.Alert,{bsStyle:"warning"},"User is missing permission for the configured page"):null,k=p!=null&&p.type?e.createElement(V,{onClick:()=>C({target:{name:h,value:{}}})},"Reset"):null;return e.createElement(s.Input,{id:"startpage",label:"Start page",help:"Select the page the user sees right after log in. Only entities are selectable which the user has permissions for.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",error:M==null?void 0:M.error},e.createElement(e.Fragment,null,e.createElement(G,null,e.createElement(z,{options:se,placeholder:"Select type",onChange:j=>C({target:{name:h,value:{type:j,id:void 0}}}),value:p==null?void 0:p.type}),e.createElement(W,{options:l,placeholder:`Select ${(A=p==null?void 0:p.type)!=null?A:"entity"}`,onChange:j=>C({target:{name:h,value:{type:w,id:j}}}),value:p==null?void 0:p.id}),k),J))})};var Pe=t("MLDs3jaY"),he=t("ty2gyrHp");const Se=(0,P.default)(a.mv)`
margin-bottom: 20px;
.read-only-value-col {
padding-top: 0;
}
`,Oe=async n=>{var o;let l={};const{type:c,id:h}=(o=n.startpage)!=null?o:{};return c&&!h&&(l={startpage:"Please select an entity."}),l},Ue=({user:{id:n,timezone:o,sessionTimeoutMs:l,startpage:c,permissions:h,serviceAccount:p},onSubmit:C})=>{const M=(0,Pe.Z)();return e.createElement(r.Z,{title:"Settings"},e.createElement(S.Formik,{onSubmit:C,validate:Oe,initialValues:{timezone:o,session_timeout_ms:l,startpage:c,service_account:p}},({isSubmitting:N,isValid:A})=>e.createElement(S.Form,{className:"form form-horizontal"},e.createElement(a.AE,{permissions:"*"},M?e.createElement(Se,{label:"Sessions Timeout",value:e.createElement(a.pJ,null,"User session timeout is not editable because the ",e.createElement(a.AE,{permissions:["clusterconfigentry:read"]},e.createElement(he.r,{to:X.ZP.SYSTEM.CONFIGURATIONS},"global session timeout"))," is enabled.")}):e.createElement(y.Z,null)),e.createElement(x.Z,null),e.createElement(a.AE,{permissions:"user:edit"},e.createElement(Q.Z,null)),e.createElement(ue,{userId:n,permissions:h}),e.createElement(s.Row,{className:"no-bm"},e.createElement(s.Col,{xs:12},e.createElement("div",{className:"pull-right"},e.createElement(s.Button,{bsStyle:"success",disabled:N||!A,title:"Update Settings",type:"submit"},"Update Settings")))))))};var Ee=t("QL8i6bcz"),pe=t("RCNj0OY4"),Ce=t("0TVxnHwi"),Te=t("PQfI17l6");const me=pe.Z.isCloud(),ee=me?Ee.G.exports("cloud")[0].oktaUserForm:null,be=n=>{let o={};const{password:l,password_repeat:c}=n;if(me&&ee){const{validations:{password:h}}=ee;o=h(o,l,c)}else o=(0,Te.jy)(o,l,c);return o},Re=(n,o)=>{const l={...n};return delete l.password_repeat,u.Z.changePassword(o,l)},De=()=>{if(me&&ee){const{fields:{password:n}}=ee;return e.createElement(n,null)}return e.createElement(e.Fragment,null,e.createElement(a.Fe,{label:"New Password",name:"password",type:"password",help:"Passwords must be at least 6 characters long. We recommend using a strong password.",maxLength:100,minLength:6,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",required:!0}),e.createElement(a.Fe,{label:"Repeat Password",name:"password_repeat",type:"password",minLength:6,maxLength:100,required:!0,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}))},ye=({user:{id:n}})=>{const o=(0,f.Z)();let l=!0;return(0,Ce.rq)(o==null?void 0:o.permissions,"users:passwordchange:*")&&(l=n===(o==null?void 0:o.id)),e.createElement(r.Z,{title:"Password"},e.createElement(S.Formik,{onSubmit:c=>Re(c,n),validate:be,initialValues:{}},({isSubmitting:c,isValid:h})=>e.createElement(S.Form,{className:"form form-horizontal"},l&&e.createElement(a.Fe,{label:"Old Password",name:"old_password",type:"password",maxLength:100,required:!0,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),e.createElement(De,null),e.createElement(s.Row,{className:"no-bm"},e.createElement(s.Col,{xs:12},e.createElement("div",{className:"pull-right"},e.createElement(s.Button,{bsStyle:"success",disabled:c||!h,title:"Change Password",type:"submit"},"Change Password")))))))},_e=()=>e.createElement(s.Alert,{bsStyle:"info",title:"First and Last Name"},"With Graylog 4.1, we've added distinct first and last name fields. These must be provided before the user\u2019s profile can be saved.");var Ae=t("ob0PYlhL"),Me=t("D4RgEuos"),Le=t("fdUTUHoJ");const fe=pe.Z.isCloud(),ie=(0,P.default)(a.mv)`
&:not(:last-child) {
margin-bottom: 15px;
}
`,Ne=({user:n,onSubmit:o})=>{const{username:l,fullName:c,firstName:h,lastName:p,email:C}=n,M=()=>fe?e.createElement(ie,{label:"Email",value:C}):e.createElement(ie,{label:"Username",value:l}),N=()=>fe?null:e.createElement(Le.Z,null),A=()=>c&&!h&&!p;return e.createElement(r.Z,{title:"Profile"},A()&&e.createElement(_e,null),e.createElement(S.Formik,{onSubmit:o,initialValues:{email:C,first_name:h,last_name:p}},({isSubmitting:w,isValid:J})=>e.createElement(S.Form,{className:"form form-horizontal"},A()&&e.createElement(ie,{label:"Full Name",value:c}),e.createElement(Ae.Z,null),e.createElement(Me.Z,null),M(),N(),e.createElement(s.Row,{className:"no-bm"},e.createElement(s.Col,{xs:12},e.createElement("div",{className:"pull-right"},e.createElement(s.Button,{bsStyle:"success",disabled:w||!J,title:"Update Profile",type:"submit"},"Update Profile")))))))};var Ie=t("CCNXj2ra"),Be=t("CXwqYNRt");const Ze=({user:n})=>{const o=l=>Be.p.saveUserPreferences(n.username,l);return e.createElement(r.Z,{title:"Preferences"},e.createElement(S.Formik,{onSubmit:o,initialValues:n.preferences},({isSubmitting:l,isValid:c})=>{var h,p;return e.createElement(S.Form,{className:"form form-horizontal"},e.createElement(s.Input,{id:"timeout-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Search autocompletion"},e.createElement(a.Fe,{label:"Enable autocompletion",name:"enableSmartSearch",formGroupClassName:"form-group no-bm",type:"checkbox"})),e.createElement(s.Input,{id:"update-unfocused-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Update unfocused"},e.createElement(a.Fe,{label:"Update unfocused",name:"updateUnfocussed",formGroupClassName:"form-group no-bm",type:"checkbox"})),e.createElement(s.Input,{id:"search-sidebar-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Search sidebar"},e.createElement(a.Fe,{label:"Is pinned",name:"searchSidebarIsPinned",formGroupClassName:"form-group no-bm",type:"checkbox",help:"Can also be changed by using the search sidebar pin icon"})),e.createElement(s.Input,{id:"dashboard-sidebar-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Dashboard sidebar"},e.createElement(a.Fe,{label:"Is pinned",name:"dashboardSidebarIsPinned",formGroupClassName:"form-group no-bm",type:"checkbox",help:"Can also be changed by using the dashboard sidebar pin icon"})),e.createElement(a.mv,{label:"Theme mode",value:(p=(h=n.preferences)==null?void 0:h[Ie.eb])!=null?p:"Not configured",help:"Can be changed by using the toggle in the user dropdown"}),e.createElement(s.Row,{className:"no-bm"},e.createElement(s.Col,{xs:12},e.createElement("div",{className:"pull-right"},e.createElement(s.Button,{bsStyle:"success",disabled:l||!c,title:"Update Preferences",type:"submit"},"Update Preferences")))))}))};var Fe=t("VPaD/Np4"),We=t("Lu0NTOJv"),ve=t("dan3/ZI+"),Ke=t("RLbSMTbK"),xe=t("OC6EEUte");const ge=P.default.div`
margin-top: 15px;
margin-bottom: 15px;
`,Ge=({user:n,onSubmit:o})=>{const{username:l,id:c}=n,[h,p]=(0,e.useState)(!1),[C,M]=(0,e.useState)(),[N,A]=(0,e.useState)(),w=(0,e.useCallback)((_=ve._)=>(p(!0),We.Z.loadRolesForUser(l,_).then(H=>(p(!1),H))),[l]),J=_=>o(_).then(()=>{w().then(M),u.Z.load(c)}),k=_=>{const H=n.roles,ne=_.map(ae=>ae.name),de=H.union(ne).toJS();return A(void 0),J({roles:de})},j=_=>_.includes("Reader")||_.includes("Admin"),te=_=>{const H=Fe.Set(n.roles.toJS()).remove(_.name).toJS();j(H)?(J({roles:H}),A(void 0)):(A("Roles must at least contain Admin or Reader role."),w().then(M))};return e.createElement(r.Z,{title:"Roles",showLoading:h},e.createElement("h3",null,"Assign Roles"),e.createElement(ge,null,e.createElement(Ke.Z,{onSubmit:k,assignedRolesIds:n.roles,identifier:_=>_.name})),e.createElement(a.hW,{onClose:A},N),e.createElement("h3",null,"Selected Roles"),e.createElement(ge,null,e.createElement(ve.Z,{noDataText:"No selected roles have been found.",onLoad:w,overrideList:C,onDeleteItem:te,queryHelper:e.createElement(xe.Z,null)})))},ze=({user:n})=>{var o;const l=Ee.G.exports("teams"),c=(o=l==null?void 0:l[0])==null?void 0:o.UserTeamsAssignment;return e.createElement(r.Z,{title:"Teams"},c?e.createElement(c,{user:n}):e.createElement(a.VL,{featureName:"teams"}))};var we=t("P7lYJiUi"),je=t("3yfJIRSb");const ce=(n,o,l,c)=>u.Z.update(l,n,c).then(()=>{l===(o==null?void 0:o.id)&&O.D.reload()}),Xe=({user:n})=>{const o=(0,f.Z)();return n?n.readOnly?e.createElement(I,{fullName:n.fullName}):e.createElement(je.Z,null,e.createElement(a.AE,{permissions:`users:edit:${n.username}`},e.createElement("div",null,n.external&&e.createElement(r.Z,{title:"External User"},e.createElement(s.Alert,{bsStyle:"warning"},"This user was synced from an external server, therefore neither the profile nor the password can be changed. Please contact your administrator for more information.")),!n.external&&e.createElement(Ne,{user:n,onSubmit:l=>ce(l,o,n.id,n.fullName)}),e.createElement(Ue,{user:n,onSubmit:l=>ce(l,o,n.id,n.fullName)}),e.createElement(a.AE,{permissions:`users:passwordchange:${n.username}`},!n.external&&e.createElement(ye,{user:n})),e.createElement(Ze,{user:n})),e.createElement("div",null,e.createElement(we.Z,null),e.createElement(a.AE,{permissions:"users:rolesedit"},e.createElement(Ge,{user:n,onSubmit:l=>ce(l,o,n.id,n.fullName)})),e.createElement(a.AE,{permissions:"teams:edit"},e.createElement(ze,{user:n})),o.id===n.id&&e.createElement(a.AE,{permissions:`users:edit:${n.username}`},e.createElement(g.Z,null))))):e.createElement(a.$j,null)};var Qe=t("WqhT36Vr"),Je=t("ynz3ptM5");const He=({fullName:n})=>e.createElement(e.Fragment,null,"Edit User ",n&&e.createElement(e.Fragment,null,"- ",e.createElement("i",null,n))),$e=n=>i.X.load.completed.listen(n),Ve=({params:n})=>{var o,l;const[c,h]=(0,e.useState)(),p=n==null?void 0:n.userId;(0,e.useEffect)(()=>$e(h),[]),(0,e.useEffect)(()=>{u.Z.load(p)},[p]);const C=(o=c==null?void 0:c.fullName)!=null?o:"",M=(l=c==null?void 0:c.readOnly)!=null?l:!1,N=p===(c==null?void 0:c.id)?c:void 0;return e.createElement(a.$4,{title:`Edit User ${C}`},e.createElement(Qe.Z,null),e.createElement(a.mr,{title:e.createElement(He,{fullName:C}),actions:e.createElement(Je.Z,{userId:p,userIsReadOnly:M}),documentationLink:{title:"Permissions documentation",path:m.Z.PAGES.USERS_ROLES}},e.createElement("span",null,"You can change the user details and password here and assign roles and teams.")),e.createElement(Xe,{user:N}))},Ye=(0,d.Z)(Ve)},c9JM82dZ:(D,E,t)=>{t.d(E,{Z:()=>m});var e=t("Z7aTuO5B"),i=t("yAXMqwrl");const m=u=>a=>{const f=(0,i.useParams)();return e.createElement(u,{...a,params:f})}}}]);})();
//# sourceMappingURL=1255d548-8890.3145c797c153dced9084.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy