web-interface.assets.bb8c8232-8815.90638419a9d0336ed33f.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-8815"],{HntqvQkd:(f,h,t)=>{t.r(h),t.d(h,{default:()=>M});var E=t("ii0bleBb"),p=t.n(E),n=t("Z7aTuO5B"),a=t("D4SbLiE/"),d=t.n(a),c=t("JnTtTRmZ"),i=t.n(c),v=t("/7uHmzM0"),e=t("IOI9nV80"),o=t("c9JM82dZ"),s=t("WE0xQIRH"),l=t("h0mKhxLv"),u=t("wToqYuKZ"),T=t("Vg8s2y9S"),P=t("MdYBRjRJ"),A=t("jAGDuYSC"),S=t("eFxcQyPT"),y=t("IA3Ku5lS");const O=(0,y.Bv)("core.Plugins",()=>i().createStore({sourceUrl:r=>`/cluster/${r}/plugins`,list(r){return(0,S.Ay)("GET",P.H3(this.sourceUrl(r))).then(m=>m.plugins,m=>A.A.error(`Getting plugins on node "${r}" failed: ${m}`,"Could not get plugins"))}}));function D(r){return r.nodes?r.nodes[this.props.params.nodeId]:r.nodes}function R(r){return r.clusterOverview?r.clusterOverview[this.props.params.nodeId]:void 0}const C=d()({displayName:"ShowNodePage",propTypes:{params:p().object.isRequired},mixins:[i().connectFilter(T.j,"node",D),i().connectFilter(s.T,"systemOverview",R),i().connect(u.P)],getInitialState(){return{jvmInformation:void 0,plugins:void 0}},UNSAFE_componentWillMount(){Promise.all([s.T.jvm(this.props.params.nodeId).then(r=>this.setState({jvmInformation:r})),O.list(this.props.params.nodeId).then(r=>this.setState({plugins:r})),l.G.list().then(r=>{const g=Object.keys(r),m=[];g.forEach(U=>{const I=r[U][this.props.params.nodeId];I&&m.push(I)}),this.setState({inputStates:m})})]).then(()=>{},r=>this.setState({errors:r}))},_isLoading(){return!(this.state.node&&this.state.systemOverview)},render(){if(this.state.errors)return n.createElement(e.J5,{errors:[this.state.errors]});if(this._isLoading())return n.createElement(e.y$,null);const{node:r}=this.state,g=n.createElement("span",null,"Node ",r.short_node_id," / ",r.hostname);return n.createElement(e.Qc,{title:`Node ${r.short_node_id} / ${r.hostname}`},n.createElement("div",null,n.createElement(e.zY,{title:g,actions:n.createElement(v.dk,{node:r})},n.createElement("span",null,"This page shows details of a Graylog server node that is active and reachable in your cluster.",n.createElement("br",null),r.is_leader?n.createElement("span",null,"This is the leader node."):n.createElement("span",null,"This is ",n.createElement("em",null,"not")," the leader node."))),n.createElement(v.GH,{node:r,systemOverview:this.state.systemOverview,jvmInformation:this.state.jvmInformation,plugins:this.state.plugins,inputStates:this.state.inputStates,inputDescriptions:this.state.inputDescriptions})))}}),M=(0,o.A)(C)},c9JM82dZ:(f,h,t)=>{t.d(h,{A:()=>a});var E=t("Z7aTuO5B"),p=t("yAXMqwrl");const a=d=>c=>{const i=(0,p.useParams)();return E.createElement(d,{...c,params:i})}},h0mKhxLv:(f,h,t)=>{t.d(h,{G:()=>v});var E=t("JnTtTRmZ"),p=t.n(E),n=t("jAGDuYSC"),a=t("MdYBRjRJ"),d=t("U1Iufsob"),c=t("eFxcQyPT"),i=t("IA3Ku5lS");const v=(0,i.Bv)("core.InputStates",()=>p().createStore({listenables:[],init(){this.list()},getInitialState(){return{inputStates:this.inputStates}},list(){const e=a.H3(d.A.ClusterInputStatesController.list().url);return(0,c.Ay)("GET",e).then(o=>{const s={};return Object.keys(o).forEach(l=>{o[l]&&o[l].forEach(u=>{s[u.id]||(s[u.id]={}),s[u.id][l]=u})}),this.inputStates=s,this.trigger({inputStates:this.inputStates}),s})},_checkInputStateChangeResponse(e,o,s){const l=Object.keys(o).filter(T=>e.global?!0:T===e.node),u=l.filter(T=>o[T]===null);u.length===0?n.A.success(`Request to ${s.toLowerCase()} input '${e.title}' was sent successfully.`,`Input '${e.title}' will be ${s==="START"?"started":"stopped"} shortly`):u.length===l.length?n.A.error(`Request to ${s.toLowerCase()} input '${e.title}' failed. Check your Graylog logs for more information.`,`Input '${e.title}' could not be ${s==="START"?"started":"stopped"}`):n.A.warning(`Request to ${s.toLowerCase()} input '${e.title}' failed in some nodes. Check your Graylog logs for more information.`,`Input '${e.title}' could not be ${s==="START"?"started":"stopped"} in all nodes`)},start(e){const o=a.H3(d.A.ClusterInputStatesController.start(e.id).url);return(0,c.Ay)("PUT",o).then(s=>(this._checkInputStateChangeResponse(e,s,"START"),this.list(),s),s=>{n.A.error(`Error starting input '${e.title}': ${s}`,`Input '${e.title}' could not be started`)})},stop(e){const o=a.H3(d.A.ClusterInputStatesController.stop(e.id).url);return(0,c.Ay)("DELETE",o).then(s=>(this._checkInputStateChangeResponse(e,s,"STOP"),this.list(),s),s=>{n.A.error(`Error stopping input '${e.title}': ${s}`,`Input '${e.title}' could not be stopped`)})}}))},wToqYuKZ:(f,h,t)=>{t.d(h,{L:()=>i,P:()=>v});var E=t("JnTtTRmZ"),p=t.n(E),n=t("MdYBRjRJ"),a=t("eFxcQyPT"),d=t("jAGDuYSC"),c=t("IA3Ku5lS");const i=(0,c.rN)("core.InputTypes",()=>p().createActions({list:{asyncResult:!0},get:{asyncResult:!0}})),v=(0,c.Bv)("core.InputTypes",()=>p().createStore({listenables:[i],sourceUrl:"/system/inputs/types",inputTypes:void 0,inputDescriptions:void 0,init(){this.list()},getInitialState(){return{inputTypes:this.inputTypes,inputDescriptions:this.inputDescriptions}},list(){const e=(0,a.Ay)("GET",(0,n.H3)(this.sourceUrl)),o=(0,a.Ay)("GET",(0,n.H3)(`${this.sourceUrl}/all`)),s=Promise.all([e,o]);s.then(([l,u])=>{this.inputTypes=l.types,this.inputDescriptions=u,this.trigger(this.getInitialState())},l=>{d.A.error(`Fetching Input Types failed with status: ${l}`,"Could not retrieve Inputs")}),i.list.promise(s)},get(e){const o=(0,a.Ay)("GET",(0,n.H3)(`${this.sourceUrl}/${e}`));o.catch(s=>{d.A.error(`Fetching input ${e} failed with status: ${s}`,"Could not retrieve input")}),i.get.promise(o)}}))}}]);})();
//# sourceMappingURL=bb8c8232-8815.90638419a9d0336ed33f.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy