web-interface.assets.1255d548-6202.4a3c04565c5925e2b39e.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["1255d548-6202"],{"6Q7xl8L7":(me,B,n)=>{n.r(B),n.d(B,{default:()=>ce});var e=n("Z7aTuO5B"),c=n("/GOzvPf6"),Z=n("D4SbLiE/"),E=n.n(Z),G=n("JnTtTRmZ"),m=n.n(G),u=n("MdYBRjRJ"),d=n("U1Iufsob"),p=n("eFxcQyPT"),w=n("IA3Ku5lS");const y=(0,w.ei)("core.Loggers",()=>m().createActions({loggers:{asyncResult:!0},subsystems:{asyncResult:!0},setSubsystemLoggerLevel:{asyncResult:!0}})),b=(0,w.dS)("core.Loggers",()=>m().createStore({listenables:[y],state:{availableLoglevels:["fatal","error","warn","info","debug","trace"]},init(){this.loggers(),this.subsystems()},getInitialState(){return this.state},loggers(){const t=u.DC(d.Z.ClusterLoggersResource.loggers().url),s=(0,p.ZP)("GET",t).then(l=>(this.state.loggers=l,this.trigger(this.state),l));y.loggers.promise(s)},subsystems(){const t=u.DC(d.Z.ClusterLoggersResource.subsystems().url),s=(0,p.ZP)("GET",t).then(l=>(this.state.subsystems=l,this.trigger(this.state),l));y.loggers.promise(s)},setSubsystemLoggerLevel(t,s,l){const r=u.DC(d.Z.ClusterLoggersResource.setSubsystemLoggerLevel(t,s,l).url),i=(0,p.ZP)("PUT",r);i.then(()=>{this.init()}),y.setSubsystemLoggerLevel.promise(i)}})),x=E()({displayName:"LoggerOverview",mixins:[m().connect(b)],render(){if(!this.state.loggers||!this.state.subsystems)return e.createElement(c.$j,null);const{subsystems:t}=this.state,s=Object.keys(this.state.loggers).map(l=>e.createElement(W,{key:`node-loggers-${l}`,nodeId:l,subsystems:t[l]?t[l].subsystems:{}}));return e.createElement("span",null,s)}});var P=n("ii0bleBb"),o=n.n(P),$=n("13uboeDm"),C=n.n($),a=n("uZqmR+ju"),M=Object.defineProperty,j=(t,s,l)=>s in t?M(t,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[s]=l,z=(t,s,l)=>(j(t,typeof s!="symbol"?s+"":s,l),l);class D extends e.Component{render(){return e.createElement("div",{className:"subsystem-row"},e.createElement(a.Col,{md:6,className:"subsystem",style:{marginBottom:"10px"}},e.createElement("h3",{className:"u-light"},"Subsystem: ",C()(this.props.name),e.createElement(a.ButtonGroup,{className:"pull-right"},e.createElement(K,{nodeId:this.props.nodeId,name:this.props.name,subsystem:this.props.subsystem}))),this.props.subsystem.description,e.createElement("br",{style:{clear:"both"}})))}}z(D,"propTypes",{name:o().string.isRequired,nodeId:o().string.isRequired,subsystem:o().object.isRequired});const A=D;var N=n("BqxuktKK"),T=n("v4GbOr/o"),I=n("HCsT5Gmk");const U=E()({displayName:"LogLevelDropdown",propTypes:{name:o().string.isRequired,nodeId:o().string.isRequired,subsystem:o().object.isRequired,sendTelemetry:o().func.isRequired,location:o().object.isRequired},mixins:[m().connect(b)],_changeLoglevel(t){y.setSubsystemLoggerLevel(this.props.nodeId,this.props.name,t)},_menuLevelClick(t){return s=>{s.preventDefault(),this._changeLoglevel(t),this.props.sendTelemetry(T.A.LOGGING.LOG_LEVEL_EDITED,{app_pathname:(0,u.av)(this.props.location.pathname),app_action_value:"log-level-change",event_details:{value:t}})}},render(){const{subsystem:t,nodeId:s}=this.props,l=this.state.availableLoglevels.map(r=>e.createElement(a.MenuItem,{key:`${t}-${s}-${r}`,active:t.level===r,onClick:this._menuLevelClick(r)},C()(r)));return e.createElement(a.DropdownButton,{id:"loglevel",bsSize:"xsmall",title:C()(t.level)},l)}}),K=(0,I.Z)((0,N.Z)(U));var H=n("9pdI12pI"),R=n.n(H),h=n("woUyHGxd");const F=E()({displayName:"LogLevelMetrics",propTypes:{nodeId:o().string.isRequired,loglevel:o().string.isRequired},mixins:[m().connect(h.q)],componentDidMount(){h.K.add(this.props.nodeId,this._metricName())},componentWillUnmount(){h.K.remove(this.props.nodeId,this._metricName())},_metricName(){return`org.apache.logging.log4j.core.Appender.${this.props.loglevel}`},render(){const{loglevel:t,nodeId:s}=this.props,{metrics:l}=this.state;let r;if(!l||!l[s]||!l[s][this._metricName()])r=e.createElement(c.$j,null);else{const{metric:i}=l[s][this._metricName()];r=e.createElement("dl",{className:"loglevel-metrics-list"},e.createElement("dt",null,"Total written:"),e.createElement("dd",null,e.createElement("span",{className:"loglevel-metric-total"},i.rate.total)),e.createElement("dt",null,"Mean rate:"),e.createElement("dd",null,e.createElement("span",{className:"loglevel-metric-mean"},R()(i.rate.mean).format("0.00"))," / second"),e.createElement("dt",null,"1 min rate:"),e.createElement("dd",null,e.createElement("span",{className:"loglevel-metric-1min"},R()(i.rate.one_minute).format("0.00"))," / second"))}return e.createElement("div",{className:"loglevel-metrics-row"},e.createElement(a.Col,{md:4},e.createElement("h3",{className:"u-light"},"Level: ",C()(t)),r))}}),J=E()({displayName:"LogLevelMetricsOverview",propTypes:{nodeId:o().string.isRequired},mixins:[m().connect(b)],render(){const{nodeId:t}=this.props,s=this.state.availableLoglevels.map(l=>e.createElement(F,{key:`loglevel-metrics-${t}-${l}`,nodeId:t,loglevel:l}));return e.createElement("div",{className:"loglevel-metrics"},s)}}),Q=E()({displayName:"NodeLoggers",propTypes:{nodeId:o().string.isRequired,subsystems:o().object.isRequired,sendTelemetry:o().func.isRequired,location:o().object.isRequired},mixins:[m().connect(h.q)],getInitialState(){return{showDetails:!1}},componentDidMount(){const{nodeId:t}=this.props;h.K.add(t,this.metric_name)},componentWillUnmount(){const{nodeId:t}=this.props;h.K.remove(t,this.metric_name)},metric_name:"org.apache.logging.log4j.core.Appender.all",_formatThroughput(){const{metrics:t}=this.state,{nodeId:s}=this.props;if(t&&t[s]&&t[s][this.metric_name]){const{metric:l}=t[s][this.metric_name];return l.rate.total}return"n/a"},render(){const{nodeId:t,subsystems:s,sendTelemetry:l}=this.props,{showDetails:r}=this.state,i=Object.keys(s).map(g=>e.createElement(A,{name:g,nodeId:t,key:`logging-subsystem-${t}-${g}`,subsystem:s[g]})),f=e.createElement(J,{nodeId:t});return e.createElement(a.Row,{className:"row-sm log-writing-node content"},e.createElement(a.Col,{md:12},e.createElement(c.AE,{permissions:"loggers:read"},e.createElement("div",{style:{marginBottom:"20"}},e.createElement("div",{className:"pull-right"},e.createElement(a.Button,{bsSize:"sm",bsStyle:"primary",className:"trigger-log-level-metrics",onClick:()=>{this.setState({showDetails:!r}),l(T.A.LOGGING.SHOW_LOG_LEVEL_METRICS_TOGGLED,{app_pathname:(0,u.av)(this.props.location.pathname),app_section:"log-level",app_action_value:"show-metrics",event_details:{showing:!r}})}},e.createElement(c.JO,{name:"tachometer-alt"})," ",r?"Hide":"Show"," log level metrics")),e.createElement("h2",null,e.createElement(c.Zv,{nodeId:t}),e.createElement("small",null,"Has written a total of ",e.createElement("strong",null,this._formatThroughput()," internal log messages.")))),e.createElement("div",{className:"subsystems"},i),r&&f)))}}),W=(0,I.Z)((0,N.Z)(Q));var v=n("J6y4/h8P"),Y=n("DUKaTDO2"),S=n("jAGDuYSC");const V=async()=>(0,p.ZP)("GET",(0,u.DC)(d.Z.ClusterSupportBundleController.list().url)),X=async(t,s)=>{try{s(!0),await(0,p.ZP)("POST",(0,u.DC)(d.Z.ClusterSupportBundleController.create().url)),await t()}catch(l){S.Z.error(`Creating the Support Bundle failed with status: ${l}`,"Could not create the Support Bundle.")}finally{s(!1)}},k=async(t,s)=>{try{await(0,p.ZP)("DELETE",(0,u.DC)(d.Z.ClusterSupportBundleController.delete(t).url)),await s()}catch(l){S.Z.error(`Deleting the Support Bundle failed with status: ${l}`,"Could not delete the Support Bundle.")}},q=async t=>{try{window.open((0,u.DC)(d.Z.ClusterSupportBundleController.download(t).url),"_self")}catch(s){S.Z.error(`Downloading the Support Bundle failed with status: ${s}`,"Could not download the Support Bundle.")}},_=()=>{const[t,s]=(0,e.useState)(!1),{data:l,refetch:r}=(0,Y.useQuery)(["supportBundleList","overview"],V,{onError:i=>{S.Z.error(`Loading Support Bundle list failed with status: ${i}`,"Could not load Support Bundle list.")},keepPreviousData:!0});return{isCreating:t,list:l||[],onCreate:()=>X(r,s),onDelete:i=>k(i,r),onDownload:q}};var ee=n("0hhBr0/b");const te=()=>e.createElement(e.Fragment,null,e.createElement("strong",null,"Please examine the bundle content before sharing it. It might contain sensitive data like IP addresses, hostnames or even passwords!"),e.createElement("br",null),"Only paid license users are entitled to use Graylog enterprise support. You may however use this file for other means of debugging."),se=()=>{var t;const l=((t=(0,ee.Z)("supportBundle")[0])==null?void 0:t.EnterpriseSupportBundleInfo)||te;return e.createElement("p",{className:"description"},"Create a zip file which contains useful debugging information from your Graylog cluster.",e.createElement("br",null),"Graylog Enterprise customers can attach bundles to their support ticket, which will help the Graylog technical support team with analyzing and diagnosing issues.",e.createElement("br",null),e.createElement("br",null),l&&e.createElement(l,null))},le=v.default.div`
display: flex;
align-items: center;
justify-content: space-between;
`,O=v.default.td`
text-align: right;
`,ne=v.default.th`
text-align: right;
`,re=v.default.col`
width: 33%;
`,oe=(0,v.default)(a.Button)`
margin-right: 6px;
`,ae=(0,v.default)(c.$j)(({theme:t})=>`
margin-left: 6px;
font-size: ${t.fonts.size.h5};
`),ie=()=>{const{list:t,isCreating:s,onCreate:l,onDelete:r,onDownload:i}=_(),[f,g]=(0,e.useState)(null),ue=L=>e.createElement("tr",{key:L.file_name},e.createElement("td",null,L.file_name),e.createElement(O,null,L.size),e.createElement(O,null,e.createElement(oe,{bsSize:"xsmall",bsStyle:"info",onClick:()=>i(L.file_name)},"Download"),e.createElement(a.Button,{bsSize:"xsmall",bsStyle:"default",onClick:()=>g(L.file_name)},"Delete")));return e.createElement("div",null,e.createElement(a.Row,{className:"content"},e.createElement(a.Col,{xs:12},e.createElement(le,null,e.createElement("h2",null,"Cluster Support Bundle"),e.createElement(a.Button,{bsStyle:"success",onClick:l,disabled:s},"Create Support Bundle",s&&e.createElement(ae,{text:"",delay:0}))),e.createElement(se,null),t.length>0?e.createElement(a.Table,{className:"table-striped table-condensed table-hover"},e.createElement("colgroup",null,e.createElement(re,null)),e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Filename"),e.createElement(ne,null,"Size"))),e.createElement("tbody",null,t.map(ue))):e.createElement(c.pJ,null,"No Support Bundles have been found."))),e.createElement(c.QH,{title:"Delete Support Bundle",show:!!f,onConfirm:()=>{r(f),g(null)},onCancel:()=>g(null)},e.createElement(e.Fragment,null,"Are you sure you want to delete ",e.createElement("strong",null,f),"?")))},ce=()=>e.createElement(c.$4,{title:"Logging"},e.createElement("span",null,e.createElement(c.mr,{title:"Logging"},e.createElement("span",null,"This section controls logging of the Graylog architecture and allows you to change log levels on the fly. Note that log levels are reset to their defaults after you restart the affected service.")),e.createElement(x,null),e.createElement(ie,null)))}}]);})();
//# sourceMappingURL=1255d548-6202.4a3c04565c5925e2b39e.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy