PageSourceSearch

https://app.snapto.ai/assets/PatternMatchLogList-Dse2LJtd.js

js snapto.ai collected 2026-10-05 15:08:45 UTC 4,875 bytes, 1 lines download raw bytes

1import{C as B,r as i,bp as F,y as G,p as e,L as f,T as N,ak as K,a6 as Z,w as D,ag as V,v as L,B as x,aZ as _}from"./index-C9IH3k-2.js";import{aa as Y,g as J,T as I,aF as Q,ab as U}from"./TemplateUtil-D1DzmWLm.js";import{P as W}from"./PageDescription-BrOUsEZE.js";import{r as X}from"./AuditConstant-C6syQHOu.js";import{P as ee,o as te,g as re,t as ae}from"./PatternMatchLogConstants-DSrDmlTN.js";import{F as se}from"./Table-isZ0WXp4.js";import{D as oe}from"./index-CmSVNJzc.js";import"./Wrapper-ChjuDa3w.js";import"./HelperMethods-C-ewwU_x.js";import"./InfoCircleOutlined-B7sKwm1k.js";import"./index-BOwvFOZJ.js";import"./Pagination-D1z-xPUv.js";import"./HolderOutlined-YOHjCGKZ.js";import"./index-Bv3SRNsl.js";import"./CalendarOutlined-DyzsKNdO.js";import"./ClockCircleOutlined-Cym7vptW.js";const{Text:E}=N,be=()=>{B();const M=i.useRef(null),b=i.useRef(null),[y,u]=i.useState([]),[m,C]=i.useState(!1),[P,p]=i.useState(!0),[S,v]=i.useState(1),[k,R]=i.useState({}),[j,q]=i.useState([{fieldName:"creationTime",dir:"desc"}]),h=i.useCallback(async(a=1,t=!1,r=null,o=null)=>{C(!0);try{const s=r||k,l=o||j,g={search:Object.entries(s).filter(([c,d])=>d?.length>0).map(([c,d])=>({fieldName:c,value:c==="creationTime"?d.map(Y):d})),pagination:{current:a,pageSize:F},order:l},w=await G(ee,g);if(w?.status===200){const c=w.data.results||[];p(c.length>=F),u(t||a===1?c:d=>[...d,...c])}else(t||a===1)&&u([]),p(!1)}catch(s){console.error("Error fetching pattern match logs:",s),(t||a===1)&&u([]),p(!1)}finally{C(!1)}},[k,j]);i.useEffect(()=>{h(1,!0)},[]);const O=(a,t,r)=>{const o={};Object.entries(t||{}).forEach(([l,n])=>{n?.length>0&&(o[l]=n)});let s=j;r?.order&&(s=[{fieldName:r.columnKey,dir:r.order==="descend"?"desc":"asc"}],q(s)),R(o),u([]),v(1),p(!0),h(1,!0,o,s)},A=i.useCallback(a=>
1{if(!b.current)return;const{scrollTop:t,clientHeight:r,scrollHeight:o}=a.target;if(o-t-r<200&&!m&&P){const s=S+1;v(s),h(s,!1)}},[S,P,m,h]),T=(a,t)=>{t()},z=(a,t)=>({filterDropdown:({setSelectedKeys:r,selectedKeys:o,confirm:s,close:l})=>e.jsxs(f,{gap:"small",vertical:!0,style:{padding:8},onKeyDown:n=>n.stopPropagation(),children:[e.jsx(V,{ref:M,placeholder:`Search ${t}`,value:o[0],onChange:n=>r(n.target.value?[n.target.value]:[]),onPressEnter:()=>T(o,s)}),e.jsxs(L,{children:[e.jsx(x,{type:"primary",onClick:()=>T(o,s),icon:e.jsx(_,{}),size:"small",children:"Search"}),e.jsx(x,{type:"link",onClick:()=>l(),size:"small",children:"Close"})]})]})}),H=(a,t)=>({filterDropdown:({setSelectedKeys:r,selectedKeys:o,confirm:s,close:l})=>e.jsxs(f,{gap:"small",vertical:!0,style:{padding:8},onKeyDown:n=>n.stopPropagation(),children:[e.jsx(oe.RangePicker,{presets:[...X],showTime:!0,format:U,onChange:(n,g)=>r(n?[g[0],g[1]]:[])}),e.jsxs(L,{children:[e.jsx(x,{type:"primary",onClick:()=>T(o,s),icon:e.jsx(_,{}),size:"small",children:"Search"}),e.jsx(x,{type:"link",size:"small",onClick:()=>l(),children:"Close"})]})]})}),$=[{title:"ID",dataIndex:"id",key:"id",...z("id","ID"),render:(a,t)=>{const r=te[re(t.logEntries)];return e.jsxs(f,{gap:"small",align:"center",children:[e.jsx(Z,{to:{pathname:`/PatternMatchLogs/${a}`},children:a}),e.jsx(I,{color:r.color,children:r.label})]})}},{title:"Creation Time",dataIndex:"creationTime",key:"creationTime",sorter:!0,...H(),render:(a,t)=>J(t.creationTime)},{title:"Message",dataIndex:["requestInfo","message"],key:"message",ellipsis:!0,render:(a,t)=>{const r=t.requestInfo?.message;return e.jsx(D,{title:r,children:e.jsx(E,{ellipsis:!0,children:ae(r,40)})})}},{title:"Receiver No",dataIndex:["requestInfo","receiverMobileNo"],key:"receiverMobileNo",width:150,render:(a,t)=>{const r=t.requestInfo?.receiverMobileNo;return r?e.jsx(E,{copyable:{text:r},children:r}):"-"}},{title:"Has File",dataIndex:["requestInfo","hasFile"],key:"hasFile",width:100,align:"center",render:(a,t)=>t.requestInfo?.hasFile?e.jsx(D,{title:t.requestInfo?.fileDetail||"File attached",children:e.jsx(I,{color:"blue",icon:e.jsx(Q,{}),children:"Yes"})}):e.jsx(I,{color:"default",children:"No"})}];return e.jsxs(f,{vertical:!0,gap:"large",children:[e.jsx(N.Title,{level:4,style:{margin:0},children:"Template Match Logs"}),e.jsx(W,{children:"View template matching logs from external sources. Each log entry shows request details including message content, receiver number, and file attachment status. Click on any row to view detailed log entries including all processing stages."}),e.jsxs("div",{ref:b,style:{position:"relative",height:"calc(100vh - 280px)",overflow:"hidden",flex:1},children:[e.jsx(se,{rowKey:"id",columns:$,dataSource:y,onChange:O,pagination:!1,loading:m&&y.length===0,onScroll:A,scroll:{y:"calc(100vh - 330px)",x:1e3},style:{tableLayout:"fixed"}}),m&&y.length>0&&e.jsx("div",{style:{textAlign:"center",padding:"16px 0",position:"absolute",bottom:0,width:"100%",background:"rgba(255, 255, 255, 0.9)"},children:e.jsx(K,{tip:"Loading more..."})})]})]})};export{be as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.