web-interface.assets.bb8c8232-3795.00a590d9f21f452fb329.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-3795"],{SfPIQIJE:(M,v,t)=>{t.d(v,{A:()=>P});var e=t("Z7aTuO5B"),E=t("J6y4/h8P"),n=t("rIl5IEuP"),d=t("ty2gyrHp"),S=t("IOI9nV80"),r=t("NV1/EHMi");const l=(0,E.default)(n.ButtonToolbar)`
margin-bottom: 10px;
`,A=(0,E.default)(n.Button)(({theme:c})=>(0,E.css)`
font-family: ${c.fonts.family.navigation};
font-size: ${c.fonts.size.navigation};
color: ${c.colors.variant.darker.default};
&:hover,
&:focus {
background: inherit;
text-decoration: none;
}
&:hover {
color: inherit;
${(0,r.WS)(c)}
}
&.active {
color: ${c.colors.global.textDefault};
${(0,r.at)(c)}
&:hover,
&:focus {
${(0,r.at)(c)}
}
`);A.displayName="Button";const P=({items:c})=>e.createElement(l,null,c.map(({path:C,title:U,permissions:O,exactPathMatch:I})=>C?e.createElement(S.Wj,{permissions:O!=null?O:[],key:C},e.createElement(d.m,{to:C,relativeActive:!I},e.createElement(A,{bsStyle:"link"},e.createElement(r.Ay,null,U)))):null))},ynz3ptM5:(M,v,t)=>{t.d(v,{A:()=>r});var e=t("Z7aTuO5B"),E=t("ty2gyrHp"),n=t("d4kzUuQm"),d=t("rIl5IEuP");const r=({userId:l,userIsReadOnly:A})=>e.createElement(d.ButtonToolbar,null,e.createElement(E.m,{to:n.Ay.SYSTEM.USERS.show(l)},e.createElement(d.Button,{bsStyle:"success"},"View Details")),!A&&e.createElement(E.m,{to:n.Ay.SYSTEM.USERS.edit(l)},e.createElement(d.Button,{bsStyle:"success"},"Edit User")),e.createElement(E.m,{to:n.Ay.SYSTEM.USERS.TOKENS.edit(l)},e.createElement(d.Button,{bsStyle:"success"},"Edit Tokens")))},WqhT36Vr:(M,v,t)=>{t.d(v,{A:()=>r});var e=t("Z7aTuO5B"),E=t("d4kzUuQm"),n=t("SfPIQIJE"),d=t("rIl5IEuP");const r=()=>{const l=[{title:"Users Overview",path:E.Ay.SYSTEM.USERS.OVERVIEW,permissions:"users:list"},{title:"Teams Overview",path:E.Ay.getPluginRoute("SYSTEM_TEAMS"),permissions:"teams:list"}];return e.createElement(d.Row,null,e.createElement(n.A,{items:l}))}},uzHJ6m8N:(M,v,t)=>{t.r(v),t.d(v,{default:()=>X});var e=t("Z7aTuO5B"),E=t("c9JM82dZ"),n=t("rIl5IEuP"),d=t("yGRmSjYM"),S=t("E+CaPsQD"),r=t("92lPlKXC"),l=t("IOI9nV80"),A=t("QBkUz07U"),N=t("ii0bleBb"),P=t.n(N),c=t("J6y4/h8P"),C=t("1/PeS1Oa");const U=c.default.form`
margin-top: 10px;
&.form-inline > .form-group {
margin-right: 10px;
> input {
width: 300px;
}
}
`,O=({creatingToken:o,disableForm:m,onCreate:i})=>{const[u,a]=(0,e.useState)(""),T=g=>{g.preventDefault(),i(u),a("")};return e.createElement(U,{className:"form-inline",onSubmit:T},e.createElement(n.FormGroup,{controlId:"create-token-input"},e.createElement(n.ControlLabel,null,"Token Name"),e.createElement(n.FormControl,{type:"text",disabled:m,placeholder:"What is this token for?",value:u,onChange:g=>a(g.target.value)})),e.createElement(n.Button,{id:"create-token",disabled:m||u===""||o,type:"submit",bsStyle:"primary"},o?e.createElement(l.y$,{text:"Creating..."}):"Create Token"))};O.propTypes={creatingToken:P().bool,disableForm:P().bool,onCreate:P().func.isRequired},O.defaultProps={creatingToken:!1,disableForm:!1};const I=O,W=(0,c.default)(n.Panel)`
&.panel {
margin: 10px 0;
background-color: ${o=>o.theme.colors.global.contentBackground};
.panel-heading {
color: ${o=>o.theme.colors.gray[30]};
}
}
`,b=(0,c.default)(l.bL)`
vertical-align: baseline;
margin-left: 1em;
`,K=(0,c.default)(l.B9)`
margin-bottom: 10px;
`,x=c.default.div`
color: ${o=>o.theme.colors.gray[60]};
font-size: ${o=>o.theme.fonts.size.small};
margin-bottom: 5px;
`,R=({creatingToken:o,deletingToken:m,onCreate:i,onDelete:u,tokens:a})=>{const[T,g]=(0,e.useState)(),[D,_]=(0,e.useState)(""),B=(0,e.useMemo)(()=>{const s=new RegExp(D,"i");return a.filter(({name:f})=>s.test(f)).sort((f,p)=>(0,C.V)(f.last_access,p.last_access,"desc"))},[D,a]),h=s=>{i(s).then(p=>(g(p),p))},k=s=>()=>{u(s.id,s.name)},y=s=>_(s||"");return e.createElement("span",null,e.createElement(I,{onCreate:h,creatingToken:o}),T&&e.createElement(W,{bsStyle:"success"},e.createElement(n.Panel.Heading,null,e.createElement(n.Panel.Title,null,"Token ",e.createElement("em",null,T.name)," created!")),e.createElement(n.Panel.Body,null,e.createElement("p",null,"This is your new token. Make sure to copy it now, you will not be able to see it again."),e.createElement("pre",null,T.token,e.createElement(b,{title:e.createElement(l.In,{name:"content_copy"}),text:T.token,bsSize:"xsmall"})),e.createElement(n.Button,{bsStyle:"primary",onClick:()=>g(void 0)},"Done"))),e.createElement("hr",null),e.createElement(K,{onSearch:y,onReset:y,label:"Filter",useLoadingState:!1}),e.createElement(l.nB,null,e.createElement(l.nB.Header,null),B.length===0&&e.createElement(l.nB.Item,null,e.createElement("p",null,D===""?"No tokens to display.":"No tokens match the filter.")),B.map(s=>{const f=Date.parse(s.last_access)===0;return e.createElement(l.nB.Item,{key:s.id},e.createElement(n.Row,{className:"row-sm"},e.createElement(n.Col,{md:9},s.name,e.createElement(x,null,f?"Never used":e.createElement(e.Fragment,null,"Last used ",e.createElement(l.sR,{dateTime:s.last_access})))),e.createElement(n.Col,{md:3,className:"text-right"},e.createElement(n.Button,{bsSize:"xsmall",disabled:m===s.id,bsStyle:"primary",onClick:k(s)},m===s.id?e.createElement(l.y$,{text:"Deleting..."}):"Delete"))))})))};R.propTypes={tokens:P().arrayOf(P().object),onDelete:P().func,onCreate:P().func,creatingToken:P().bool,deletingToken:P().string},R.defaultProps={tokens:[],onDelete:()=>{},onCreate:()=>{},creatingToken:!1,deletingToken:void 0};const $=R;var F=t("WqhT36Vr"),z=t("ynz3ptM5"),V=t("q2j1bVbz");const Q=({fullName:o})=>e.createElement(e.Fragment,null,"Edit Tokens Of User ",o&&e.createElement(e.Fragment,null,"- ",e.createElement("i",null,o))),Y=(o,m,i)=>{o&&((0,d.Nn)(m==null?void 0:m.permissions,[`users:tokenlist:${o.username}`])?r.A.loadTokens(o.id).then(i):i([]))},H=(o,m,i,u,a)=>{const T=r.A.deleteToken(i,o,m);a(o),T.then(()=>{u(),a(void 0)})},J=(o,m,i,u)=>{const a=r.A.createToken(m,o);return u(!0),a.then(T=>(i(),u(!1),T))},Z=({params:o})=>{var m,i;const u=(0,V.A)(),[a,T]=(0,e.useState)(),[g,D]=(0,e.useState)([]),[_,B]=(0,e.useState)(),[h,k]=(0,e.useState)(!1),y=o==null?void 0:o.userId,s=(0,e.useCallback)(()=>Y(a,u,D),[u,a]),f=(L,j)=>H(L,j,y,s,B),p=L=>J(L,y,s,k);return(0,e.useEffect)(()=>{s()},[s,a]),(0,e.useEffect)(()=>{r.A.load(y).then(T)},[y]),e.createElement(l.Qc,{title:`Edit Tokens Of User ${(m=a==null?void 0:a.fullName)!=null?m:""}`},e.createElement(F.A,null),e.createElement(l.zY,{title:e.createElement(Q,{fullName:a==null?void 0:a.fullName}),actions:e.createElement(z.A,{userId:y,userIsReadOnly:(i=a==null?void 0:a.readOnly)!=null?i:!1}),documentationLink:{title:"Permissions documentation",path:S.A.PAGES.USERS_ROLES}},e.createElement("span",null,"You can create new tokens or delete old ones.")),e.createElement(n.Row,{className:"content"},e.createElement(n.Col,{lg:8},e.createElement(A.$,null,"Create And Edit Tokens"),a?e.createElement($,{tokens:g,onDelete:f,onCreate:p,creatingToken:h,deletingToken:_}):e.createElement(n.Row,null,e.createElement(n.Col,{xs:12},e.createElement(l.y$,null))))))},X=(0,E.A)(Z)},c9JM82dZ:(M,v,t)=>{t.d(v,{A:()=>d});var e=t("Z7aTuO5B"),E=t("yAXMqwrl");const d=S=>r=>{const l=(0,E.useParams)();return e.createElement(S,{...r,params:l})}}}]);})();
//# sourceMappingURL=bb8c8232-3795.00a590d9f21f452fb329.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy