PageSourceSearch

https://heypeko.com/assets/AdminIndexSubmissions-BcDxTBQJ.js

js heypeko.com collected 2026-10-10 00:18:36 UTC 8,530 bytes, 1 lines download raw bytes

1import{r as g,j as e,N as I}from"./vendor-react-CpS8flwk.js";import{by as _}from"./app-BR_qaoAt.js";import{S as $}from"./SEO-DC0MZMdj.js";import{T as u}from"./TradingCard-DVo18Gy9.js";import{T as y,a as A,b as h,c as a,d as w,e as i}from"./table-BzEpz3fF.js";function p(x){try{return new Date(x).toLocaleString()}catch{return x}}function L({ok:x,code:b}){return e.jsxs("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium "+(x?"bg-primary/15 text-primary":"bg-destructive/15 text-destructive"),children:[b||"ERR"," ",x?"OK":"FAIL"]})}function M(){var R,v,E;const{user:x,isAdmin:b,loading:T}=_(),[d,O]=g.useState(null),[c,G]=g.useState(null),[l,P]=g.useState(null),[S,k]=g.useState(null);return g.useEffect(()=>{const s=async t=>{const r={updatedAt:null,runs:[]},n=await fetch(t,{cache:"no-store"}),o=n.headers.get("content-type")??"";if(!n.ok||!o.includes("application/json"))return r;try{return await n.json()}catch{return r}};Promise.all([s("/indexnow-submission-log.json"),s("/gsc-sitemap-submission-log.json"),s("/llm-citation-history.json")]).then(([t,r,n])=>{O(t),G(r),P(n)}).catch(t=>k(String(t)))},[]),T?null:x?b?e.jsxs("div",{className:"container mx-auto px-4 py-10 space-y-10",children:[e.jsx($,{title:"Index submission audit — PEKO admin",description:"Audit trail of Bing IndexNow and Google Search Console sitemap submissions per production build.",noindex:!0}),e.jsxs("header",{className:"space-y-2",children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Index submission audit"}),e.jsx("p",{className:"text-muted-foreground",children:"Every production deploy that changed a sitemap pushes URLs to Bing IndexNow and re-submits sitemaps to Google Search Console. This page keeps the last 50 runs for each channel so you can audit what was submitted, when, and what the provider replied."})]}),S?e.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 p-4 text-destructive",children:["Failed to load logs: ",S]}):null,e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("h2",{className:"text-2xl font-semibold",children:"Bing IndexNow"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Updated ",d!=null&&d.updatedAt?p(d.updatedAt):"—"]})]}),(R=d==null?void 0:d.runs)!=null&&R.length?e.jsx(u,{children:e.jsxs(y,{children:[e.jsx(A,{children:e.jsxs(h,{children:[e.jsx(a,{children:"Submitted"}),e.jsx(a,{children:"Sitemaps"}),e.jsx(a,{className:"text-right",children:"Parsed"}),e.jsx(a,{className:"text-right",children:"Submitted"}),e.jsx(a,{children:"Response"})]})}),e.jsx(w,{children:d.runs.map((s,t)=>{var r,n,o,m,j,f,C;return e.jsxs(h,{children:[e.jsx(i,{className:"whitespace-nowrap font-mono text-xs",children:p(s.submittedAt)}),e.jsx(i,{className:"max-w-[280px]",children:e.jsxs("details",{children:[e.jsxs("summary",{className:"cursor-pointer text-xs",children:[((r=s.sourceSitemaps)==null?void 0:r.length)??0," file(s)"]}),e.jsx("ul",{className:"mt-2 space-y-0.5 text-xs text-muted-foreground",children:(n=s.sourceSitemaps)==null?void 0:n.map(N=>e.jsx("li",{className:"font-mono",children:N},N))})]})}),e.jsx(i,{className:"text-right font-mono text-xs",children:s.parsedUrlCount}),e.jsx(i,{className:"text-right font-mono text-xs",children:e.jsxs("details",{children:[e.jsx("summary",{className:"cursor-pointer",children:s.submittedUrlCount}),e.jsx("ul",{className:"mt-2 max-h-64 space-y-0.5 overflow-y-auto text-left text-[11px] text-muted-foreground",children:(o=s.urls)==null?void 0:o.map(N=>e.jsx("li",{className:"font-mono",children:N},N))})]})}),e.jsxs(i,{children:[e.jsx(L,{ok:((m=s.response)==null?void 0:m.status)>=200&&((j=s.response)==null?void 0:j.status)<300,code:((f=s.response)==null?void 0:f.status)??0}),(C=s.response)!=null&&C.body?e.jsx("div",{className:"mt-1 max-w-[220px] truncate font-mono text-[11px] text-muted-foreground",children:s.response.body}):null]})]},`${s.submittedAt}-${t}`)})})]})}):e.jsx(u,{children:e.jsx("p",{className:"p-6 text-muted-foreground",children:"No IndexNow submissions logged yet. The next production deploy that touches a sitemap will record one here."})})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("h2",{className:"text-2xl font-semibold",children:"Google Search Console"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Updated ",c!=null&&c.updatedAt?p(c.updatedAt):"—"]})]}),(v=c==null?void 0:c.runs)!=null&&v.length?e.jsx(u,{children:e.jsxs(y,{children:[e.jsx(A,{children:e.jsxs(h,{children:[e.jsx(a,{children:"Submitted"}),e.jsx(a,{children:"Site"}),e.jsx(a,{className:"text-right",children:"OK"}),e.jsx(a,{className:"text-right",children:"Failed"}),e.jsx(a,{children:"Per-sitemap result"})]})}),e.jsx(w,{children:c.runs.map((s,t)=>{var r,n;return e.jsxs(h,{children:[e.jsx(i,{className:"whitespace-nowrap font-mono text-xs",children:p(s.submittedAt)}),e.jsx(i,{className:"font-mono text-xs",children:s.siteUrl}),e.jsx(i,{className:"text-right font-mono text-xs text-primary",children:s.succeeded}),e.jsx(i,{className:"text-right font-mono text-xs",children:e.jsx("span",{className:s.failed>0?"text-destructive":"text-muted-foreground",children:s.failed})}),e.jsx(i,{children:e.jsxs("details",{children:[e.jsxs("summary",{className:"cursor-pointer text-xs",children:[((r=s.results)==null?void 0:r.length)??0," sitemap(s)"]}),e.jsx("ul",{className:"mt-2 max-h-72 space-y-1 overflow-y-auto text-[11px]",children:(n=s.results)==null?void 0:n.map(o=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(L,{ok:o.ok,code:o.status}),e.jsx("span",{className:"truncate font-mono text-muted-foreground",children:o.feedpath})]},o.feedpath))})]})})]},`${s.submittedAt}-${t}`)})})]})}):e.jsx(u,{children:e.jsxs("p",{className:"p-6 text-muted-foreground",children:["No GSC sitemap submissions logged yet. Configure"," ",e.jsx("code",{children:"LOVABLE_API_KEY"})," and"," ",e.jsx("code",{children:"GOOGLE_SEARCH_CONSOLE_API_KEY"})," as GitHub Actions secrets to enable post-deploy submissions."]})})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("h2",{className:"text-2xl font-semibold",children:"AI citation rate"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Updated ",l!=null&&l.updatedAt?p(l.updatedAt):"—"]})]}),(E=l==null?void 0:l.runs)!=null&&E.length?e.jsx(u,{children:e.jsxs(y,{children:[e.jsx(A,{children:e.jsxs(h,{children:[e.jsx(a,{children:"Run"}),e.jsx(a,{children:"Model"}),e.jsx(a,{className:"text-right",children:"Cited"}),e.jsx(a,{className:"text-right",children:"Rate"}),e.jsx(a,{className:"text-right",children:"Δ vs prev"}),e.jsx(a,{children:"Per market"})]})}),e.jsx(w,{children:l.runs.slice(0,3).map((s,t)=>e.jsxs(h,{children:[e.jsx(i,{className:"whitespace-nowrap font-mono text-xs",children:p(s.generatedAt)}),e.jsx(i,{className:"font-mono text-xs",children:s.model}),e.jsxs(i,{className:"text-right font-mono text-xs",children:[s.citedCount,"/",s.queries]}),e.jsxs(i,{className:"text-right font-mono text-xs text-primary",children:[(s.citationRate*100).toFixed(1),"%"]}),e.jsx(i,{className:"text-right font-mono text-xs text-muted-foreground",children:l.runs[t+1]?`${s.citationRate-l.runs[t+1].citationRate>0?"+":s.citationRate-l.runs[t+1].citationRate<0?"":"±"}${((s.citationRate-l.runs[t+1].citationRate)*100).toFixed(1)}pp`:"—"}),e.jsx(i,{children:e.jsx("ul",{className:"space-y-0.5 text-[11px] font-mono text-muted-foreground",children:Object.entries(s.byMarket??{}).map(([r,n])=>{var j,f;const o=(f=(j=l.runs[t+1])==null?void 0:j.byMarket)==null?void 0:f[r],m=o?(n.citationRate-o.citationRate)*100:null;return e.jsxs("li",{children:[r,": ",n.cited,"/",n.queries," (",(n.citationRate*100).toFixed(0),"%)",m!==null&&e.jsxs("span",{className:"ml-1",children:[m>0?"+":m<0?"":"±",m.toFixed(0),"pp"]})]},r)})})})]},`${s.generatedAt}-${t}`))})]})}):e.jsx(u,{children:e.jsxs("p",{className:"p-6 text-muted-foreground",children:["No citation audit recorded yet. Run the"," ",e.jsx("code",{children:"LLM citation audit"})," workflow manually (or"," ",e.jsx("code",{children:"node scripts/llm-citation-audit.mjs"})," locally) to write a row here once"," ",e.jsx("code",{children:"LOVABLE_API_KEY"})," is configured as a GitHub Actions secret."]})})]})]}):e.jsx(I,{to:"/",replace:!0}):e.jsx(I,{to:"/auth",replace:!0})}export{M 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.