PageSourceSearch

https://app.webability.io/assets/index-CucYwUhC.js

js webability.io collected 2026-10-02 09:59:00 UTC 5,705 bytes, 1 lines download raw bytes

1import{r as a,j as e}from"./vendor-CXh69xiq.js";import{i as v}from"./index-BVVRvbjs.js";import"./app-vendor-nlFuy7bi.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"app-build-1790920293420"};var r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="c8603abf-b486-49b1-8ef6-c03a7fb41e29",s._sentryDebugIdIdentifier="sentry-dbid-c8603abf-b486-49b1-8ef6-c03a7fb41e29")}catch{}})();const y=1e4,g={hosted:"bg-blue-100 text-blue-800",local:"bg-gray-100 text-gray-700"};function w(s){return s===null?"—":s<1e3?`${s}ms`:`${(s/1e3).toFixed(1)}s`}function S(s){const r=new Date(s);return Number.isNaN(r.getTime())?s:r.toLocaleString()}function k(){const[s,r]=a.useState([]),[h,b]=a.useState(""),[d,c]=a.useState("loading"),n=a.useRef(0),i=a.useRef(""),l=a.useCallback(async t=>{const f=v(),m=new URLSearchParams({limit:"100"});i.current&&m.set("search",i.current),t&&n.current&&!i.current&&m.set("afterId",String(n.current));try{const x=await fetch(`https://api.webability.io/mcp/scan-events?${m}`,{headers:f?{Authorization:`Bearer ${f}`}:{},credentials:"include"});if(x.status===401||x.status===403){c("forbidden");return}if(!x.ok){c("error");return}const o=(await x.json()).events??[];if(t&&o.length>=100)return n.current=0,l(!1);o.length>0&&(n.current=Math.max(n.current,...o.map(u=>u.id))),r(u=>{if(!t||i.current)return o;const N=new Set(u.map(p=>p.id));return[...o.filter(p=>!N.has(p.id)),...u].slice(0,500)}),c("ready")}catch{c("error")}},[]);a.useEffect(()=>{l(!1);const t=setInterval(()=>void l(!0),y);return()=>clearInterval(t)},[l]);const j=t=>{t.preventDefault(),i.current=h.trim(),n.current=0,c("loading"),l(!1)};return d==="forbidden"?e.jsxs("div",{className:"py-8",children:[e.jsx("h1",{className:"text-2xl font-semibold text-gray-900 mb-2",children:"MCP Scan Feed"}),e.jsx("p",{className:"text-gray-600",children:"You don't have access to this page."})]}):e.jsxs("div",{className:"py-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:"MCP Scan Feed"}),e.jsx("span",{className:"text-sm text-gray-500","aria-live":"polite",children:d==="loading"?"Loading…":`${s.length} scan${s.length===1?"":"s"} · refreshes every ${y/1e3}s`})]}),e.jsx("p",{className:"text-gray-600 mb-6",children:"Live scanner activity from mcp.webability.io and local MCP installs. Counts only — full results stay on the client."}),e.jsxs("form",{onSubmit:j,className:"mb-4 flex gap-2",children:[e.jsx("label",{htmlFor:"scan-feed-search",className:"sr-only",children:"Filter by URL or tool"}),e.jsx("input",{id:"scan-feed-search",type:"search",value:h,onChange:t=>b(t.target.value),placeholder:"Filter by URL or tool…",className:"border border-input rounded-md px-3 py-2 w-80 focus:outline-hidden focus:ring-2 focus:ring-blue-500"}),e.jsx("button",{type:"submit",className:"bg-blue-600 text-white rounded-md px-4 py-2 hover:bg-blue-700 focus:outline-hidden focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"Filter"})]}),d==="error"&&e.jsx("p",{className:"text-red-600 mb-4",children:"Couldn't load the scan feed. Retrying on the next refresh."}),e.jsx("div",{className:"overflow-x-auto border border-border rounded-lg",children:e.jsxs("table",{className:"min-w-full divide-y divide-border text-sm",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-4 py-3 text-left font-medium text-gray-600",children:"Time"}),e.jsx("th",{scope:"col",className:"px-4 py-3 text-left font-medium text-gray-600",children:"Tool"}),e.jsx("th",{scope:"col",className:"px-4 py-3 text-left font-medium text-gray-600",children:"Target"}),e.jsx("th",{scope:"col",className:"px-4 py-3 text-left font-medium text-gray-600",children:"Source"}),e.jsx("th",{scope:"col",className:"px-4 py-3 text-left font-medium text-gray-600",children:"Result"}),e.jsx("th",{scope:"col",className:"px-4 py-3 text-right font-medium text-gray-600",children:"Issues"}),e.jsx("th",{scope:"col",className:"px-4 py-3 text-right font-medium text-gray-600",children:"Review"}),e.jsx("th",{scope:"col",className:"px-4 py-3 text-right font-medium text-gray-600",children:"Duration"})]})}),e.jsxs("tbody",{className:"divide-y divide-border bg-white",children:[s.length===0&&d==="ready"&&e.jsx("tr",{children:e.jsx("td",{colSpan:8,className:"px-4 py-8 text-center text-gray-500",children:"No scans logged yet."})}),s.map(t=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-gray-700",children:S(t.created_at)}),e.jsx("td",{className:"px-4 py-2 whitespace-nowrap font-mono text-gray-900",children:t.tool}),e.jsx("td",{className:"px-4 py-2 max-w-md truncate text-gray-900",title:t.target,children:t.target}),e.jsx("td",{className:"px-4 py-2 whitespace-nowrap",children:e.jsx("span",{className:`inline-block rounded-full px-2 py-0.5 text-xs font-medium ${g[t.source]??g.local}`,children:t.source})}),e.jsx("td",{className:"px-4 py-2 whitespace-nowrap",children:t.ok?e.jsx("span",{className:"text-green-700",children:"ok"}):e.jsx("span",{className:"text-red-700 font-medium",children:"failed"})}),e.jsxs("td",{className:"px-4 py-2 text-right text-gray-900",children:[t.issues_total??"—",t.issues_critical?e.jsxs("span",{className:"text-red-600",children:[" (",t.issues_critical," crit)"]}):null]}),e.jsx("td",{className:"px-4 py-2 text-right text-gray-700",children:t.issues_incomplete??"—"}),e.jsx("td",{className:"px-4 py-2 text-right text-gray-700",children:w(t.duration_ms)})]},t.id))]})]})})]})}export{k 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.