web-interface.assets.1255d548-7421.a7412cee59c41a56812e.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["1255d548-7421"],{mr1MxJ4D:(I,D,e)=>{e.d(D,{Z:()=>g});var u=e("9oVghaOd"),E=e.n(u),s=e("0+7ljD5O");const g={formatMessageSummary(t){const{message:o}=t;return this.formatMessage(o._id,t.index,o,o,t.highlight_ranges,t.decoration_stats)},formatResultMessage(t){const{message:o}=t;return this.formatMessage(o.id,t.index,o,o.fields,t.highlight_ranges,t.decoration_stats)},formatMessage(t,o,O,P,c,U){const d=s.Z.filterFields(P);return{id:t,timestamp:E()(O.timestamp).unix(),filtered_fields:d,formatted_fields:d,fields:P,index:o,source_node_id:P.gl2_source_node,source_input_id:P.gl2_source_input,stream_ids:O.streams,highlight_ranges:c,decoration_stats:U}}}},ZNpXXpDf:(I,D,e)=>{e.r(D),e.d(D,{default:()=>J});var u=e("ii0bleBb"),E=e.n(u),s=e("Z7aTuO5B"),a=e("VPaD/Np4"),g=e.n(a),t=e("qQvt58D8"),o=e("dsvqAVKU"),O=e("uZqmR+ju"),P=e("GFJVQ2dX"),c=e("fh5GG281"),U=e("c9JM82dZ"),d=e("9kZNWwre"),f=e("hC1XaH+L"),T=e("TkfAb49d"),v=e("pUKP3+Pg"),i=e("yEuO7gC5"),B=e("eOHTbxJi"),K=e("Vg8s2y9S"),C=e("XEgUer9K"),Z=e("NqeDg39C"),p=e("UmnljV2q"),y=e("oMyijaIY");const S=()=>{const[M,n]=(0,s.useState)(),[m,_]=(0,s.useState)();return(0,s.useEffect)(()=>{v.ZP.listStreams().then(r=>{if(r){const l=Object.fromEntries(r.map(A=>[A.id,A]));n(a.Map(l)),_(a.List(r))}})},[n,_]),{streams:M,allStreams:m}},x=(M,n)=>{const[m,_]=(0,s.useState)(),[r,l]=(0,s.useState)(a.Map());return(0,s.useEffect)(()=>{(async()=>{const R=await B.q.loadMessage(M,n);if(_(R),R.source_input_id&&await(0,C.R)(R.fields.gl2_source_node)){const L=await i.x.get(R.source_input_id);if(L){const h=a.Map({[L.id]:L});l(h)}}})()},[M,n,_,l]),{message:m,inputs:r}},F=({streams:M,timestamp:n,children:m})=>{const{data:_}=(0,d.Z)(M,{type:"absolute",from:n,to:n}),r=(0,s.useMemo)(()=>{const l=a.List(_);return{all:l,queryFields:a.Map({query:l})}},[_]);return s.createElement(f.Z.Provider,{value:r},m)},W=({params:{index:M,messageId:n}})=>{if(!M||!n)throw new Error("index and messageId need to be specified!");const{streams:m,allStreams:_}=S(),{message:r,inputs:l}=x(M,n);(0,s.useEffect)(()=>{K.h.list()},[]);const A=(0,s.useMemo)(()=>r!==void 0&&m!==void 0&&l!==void 0&&_!==void 0,[r,m,l,_]),R=(0,s.useMemo)(()=>p.Z.create(),[]),L=(0,s.useMemo)(()=>y.ZP.empty(),[]);if(A){const{streams:h,timestamp:N}=r.fields,X=h.filter(j=>m.has(j));return s.createElement(Z.Z,{view:R,initialQuery:"none",isNew:!1,executionState:L},s.createElement(t.Z,{title:`Message ${n} on ${M}`},s.createElement(O.Row,{className:"content",id:"sticky-augmentations-container"},s.createElement(O.Col,{md:12},s.createElement(T.Z,null,s.createElement(F,{streams:X,timestamp:N},s.createElement(P.Z.Provider,{value:!1},s.createElement(c.Z,{fields:a.List(),streams:m,allStreams:_,disableSurroundingSearch:!0,inputs:l,message:r}))))))))}return s.createElement(o.Z,{"data-testid":"spinner"})};W.propTypes={params:E().exact({index:E().string.isRequired,messageId:E().string.isRequired}).isRequired};const J=(0,U.Z)(W)},c9JM82dZ:(I,D,e)=>{e.d(D,{Z:()=>a});var u=e("Z7aTuO5B"),E=e("yAXMqwrl");const a=g=>t=>{const o=(0,E.useParams)();return u.createElement(g,{...t,params:o})}},eOHTbxJi:(I,D,e)=>{e.d(D,{q:()=>c});var u=e("JnTtTRmZ"),E=e.n(u),s=e("eFxcQyPT"),a=e("mr1MxJ4D"),g=e("U1Iufsob"),t=e("MdYBRjRJ"),o=e("jAGDuYSC"),O=e("TJOheZRu"),P=e("IA3Ku5lS");const c=(0,P.ei)("core.Messages",()=>E().createActions({loadMessage:{asyncResult:!0},fieldTerms:{asyncResult:!0},loadRawMessage:{asyncResult:!0}})),U=(0,P.dS)("core.Messages",()=>E().createStore({listenables:[c],sourceUrl:"",getInitialState(){return{}},loadMessage(d,f){const{url:T}=g.Z.MessagesController.single(d.trim(),f.trim()),v=(0,s.ZP)("GET",t.DC(T)).then(i=>a.Z.formatResultMessage(i),i=>{o.Z.error(`Loading message information failed with status: ${i}`,"Could not load message information")});c.loadMessage.promise(v)},fieldTerms(d,f){const{url:T}=g.Z.MessagesController.analyze(d,encodeURIComponent(O.Z.stringify(f))),v=(0,s.ZP)("GET",t.DC(T)).then(i=>i.tokens,i=>{o.Z.error(`Loading field terms failed with status: ${i}`,"Could not load field terms.")});c.fieldTerms.promise(v)},loadRawMessage(d,f,T,v){const{url:i}=g.Z.MessagesController.parse(),B={message:d,remote_address:f,codec:T,configuration:v},K=(0,s.ZP)("POST",t.DC(i),B).then(C=>a.Z.formatResultMessage(C),C=>{if(C.additional&&C.additional.status===400){o.Z.error("Please ensure the selected codec and its configuration are right. Check your server logs for more information.","Could not load raw message");return}o.Z.error(`Loading raw message failed with status: ${C}`,"Could not load raw message")});c.loadRawMessage.promise(K)}}))}}]);})();
//# sourceMappingURL=1255d548-7421.a7412cee59c41a56812e.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy