web-interface.assets.07ba022f-7516.319b3ee95941d8a257be.js Maven / Gradle / Ivy
(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["07ba022f-7516"],{sOLBHnFn:S=>{var I={utf8:{stringToBytes:function(l){return I.bin.stringToBytes(unescape(encodeURIComponent(l)))},bytesToString:function(l){return decodeURIComponent(escape(I.bin.bytesToString(l)))}},bin:{stringToBytes:function(l){for(var e=[],i=0;i{(function(){var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l={rotl:function(e,i){return e<>>32-i},rotr:function(e,i){return e<<32-i|e>>>i},endian:function(e){if(e.constructor==Number)return l.rotl(e,8)&16711935|l.rotl(e,24)&4278255360;for(var i=0;i0;e--)i.push(Math.floor(Math.random()*256));return i},bytesToWords:function(e){for(var i=[],c=0,T=0;c>>5]|=e[c]<<24-T%32;return i},wordsToBytes:function(e){for(var i=[],c=0;c>>5]>>>24-c%32&255);return i},bytesToHex:function(e){for(var i=[],c=0;c>>4).toString(16)),i.push((e[c]&15).toString(16));return i.join("")},hexToBytes:function(e){for(var i=[],c=0;c>>6*(3-E)&63)):i.push("=");return i.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/ig,"");for(var i=[],c=0,T=0;c>>6-T*2);return i}};S.exports=l})()},tEZsXsVa:(S,I,l)=>{"use strict";l.d(I,{Z:()=>n});var e=l("Z7aTuO5B"),i=l("ii0bleBb"),c=l.n(i),T=l("J6y4/h8P"),E=l("eOHTbxJi"),g=l("/GOzvPf6"),p=l("/7OuCFNo"),r=l("uZqmR+ju");const L=(0,T.default)(g.Ow)`
margin-top: 10px;
`,a=({loadMessage:o,children:m,loading:h})=>{const f=(0,p.Z)();return e.createElement("div",null,e.createElement("form",{className:"form-inline message-loader-form",onSubmit:o},m,e.createElement(L,{submitButtonText:"Load message",isSubmitting:h,submitLoadingText:"Loading message...",isAsyncSubmit:!0,displayCancel:!0,onCancel:()=>f.goBack()})))},t=(o,m,h)=>{const[f,u]=(0,e.useState)(!1),y=(0,e.useCallback)((C,P)=>{if(C===""||P==="")return;u(!0);const _=E.q.loadMessage(P,C);_.then(A=>h(A)),_.finally(()=>u(!1))},[h]);return(0,e.useEffect)(()=>{o&&m&&y(o,m)},[o,m,y]),[f,y]},s=({hidden:o,hideText:m,onMessageLoaded:h,messageId:f,index:u})=>{const[y,C]=(0,e.useState)(o),[P,_]=(0,e.useState)(f),A=(0,e.useCallback)(d=>_(d.target.value),[]),x=(0,e.useRef)(),[F,U]=(0,e.useState)(u),O=(0,e.useCallback)(d=>U(d.target.value),[]),[K,R]=t(f,u,h),M=(0,e.useCallback)(d=>{d!=null&&d.preventDefault&&d.preventDefault(),R(P,F)},[F,R,P]),D=(0,e.useCallback)(()=>{C(!y)},[y]);return(0,e.useEffect)(()=>{!y&&x.current&&x.current.focus()},[y]),e.createElement("div",{className:"message-loader"},m||e.createElement("p",null,"Wrong example? ",e.createElement(r.Button,{bsSize:"sm",onClick:D},"Load another message")),y||e.createElement(a,{loading:K,loadMessage:M},e.createElement("input",{ref:x,type:"text",className:"form-control message-id-input",placeholder:"Message ID",required:!0,value:P,onChange:A}),e.createElement("input",{type:"text",className:"form-control",placeholder:"Index",required:!0,value:F,onChange:O})))};s.propTypes={hidden:c().bool,hideText:c().bool,onMessageLoaded:c().func.isRequired,messageId:c().string,index:c().string},s.defaultProps={hidden:!0,hideText:!1,messageId:"",index:""};const n=s},Lpa6AnJn:(S,I,l)=>{"use strict";l.d(I,{Z:()=>h});var e=l("Z7aTuO5B"),i=l("ii0bleBb"),c=l.n(i),T=l("J6y4/h8P"),E=l("VPaD/Np4"),g=l.n(E),p=l("uZqmR+ju"),r=l("dsvqAVKU");const L=T.default.div`
display: flex;
flex-wrap: wrap;
.form-group {
margin: 0 15px 0 0;
}
`,a=(0,T.default)(p.Input)`
min-width: 400px;
`,t="placeholder",s=({id:f,title:u,type:y})=>e.createElement("option",{key:f,value:f},u," (",y,")"),n=(f,u)=>f.title.localeCompare(u.title),o=({input:{type:f,title:u}})=>e.createElement(a,{id:`${f}-select`,type:"select",disabled:!0},e.createElement("option",null,`${u} (${f})`)),m=({disabled:f,inputs:u,onLoadMessage:y,preselectedInputId:C,title:P})=>{const[_,A]=(0,e.useState)(C||t),x=(0,e.useCallback)(O=>A(O.target.value),[]),F=(0,e.useCallback)(()=>y(_),[y,_]),U=(0,e.useMemo)(()=>u==null?void 0:u.get(C),[u,C]);if(U)return e.createElement(L,null,e.createElement(o,{input:U}),e.createElement(p.Button,{bsStyle:"info",disabled:_===t,onClick:F},P));if(u){const O=u.sort(n).map(s);return e.createElement(L,null,e.createElement(a,{id:"placeholder-select",type:"select","aria-label":"server input select",value:_,onChange:x,placeholder:t},e.createElement("option",{value:t},"Select an Input"),O.toArray()),e.createElement(p.Button,{bsStyle:"info",disabled:f||_===t,onClick:F},P))}return e.createElement(r.Z,null)};m.propTypes={inputs:i.object,title:i.string.isRequired,preselectedInputId:i.string,onLoadMessage:i.func,disabled:i.bool},m.defaultProps={inputs:E.Map(),onLoadMessage:()=>{},preselectedInputId:void 0,disabled:!1};const h=m},"mihjYJ2+":(S,I,l)=>{"use strict";l.d(I,{Z:()=>R});var e=l("Z7aTuO5B"),i=l("ii0bleBb"),c=l.n(i),T=l("VPaD/Np4"),E=l("uZqmR+ju"),g=l("8fnsnG21"),p=l("wzrLaWZc"),r=l("tEZsXsVa"),L=l("pUKP3+Pg"),a=l("yEuO7gC5"),t=l("IoWmmmFK"),s=l("J6y4/h8P"),n=l("RCNj0OY4"),o=l("Lpa6AnJn"),m=l("jAGDuYSC"),h=l("053yNwrM"),f=l("Zjqu55uh");const u=s.default.div`
margin-top: 5px;
`,y=s.default.p`
margin-bottom: 0.5em;
`,C=(0,s.default)(E.Input)`
width: 200px;
`,P=({selectedInputId:M,inputs:D,onChange:d,isLoading:v})=>e.createElement("fieldset",null,e.createElement(y,null,M?'Click on "Load Message" to load the most recent message received by this input within the last hour.':'Select an Input from the list below and click "Load Message" to load the most recent message received by this input within the last hour.'),e.createElement(o.Z,{inputs:D,preselectedInputId:M,onLoadMessage:d,title:v?"Loading message...":"Load Message",disabled:v})),_=({selectedInputId:M,onChange:D,isLoading:d})=>{const{ForwarderInputDropdown:v}=(0,h.Z)();return e.createElement("fieldset",null,e.createElement(y,null,'Select an Input profile from the list below then select an then select an Input and click on "Load message" to load most recent message received by this input within the last hour.'),e.createElement(E.Row,null,e.createElement(E.Col,{md:8},e.createElement(v,{onLoadMessage:D,title:d?"Loading message...":"Load Message",preselectedInputId:M,loadButtonDisabled:d}))))},A=({inputs:M,onMessageLoaded:D,selectedInputId:d})=>{const[v,B]=(0,e.useState)(!1),{ForwarderInputDropdown:Z}=(0,h.Z)(),[W,H]=(0,e.useState)(Z?void 0:"server"),Y=n.Z.isCloud();(0,e.useEffect)(()=>{d&&M&&H(M!=null&&M.get(d)?"server":"forwarder")},[M,d]);const V=b=>{const J=M&&M.get(b);if(W==="server"&&!J){m.Z.error(`Invalid input selected: ${b}`,`Could not load message from invalid Input ${b}`);return}B(!0);const N=f.S.search("relative",`gl2_source_input:${b} OR gl2_source_radio_input:${b}`,{range:3600},void 0,1,void 0,void 0,void 0,!1);N.then(w=>{w.total_results>0?D(w.messages[0]):(m.Z.error("Input did not return a recent message."),D(void 0))}),N.finally(()=>B(!1))};return Y?e.createElement(u,null,e.createElement(_,{selectedInputId:d,onChange:V,isLoading:v})):e.createElement(u,null,Z?e.createElement(e.Fragment,null,e.createElement("fieldset",null,e.createElement(y,null,"Select the Input type you want to load the message from."),e.createElement(C,{id:"inputTypeSelect","aria-label":"input type select",type:"select",value:W!=null?W:"placeholder",disabled:!!d,onChange:b=>H(b.target.value)},e.createElement("option",{value:"placeholder",disabled:!0},"Select an Input type"),e.createElement("option",{value:"server"},"Server Input"),e.createElement("option",{value:"forwarder"},"Forwarder Input"))),W==="server"&&e.createElement(P,{selectedInputId:d,inputs:M,onChange:V,isLoading:v}),W==="forwarder"&&e.createElement(_,{selectedInputId:d,onChange:V,isLoading:v})):e.createElement(P,{selectedInputId:d,inputs:M,onChange:V,isLoading:v}))};A.propTypes={inputs:c().object,onMessageLoaded:c().func.isRequired,selectedInputId:c().string},A.defaultProps={inputs:void 0,selectedInputId:void 0};const x=A;var F=Object.defineProperty,U=(M,D,d)=>D in M?F(M,D,{enumerable:!0,configurable:!0,writable:!0,value:d}):M[D]=d,O=(M,D,d)=>(U(M,typeof D!="symbol"?D+"":D,d),d);class K extends e.Component{constructor(D){super(D),O(this,"TAB_KEYS",{recent:1,messageId:2,raw:3}),O(this,"onMessageLoaded",d=>{this.setState({message:d});const{onMessageLoaded:v}=this.props;v&&v(d)}),O(this,"loadData",()=>{a.x.list(),L.ZP.listStreams().then(d=>{const v={};d.forEach(B=>{v[B.id]=B}),this.setState({streams:T.Map(v)})})}),O(this,"_isTabVisible",d=>{const{tabs:v}=this.props;return v===d||v.indexOf(d)!==-1}),O(this,"_getActiveTab",()=>{const{activeTab:d}=this.state;if(d)return d;const{messageId:v,index:B}=this.props;return this._isTabVisible("messageId")&&v&&B?this.TAB_KEYS.messageId:this._isTabVisible("recent")?this.TAB_KEYS.recent:this._isTabVisible("messageId")?this.TAB_KEYS.messageId:this.TAB_KEYS.raw}),O(this,"_changeActiveTab",d=>{const{activeTab:v}=this.state;v!==d&&this.setState({activeTab:d,message:void 0})}),O(this,"_formatMessageLoaders",()=>{const d=[];if(this._isTabVisible("recent")){const{inputs:v,selectedInputId:B}=this.props;d.push(e.createElement(E.Tab,{key:"recent",eventKey:this.TAB_KEYS.recent,title:"Recent Message",style:{marginBottom:10}},e.createElement(x,{inputs:v,selectedInputId:B,onMessageLoaded:this.onMessageLoaded})))}if(this._isTabVisible("messageId")){const{messageId:v,index:B}=this.props;d.push(e.createElement(E.Tab,{key:"messageId",eventKey:this.TAB_KEYS.messageId,title:"Message ID",style:{marginBottom:10}},e.createElement("div",{style:{marginTop:5,marginBottom:15}},"Please provide the id and index of the message that you want to load in this form:"),e.createElement(r.Z,{messageId:v,index:B,onMessageLoaded:this.onMessageLoaded,hidden:!1,hideText:!0})))}return this._isTabVisible("raw")&&d.push(e.createElement(E.Tab,{key:"raw",eventKey:this.TAB_KEYS.raw,title:"Raw Message",style:{marginBottom:10}},e.createElement("div",{style:{marginTop:5,marginBottom:15}},"Load a message from text, as if it was sent by a log source."),e.createElement(t.Z,{onMessageLoaded:this.onMessageLoaded}))),d}),this.state={activeTab:void 0,message:void 0}}componentDidMount(){this.loadData()}render(){const{streams:D,message:d}=this.state,{customFieldActions:v,inputs:B}=this.props,Z=d&&B?e.createElement(E.Col,{md:12},e.createElement(p.Z,{message:d,inputs:B,streams:D,customFieldActions:v})):null;return e.createElement("div",null,e.createElement(E.Tabs,{id:"loaderTabs",activeKey:this._getActiveTab(),onSelect:this._changeActiveTab,animation:!1},this._formatMessageLoaders()),Z)}}K.propTypes={tabs:c().oneOfType([c().oneOf(["recent","messageId","raw"]),c().arrayOf(c().oneOf(["recent","messageId","raw"]))]),messageId:c().string,index:c().string,onMessageLoaded:c().func,selectedInputId:c().string,customFieldActions:c().node,inputs:c().object},K.defaultProps={tabs:["recent","messageId"],index:void 0,messageId:void 0,onMessageLoaded:void 0,selectedInputId:void 0,customFieldActions:void 0,inputs:void 0};const R=(0,g.Z)(K,{inputs:a.Q},({inputs:{inputs:M}})=>({inputs:M?T.Map(a.Q.inputsAsMap(M)):void 0}))},Zjqu55uh:(S,I,l)=>{"use strict";l.d(I,{S:()=>n});var e=l("JnTtTRmZ"),i=l.n(e),c=l("kqAR+wt5"),T=l.n(c),E=l("DD8nok+7"),g=l.n(E),p=l("mr1MxJ4D"),r=l("MdYBRjRJ"),L=l("U1Iufsob"),a=l("eFxcQyPT"),t=l("IA3Ku5lS"),s=l("nxMFMmDQ");const n=(0,t.dS)("core.UniversalSearch",()=>i().createStore({DEFAULT_LIMIT:150,listenables:[],search(o,m,h,f,u,y,C,P,_){const A=n.extractTimeRange(o,h),x=u||this.DEFAULT_LIMIT,F=(y-1)*x,U=r.DC(L.Z.UniversalSearchApiController.search(o,m,A,f,x,F,C,P,_).url);return(0,a.ZP)("GET",U).then(O=>{const K=T().extend({},O);return K.fields=O.fields.map(R=>({hash:g()(R),name:R,standard_selected:R===s.ZA||R===s.N1})),K.messages=K.messages.map(R=>p.Z.formatMessageSummary(R)),K})}}));n.extractTimeRange=(o,m)=>o==="relative"?{range:m.range||m.relative}:m},"wHlq+VTP":S=>{/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh
* @license MIT
*/S.exports=function(e){return e!=null&&(I(e)||l(e)||!!e._isBuffer)};function I(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function l(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&I(e.slice(0,0))}},"DD8nok+7":(S,I,l)=>{(function(){var e=l("VSirzn3w"),i=l("sOLBHnFn").utf8,c=l("wHlq+VTP"),T=l("sOLBHnFn").bin,E=function(g,p){g.constructor==String?p&&p.encoding==="binary"?g=T.stringToBytes(g):g=i.stringToBytes(g):c(g)?g=Array.prototype.slice.call(g,0):!Array.isArray(g)&&g.constructor!==Uint8Array&&(g=g.toString());for(var r=e.bytesToWords(g),L=g.length*8,a=1732584193,t=-271733879,s=-1732584194,n=271733878,o=0;o>>24)&16711935|(r[o]<<24|r[o]>>>8)&4278255360;r[L>>>5]|=128<>>9<<4)+14]=L;for(var m=E._ff,h=E._gg,f=E._hh,u=E._ii,o=0;o>>0,t=t+C>>>0,s=s+P>>>0,n=n+_>>>0}return e.endian([a,t,s,n])};E._ff=function(g,p,r,L,a,t,s){var n=g+(p&r|~p&L)+(a>>>0)+s;return(n<>>32-t)+p},E._gg=function(g,p,r,L,a,t,s){var n=g+(p&L|r&~L)+(a>>>0)+s;return(n<>>32-t)+p},E._hh=function(g,p,r,L,a,t,s){var n=g+(p^r^L)+(a>>>0)+s;return(n<>>32-t)+p},E._ii=function(g,p,r,L,a,t,s){var n=g+(r^(p|~L))+(a>>>0)+s;return(n<>>32-t)+p},E._blocksize=16,E._digestsize=16,S.exports=function(g,p){if(g==null)throw new Error("Illegal argument "+g);var r=e.wordsToBytes(E(g,p));return p&&p.asBytes?r:p&&p.asString?T.bytesToString(r):e.bytesToHex(r)}})()}}]);})();
//# sourceMappingURL=07ba022f-7516.319b3ee95941d8a257be.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy