All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.bb8c8232-8845.9e6dd7e0b43abda40223.js Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-8845"],{"6gJIQhoE":(D,E,t)=>{t.d(E,{A:()=>c});const c=g=>{if(g)return g.entrySeq().flatMap(([d,p])=>p.map(o=>`${d}:${o}`)).toArray()}},"dan3/ZI+":(D,E,t)=>{t.d(E,{A:()=>c,n:()=>e.n});var e=t("xfUIbHjs");const c=e.A},"rbhKE1/U":(D,E,t)=>{t.d(E,{A:()=>p});var e=t("Z7aTuO5B"),c=t("rlwexfKi");const g=e.createElement("p",null,"Find role with a name containing manager:",e.createElement("br",null),e.createElement("kbd",null,"name:manager"),e.createElement("br",null)),p=()=>e.createElement(c.A,{entityName:"role",example:g,commonFields:["name","description"]})},ugRSZVzh:(D,E,t)=>{t.d(E,{A:()=>S});var e=t("DUKaTDO2"),c=t("jAGDuYSC"),g=t("pUKP3+Pg"),d=t("6gJIQhoE");const p={pagination:{total:0},elements:[],attributes:[]},S=(l,{enabled:y}={enabled:!0})=>{const{data:M,refetch:L,isInitialLoading:C}=(0,e.useQuery)(["streams","overview",l],()=>g.Ay.searchPaginated(l.page,l.pageSize,l.query,{sort:l==null?void 0:l.sort.attributeId,order:l==null?void 0:l.sort.direction,filters:(0,d.A)(l.filters)}),{onError:B=>{c.A.error(`Loading streams failed with status: ${B}`,"Could not load streams")},keepPreviousData:!0,enabled:y});return{data:M!=null?M:p,refetch:L,isInitialLoading:C}}},P7lYJiUi:(D,E,t)=>{t.d(E,{A:()=>S});var e=t("Z7aTuO5B"),c=t("E+CaPsQD"),g=t("7dh0vSOR"),d=t("rIl5IEuP"),p=t("IOI9nV80");const S=()=>e.createElement(d.Row,{className:"content"},e.createElement(d.Col,{xs:12},e.createElement(d.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(p.In,{name:"person_add"})," Share")," button of an entity. You can find the button e.g. on the entities overview page. Learn more in the ",e.createElement(g.A,{page:c.A.PAGES.PERMISSIONS,text:"documentation"}),".")))},ynz3ptM5:(D,E,t)=>{t.d(E,{A:()=>o});var e=t("Z7aTuO5B"),c=t("ty2gyrHp"),g=t("d4kzUuQm"),d=t("rIl5IEuP");const o=({userId:S,userIsReadOnly:l})=>e.createElement(d.ButtonToolbar,null,e.createElement(c.m,{to:g.Ay.SYSTEM.USERS.show(S)},e.createElement(d.Button,{bsStyle:"success"},"View Details")),!l&&e.createElement(c.m,{to:g.Ay.SYSTEM.USERS.edit(S)},e.createElement(d.Button,{bsStyle:"success"},"Edit User")),e.createElement(c.m,{to:g.Ay.SYSTEM.USERS.TOKENS.edit(S)},e.createElement(d.Button,{bsStyle:"success"},"Edit Tokens")))},"5tMkU7QT":(D,E,t)=>{t.d(E,{A:()=>L});var e=t("Z7aTuO5B"),c=t("UiXZqrDE"),g=t("2dBXfbRP"),d=t("QBkUz07U"),p=t("IOI9nV80"),o=t("rIl5IEuP"),S=t("2aaiYHqX"),l=t("RCNj0OY4"),y=t("Vmfu2XtV");const L=()=>{const[C,B]=(0,e.useState)(void 0),{enabled:f}=l.A.telemetry()||{},v=(0,g.sf)();if((0,e.useEffect)(()=>{S.g.get().then(O=>{B(O)})},[]),(0,e.useEffect)(()=>{f&&(C!=null&&C.telemetry_enabled)&&(v!=null&&v.has_opted_out_capturing())&&v.opt_in_capturing()},[f,v,C==null?void 0:C.telemetry_enabled]),!C)return e.createElement(p.y$,null);const z=O=>{v&&f&&!O.telemetry_enabled&&(v.capture("$opt_out"),v.opt_out_capturing())},Y=(O,{setSubmitting:W})=>{z(O),S.g.update(O).then(()=>{W(!1),window.location.reload()})};return e.createElement(d.A,{title:"Telemetry"},e.createElement(y.A,null),e.createElement(c.Formik,{onSubmit:Y,initialValues:C},({isSubmitting:O,isValid:W})=>e.createElement(c.Form,{className:"form form-horizontal"},e.createElement(o.Input,{id:"timeout-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Enable telemetry"},e.createElement(p.o$,{label:"enabled",name:"telemetry_enabled",disabled:!f,formGroupClassName:"form-group no-bm",type:"checkbox"})),e.createElement(o.Row,{className:"no-bm"},e.createElement(o.Col,{xs:12},e.createElement("div",{className:"pull-right"},e.createElement(o.Button,{bsStyle:"success",disabled:O||!W||!f,title:"Update Preferences",type:"submit"},"Update telemetry")))))))}},M4KelNzO:(D,E,t)=>{t.r(E),t.d(E,{default:()=>He});var e=t("Z7aTuO5B"),c=t("cSDA0Pof"),g=t("c9JM82dZ"),d=t("E+CaPsQD"),p=t("92lPlKXC"),o=t("IOI9nV80"),S=t("q2j1bVbz"),l=t("rIl5IEuP"),y=t("QBkUz07U"),M=t("J1ga+jW6"),L=t("5tMkU7QT");const B=({fullName:n})=>e.createElement(l.Row,{className:"content"},e.createElement(l.Col,{xs:12},e.createElement(l.Alert,{bsStyle:"danger"},"The selected user ",n," can't be edited.")));var f=t("UiXZqrDE"),v=t("J6y4/h8P"),z=t("d4kzUuQm"),Y=t("rLQ+VmDx"),O=t("tgKevaL8"),W=t("6cfBHc3J"),ae=t("Q1zRxDOP"),j=t("5W3DTPWj"),se=t("dsvqAVKU"),H=t("hhdCSTZj"),le=t("+gqrR506"),oe=t("ugRSZVzh"),re=t("crOrxG1u");const ie=v.default.div`
  display: flex;
  align-items: center;
`,me=(0,v.default)(H.A)`
  width: 200px;
  margin-right: 3px;
`,ce=(0,v.default)(H.A)`
  width: 400px;
`,de=(0,v.default)(l.Button)`
  margin-left: 5px;
`,$={page:1,perPage:1e4,query:""},ue=n=>(0,ae.U)(n).id,V=({id:n,title:a})=>({value:ue(n),label:a}),Ee=[{value:"dashboard",label:"Dashboard"},{value:"stream",label:"Stream"},{value:"search",label:"Search"}],pe="*",ge=(n,a)=>{var s,r,m;const{values:{startpage:i}}=(0,f.useFormikContext)(),u=a.includes(pe),[A,U]=(0,e.useState)([]),[h,R]=(0,e.useState)([]),[I,K]=(0,e.useState)([]),[T,_]=(0,e.useState)(!1),{data:P,isInitialLoading:N}=(0,le.A)({query:"",page:1,pageSize:0,sort:{direction:"asc",attributeId:"title"}},{enabled:u}),{data:w,isInitialLoading:Z}=(0,oe.A)({query:"",page:1,pageSize:0,sort:{direction:"asc",attributeId:"title"}},{enabled:u}),{data:Q,isInitialLoading:ke}=(0,re.A)({query:"",page:1,pageSize:0,sort:{direction:"asc",attributeId:"title"}},{enabled:u}),qe=((s=P==null?void 0:P.list)!=null?s:[]).map(({id:b,title:x})=>({value:b,label:x})),et=((r=w==null?void 0:w.elements)!=null?r:[]).map(({id:b,title:x})=>({value:b,label:x})),tt=((m=Q==null?void 0:Q.list)!=null?m:[]).map(({id:b,title:x})=>({value:b,label:x}));return(0,e.useEffect)(()=>{u||(_(!0),j.A.loadUserSharesPaginated(n,{...$,additionalQueries:{entity_type:"dashboard"}}).then(({list:b})=>U(b.map(V).toArray())).then(()=>j.A.loadUserSharesPaginated(n,{...$,additionalQueries:{entity_type:"stream"}}).then(({list:b})=>{R(b.map(V).toArray())})).then(()=>j.A.loadUserSharesPaginated(n,{...$,additionalQueries:{entity_type:"search"}}).then(({list:b})=>{_(!1),K(b.map(V).toArray())})))},[u,n]),{options:(()=>{switch(i==null?void 0:i.type){case"dashboard":return[...A,...qe];case"search":return[{value:"default",label:"New Search"},...I,...tt];case"stream":return[...h,...et];default:return[]}})(),isLoading:T||N||ke||Z}},fe=({userId:n,permissions:a})=>{const{options:s,isLoading:r}=ge(n,a);return r?e.createElement(se.A,null):e.createElement(f.Field,{name:"startpage"},({field:{name:m,value:i,onChange:u},meta:A})=>{var U,h;const R=(U=i==null?void 0:i.type)!=null?U:"dashboard",I=i!=null&&i.id&&s.findIndex(({value:T})=>T===i.id)<0?e.createElement(l.Alert,{bsStyle:"warning"},"User is missing permission for the configured page"):null,K=i!=null&&i.type?e.createElement(de,{onClick:()=>u({target:{name:m,value:{}}})},"Reset"):null;return e.createElement(l.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:A==null?void 0:A.error},e.createElement(e.Fragment,null,e.createElement(ie,null,e.createElement(me,{options:Ee,placeholder:"Select type",onChange:T=>u({target:{name:m,value:{type:T,id:void 0}}}),value:i==null?void 0:i.type}),e.createElement(ce,{options:s,placeholder:`Select ${(h=i==null?void 0:i.type)!=null?h:"entity"}`,onChange:T=>u({target:{name:m,value:{type:R,id:T}}}),value:i==null?void 0:i.id}),K),I))})};var ve=t("MLDs3jaY"),Se=t("ty2gyrHp");const Pe=(0,v.default)(o.WY)`
  margin-bottom: 20px;
  
  .read-only-value-col {
    padding-top: 0;
  }
`,he=async n=>{var a;let s={};const{type:r,id:m}=(a=n.startpage)!=null?a:{};return r&&!m&&(s={startpage:"Please select an entity."}),s},Ae=({user:{id:n,timezone:a,sessionTimeoutMs:s,startpage:r,permissions:m,serviceAccount:i},onSubmit:u})=>{const A=(0,ve.A)();return e.createElement(y.A,{title:"Settings"},e.createElement(f.Formik,{onSubmit:u,validate:he,initialValues:{timezone:a,session_timeout_ms:s,startpage:r,service_account:i}},({isSubmitting:U,isValid:h})=>e.createElement(f.Form,{className:"form form-horizontal"},e.createElement(o.Wj,{permissions:"*"},A?e.createElement(Pe,{label:"Sessions Timeout",value:e.createElement(o.EO,null,"User session timeout is not editable because the ",e.createElement(o.Wj,{permissions:["clusterconfigentry:read"]},e.createElement(Se.N,{to:z.Ay.SYSTEM.CONFIGURATIONS},"global session timeout"))," is enabled.")}):e.createElement(O.A,null)),e.createElement(Y.A,null),e.createElement(o.Wj,{permissions:"user:edit"},e.createElement(W.A,null)),e.createElement(fe,{userId:n,permissions:m}),e.createElement(l.Row,{className:"no-bm"},e.createElement(l.Col,{xs:12},e.createElement("div",{className:"pull-right"},e.createElement(l.Button,{bsStyle:"success",disabled:U||!h,title:"Update Settings",type:"submit"},"Update Settings")))))))};var k=t("QL8i6bcz"),q=t("RCNj0OY4"),Ue=t("yGRmSjYM"),ye=t("PQfI17l6");const F=q.A.isCloud(),G=F?k.d.exports("cloud")[0].oktaUserForm:null,be=n=>{let a={};const{password:s,password_repeat:r}=n;if(F&&G){const{validations:{password:m}}=G;a=m(a,s,r)}else a=(0,ye.P8)(a,s,r);return a},Oe=(n,a)=>{const s={...n};return delete s.password_repeat,p.A.changePassword(a,s)},Ce=()=>{if(F&&G){const{fields:{password:n}}=G;return e.createElement(n,null)}return e.createElement(e.Fragment,null,e.createElement(o.o$,{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,autoComplete:"new-password",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",required:!0}),e.createElement(o.o$,{label:"Repeat Password",name:"password_repeat",type:"password",minLength:6,maxLength:100,autoComplete:"new-password",required:!0,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}))},Re=v.default.input`
  display: none;
`,Te=({user:{id:n}})=>{const a=(0,S.A)();let s=!0;return(0,Ue.Nn)(a==null?void 0:a.permissions,"users:passwordchange:*")&&(s=n===(a==null?void 0:a.id)),e.createElement(y.A,{title:"Password"},e.createElement(f.Formik,{onSubmit:r=>Oe(r,n),validate:be,initialValues:{}},({isSubmitting:r,isValid:m})=>e.createElement(f.Form,{className:"form form-horizontal"},e.createElement(Re,{readOnly:!0,id:"username",autoComplete:"username",type:F?"email":void 0,value:F?a.email:a.username}),s&&e.createElement(o.o$,{label:"Old Password",name:"old_password",type:"password",maxLength:100,autoComplete:"current-password",required:!0,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),e.createElement(Ce,null),e.createElement(l.Row,{className:"no-bm"},e.createElement(l.Col,{xs:12},e.createElement("div",{className:"pull-right"},e.createElement(l.Button,{bsStyle:"success",disabled:r||!m,title:"Change Password",type:"submit"},"Change Password")))))))},De=()=>e.createElement(l.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 Ie=t("ob0PYlhL"),Ne=t("D4RgEuos"),Me=t("fdUTUHoJ");const ee=q.A.isCloud(),X=(0,v.default)(o.WY)`
  &:not(:last-child) {
    margin-bottom: 15px;
  }
`,Le=({user:n,onSubmit:a})=>{const{username:s,fullName:r,firstName:m,lastName:i,email:u}=n,A=()=>ee?e.createElement(X,{label:"Email",value:u}):e.createElement(X,{label:"Username",value:s}),U=()=>ee?null:e.createElement(Me.A,null),h=()=>r&&!m&&!i;return e.createElement(y.A,{title:"Profile"},h()&&e.createElement(De,null),e.createElement(f.Formik,{onSubmit:a,initialValues:{email:u,first_name:m,last_name:i}},({isSubmitting:R,isValid:I})=>e.createElement(f.Form,{className:"form form-horizontal"},h()&&e.createElement(X,{label:"Full Name",value:r}),e.createElement(Ie.A,null),e.createElement(Ne.A,null),A(),U(),e.createElement(l.Row,{className:"no-bm"},e.createElement(l.Col,{xs:12},e.createElement("div",{className:"pull-right"},e.createElement(l.Button,{bsStyle:"success",disabled:R||!I,title:"Update Profile",type:"submit"},"Update Profile")))))))};var Be=t("CCNXj2ra"),We=t("CXwqYNRt");const Fe=({user:n})=>{const a=s=>We.S.saveUserPreferences(n.username,s);return e.createElement(y.A,{title:"Preferences"},e.createElement(f.Formik,{onSubmit:a,initialValues:n.preferences},({isSubmitting:s,isValid:r})=>{var m,i;return e.createElement(f.Form,{className:"form form-horizontal"},e.createElement(l.Input,{id:"timeout-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Search autocompletion"},e.createElement(o.o$,{label:"Enable autocompletion",name:"enableSmartSearch",formGroupClassName:"form-group no-bm",type:"checkbox"})),e.createElement(l.Input,{id:"update-unfocused-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Update unfocused"},e.createElement(o.o$,{label:"Update unfocused",name:"updateUnfocussed",formGroupClassName:"form-group no-bm",type:"checkbox"})),e.createElement(l.Input,{id:"search-sidebar-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Search sidebar"},e.createElement(o.o$,{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(l.Input,{id:"dashboard-sidebar-controls",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",label:"Dashboard sidebar"},e.createElement(o.o$,{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(o.WY,{label:"Theme mode",value:(i=(m=n.preferences)==null?void 0:m[Be.vM])!=null?i:"Not configured",help:"Can be changed by using the toggle in the user dropdown"}),e.createElement(l.Row,{className:"no-bm"},e.createElement(l.Col,{xs:12},e.createElement("div",{className:"pull-right"},e.createElement(l.Button,{bsStyle:"success",disabled:s||!r,title:"Update Preferences",type:"submit"},"Update Preferences")))))}))};var Ke=t("VPaD/Np4"),xe=t("Lu0NTOJv"),te=t("dan3/ZI+"),Ge=t("RLbSMTbK"),_e=t("rbhKE1/U");const ne=v.default.div`
  margin-top: 15px;
  margin-bottom: 15px;
`,we=({user:n,onSubmit:a})=>{const{username:s,id:r}=n,[m,i]=(0,e.useState)(!1),[u,A]=(0,e.useState)(),[U,h]=(0,e.useState)(),R=(0,e.useCallback)((P=te.n)=>(i(!0),xe.A.loadRolesForUser(s,P).then(N=>(i(!1),N))),[s]),I=P=>a(P).then(()=>{R().then(A),p.A.load(r)}),K=P=>{const N=n.roles,w=P.map(Q=>Q.name),Z=N.union(w).toJS();return h(void 0),I({roles:Z})},T=P=>P.includes("Reader")||P.includes("Admin"),_=P=>{const N=Ke.Set(n.roles.toJS()).remove(P.name).toJS();T(N)?(I({roles:N}),h(void 0)):(h("Roles must at least contain Admin or Reader role."),R().then(A))};return e.createElement(y.A,{title:"Roles",showLoading:m},e.createElement("h3",null,"Assign Roles"),e.createElement(ne,null,e.createElement(Ge.A,{onSubmit:K,assignedRolesIds:n.roles,identifier:P=>P.name})),e.createElement(o.$p,{onClose:h},U),e.createElement("h3",null,"Selected Roles"),e.createElement(ne,null,e.createElement(te.A,{noDataText:"No selected roles have been found.",onLoad:R,overrideList:u,onDeleteItem:_,queryHelper:e.createElement(_e.A,null)})))},Qe=({user:n})=>{var a;const s=k.d.exports("teams"),r=(a=s==null?void 0:s[0])==null?void 0:a.UserTeamsAssignment;return e.createElement(y.A,{title:"Teams"},r?e.createElement(r,{user:n}):e.createElement(o.Uk,{featureName:"teams"}))};var ze=t("P7lYJiUi"),Ye=t("3yfJIRSb");const J=(n,a,s,r)=>p.A.update(s,n,r).then(()=>{s===(a==null?void 0:a.id)&&M.y.reload()}),je=({user:n})=>{const a=(0,S.A)();return n?n.readOnly?e.createElement(B,{fullName:n.fullName}):e.createElement(Ye.A,null,e.createElement(o.Wj,{permissions:`users:edit:${n.username}`},e.createElement("div",null,n.external&&e.createElement(y.A,{title:"External User"},e.createElement(l.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(Le,{user:n,onSubmit:s=>J(s,a,n.id,n.fullName)}),e.createElement(Ae,{user:n,onSubmit:s=>J(s,a,n.id,n.fullName)}),e.createElement(o.Wj,{permissions:`users:passwordchange:${n.username}`},!n.external&&e.createElement(Te,{user:n})),e.createElement(Fe,{user:n})),e.createElement("div",null,e.createElement(ze.A,null),e.createElement(o.Wj,{permissions:"users:rolesedit"},e.createElement(we,{user:n,onSubmit:s=>J(s,a,n.id,n.fullName)})),e.createElement(o.Wj,{permissions:"teams:edit"},e.createElement(Qe,{user:n})),a.id===n.id&&e.createElement(o.Wj,{permissions:`users:edit:${n.username}`},e.createElement(L.A,null))))):e.createElement(o.y$,null)};var $e=t("WqhT36Vr"),Ve=t("ynz3ptM5");const Xe=({fullName:n})=>e.createElement(e.Fragment,null,"Edit User ",n&&e.createElement(e.Fragment,null,"- ",e.createElement("i",null,n))),Je=n=>c.M.load.completed.listen(n),Ze=({params:n})=>{var a,s;const[r,m]=(0,e.useState)(),i=n==null?void 0:n.userId;(0,e.useEffect)(()=>Je(m),[]),(0,e.useEffect)(()=>{p.A.load(i)},[i]);const u=(a=r==null?void 0:r.fullName)!=null?a:"",A=(s=r==null?void 0:r.readOnly)!=null?s:!1,U=i===(r==null?void 0:r.id)?r:void 0;return e.createElement(o.Qc,{title:`Edit User ${u}`},e.createElement($e.A,null),e.createElement(o.zY,{title:e.createElement(Xe,{fullName:u}),actions:e.createElement(Ve.A,{userId:i,userIsReadOnly:A}),documentationLink:{title:"Permissions documentation",path:d.A.PAGES.USERS_ROLES}},e.createElement("span",null,"You can change the user details and password here and assign roles and teams.")),e.createElement(je,{user:U}))},He=(0,g.A)(Ze)},c9JM82dZ:(D,E,t)=>{t.d(E,{A:()=>d});var e=t("Z7aTuO5B"),c=t("yAXMqwrl");const d=p=>o=>{const S=(0,c.useParams)();return e.createElement(p,{...o,params:S})}}}]);})();

//# sourceMappingURL=bb8c8232-8845.9e6dd7e0b43abda40223.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy