PageSourceSearch

https://postadz.com/assets/AdminGscSubmissions-CB92fKuy.js

js postadz.com collected 2026-10-04 03:36:51 UTC 9,028 bytes, 2 lines download raw bytes

1import{r as a,j as e}from"./react-vendor-CAvUCgBg.js";import{C as m,w as x,x as h,y as b,v as u,B as n,b as f,I as P,s as c,a as d}from"./index-BD5OT4An.js";import{C as H}from"./checkbox-By82b93y.js";import{S as C}from"./skeleton-C1MZj_BZ.js";import{p as D,ab as B,q as v,ai as M,P as F,u as V}from"./icons-B1xxNXCI.js";import"./query-C7ekqVw8.js";import"./class-utils-B2rm_Apj.js";import"./supabase-L6Z3U_Fd.js";import"./radix-5feLYWdW.js";const W={category:"bg-blue-500/15 text-blue-600 dark:text-blue-400",country:"bg-green-500/15 text-green-600 dark:text-green-400",city:"bg-purple-500/15 text-purple-600 dark:text-purple-400","directory-state":"bg-amber-500/15 text-amber-600 dark:text-amber-400",ad:"bg-pink-500/15 text-pink-600 dark:text-pink-400",manual:"bg-muted text-muted-foreground"};function ae(){a.useEffect(()=>{document.title="GSC Submissions · Admin"},[]);const[r,O]=a.useState(null),[S,E]=a.useState([]),[_,G]=a.useState([]),[l,w]=a.useState(new Set),[g,L]=a.useState(!0),[y,R]=a.useState(""),p=async()=>{L(!0);const[{data:s},{data:t},{data:i}]=await Promise.all([c.rpc("gsc_today_stats").single(),c.rpc("gsc_next_batch",{_limit:25}),c.from("gsc_submissions").select("id,url,submitted_at,notes,indexed_at").order("submitted_at",{ascending:!1}).limit(100)]);s&&O(s),t&&E(t),i&&G(i),L(!1)};a.useEffect(()=>{p()},[]);const k=(r==null?void 0:r.remaining)??10,j=a.useMemo(()=>S.slice(0,k),[S,k]),I=a.useMemo(()=>Array.from(l),[l]),A=(s,t)=>{w(i=>{const o=new Set(i);return t?o.add(s):o.delete(s),o})},N=async s=>{s.length&&(await navigator.clipboard.writeText(s.join(`
2`)),d.success(`Copied ${s.length} URL${s.length===1?"":"s"}`))},U=async(s,t)=>{if(!s.length){d.error("Pick at least one URL");return}const{data:i}=await c.auth.getUser(),o=s.map(q=>{var T;return{url:q,submitted_by:(T=i.user)==null?void 0:T.id,notes:t??null}}),{error:z}=await c.from("gsc_submissions").insert(o);if(z){d.error(z.message);return}d.success(`Logged ${s.length} submission${s.length===1?"":"s"}`),w(new Set),R(""),p()},$=async s=>{const t=s.indexed_at?null:new Date().toISOString(),{error:i}=await c.from("gsc_submissions").update({indexed_at:t}).eq("id",s.id);if(i){d.error(i.message);return}d.success(t?"Marked as indexed ✅":"Unmarked"),p()};return e.jsxs("div",{className:"container max-w-5xl py-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Google Search Console Submissions"}),e.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:'Tracks every URL you submit so you never repeat the same batch. Google caps you at 10 manual "Request indexing" per day.'})]}),e.jsxs(m,{className:"border-primary/30 bg-primary/5",children:[e.jsxs(x,{className:"pb-3",children:[e.jsx(h,{className:"text-base flex items-center gap-2",children:"How to use this page (daily, ~3 min)"}),e.jsx(b,{children:"Do this once a day. Google forces the manual part — sorry."})]}),e.jsxs(u,{className:"space-y-3 text-sm",children:[e.jsxs("ol",{className:"list-decimal list-inside space-y-2",children:[e.jsxs("li",{children:["Look at ",e.jsx("strong",{children:`"Today's suggested batch"`})," below. Tick up to ",e.jsx("strong",{children:"10 URLs"})," (start at the top — already prioritized)."]}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:'"Copy all"'})," to copy the selected URLs."]}),e.jsxs("li",{children:["Open Google Search Console, make sure ",e.jsx("strong",{children:"postadz.com"})," is selected, then paste ",e.jsx("strong",{children:"one URL at a time"}),' into the top search bar ("Inspect any URL…") and press Enter.']}),e.jsxs("li",{children:["On the result page, click ",e.jsx("strong",{children:'"Request Indexing"'}),' (top right). Wait for the "added to priority crawl queue" confirmation. Repeat for each of the 10 URLs.']}),e.jsxs("li",{children:["Come back here, make sure the same URLs are still ticked, then click ",e.jsx("strong",{children:'"Mark as submitted"'}),". They'll move to History and never appear again."]}),e.jsx("li",{children:"Done — close the tab. Tomorrow this page will show 10 fresh URLs."})]}),e.jsx(n,{asChild:!0,size:"sm",variant:"outline",children:e.jsxs("a",{href:"https://search.google.com/search-console",target:"_blank",rel:"noopener noreferrer",children:[e.jsx(D,{className:"h-4 w-4 mr-1"})," Open Google Search Console"]})})]})]}),e.jsxs(m,{children:[e.jsx(x,{className:"pb-3",children:e.jsx(h,{className:"text-base",children:"Today's progress (UTC)"})}),e.jsx(u,{children:g||!r?e.jsx(C,{className:"h-8 w-48"}):e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"text-3xl font-bold",children:[r.submitted_today,e.jsxs("span",{className:"text-muted-foreground text-lg",children:[" / ",r.daily_cap]})]}),e.jsx(f,{variant:r.remaining>0?"default":"secondary",children:r.remaining>0?`${r.remaining} slots left today`:"Daily cap reached — come back tomorrow"})]})})]}),e.jsxs(m,{children:[e.jsx(x,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(h,{className:"text-base",children:"Today's suggested batch"}),e.jsx(b,{children:"Fresh URLs you haven't submitted yet, prioritized by SEO value."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(n,{size:"sm",variant:"outline",onClick:p,disabled:g,children:[e.jsx(B,{className:"h-4 w-4 mr-1"})," Refresh"]}),e.jsxs(n,{size:"sm",variant:"outline",onClick:()=>N(j.map(s=>s.url)),disabled:!j.length,children:[e.jsx(v,{className:"h-4 w-4 mr-1"})," Copy all"]})]})]})}),e.jsx(u,{className:"space-y-2",children:g?Array.from({length:5}).map((s,t)=>e.jsx(C,{className:"h-12 w-full"},t)):j.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:k===0?"Daily cap reached. Come back tomorrow.":"No fresh URLs foun
2d — every candidate has been submitted! Add new ads/categories to refill the queue."}):e.jsxs(e.Fragment,{children:[j.map(s=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-accent/30 transition-colors",children:[e.jsx(H,{checked:l.has(s.url),onCheckedChange:t=>A(s.url,!!t)}),e.jsx(f,{variant:"secondary",className:W[s.source]||"",children:s.source}),e.jsx("code",{className:"flex-1 text-xs truncate",children:s.url}),e.jsx(n,{size:"icon",variant:"ghost",onClick:()=>N([s.url]),title:"Copy",children:e.jsx(v,{className:"h-3.5 w-3.5"})}),e.jsx(n,{size:"icon",variant:"ghost",asChild:!0,title:"Open",children:e.jsx("a",{href:s.url,target:"_blank",rel:"noreferrer",children:e.jsx(D,{className:"h-3.5 w-3.5"})})})]},s.url)),e.jsxs("div",{className:"flex items-center justify-between pt-3 border-t mt-3",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.size," selected"]}),e.jsxs(n,{size:"sm",onClick:()=>U(I,"batch"),disabled:l.size===0,children:[e.jsx(M,{className:"h-4 w-4 mr-1"})," Mark ",l.size||""," as submitted"]})]})]})})]}),e.jsxs(m,{children:[e.jsxs(x,{className:"pb-3",children:[e.jsxs(h,{className:"text-base flex items-center gap-2",children:[e.jsx(F,{className:"h-4 w-4"})," Log a custom URL"]}),e.jsx(b,{children:"For URLs you submitted that aren't in the suggested list."})]}),e.jsx(u,{children:e.jsxs("form",{className:"flex gap-2",onSubmit:s=>{s.preventDefault();const t=y.trim();t&&U([t],"manual")},children:[e.jsx(P,{placeholder:"https://postadz.com/...",value:y,onChange:s=>R(s.target.value)}),e.jsx(n,{type:"submit",disabled:!y.trim(),children:"Log"})]})})]}),e.jsxs(m,{children:[e.jsxs(x,{className:"pb-3",children:[e.jsxs(h,{className:"text-base flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4"})," Submission history"]}),e.jsx(b,{children:"Last 100 URLs submitted."})]}),e.jsx(u,{className:"space-y-1",children:g?Array.from({length:5}).map((s,t)=>e.jsx(C,{className:"h-8 w-full"},t)):_.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"No submissions logged yet. Mark URLs above to start tracking."}):_.map(s=>e.jsxs("div",{className:`flex items-center gap-3 py-2 border-b last:border-0 text-sm ${s.indexed_at?"opacity-90":""}`,children:[e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-28 shrink-0",children:[new Date(s.submitted_at).toLocaleDateString()," ",new Date(s.submitted_at).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]}),e.jsx("code",{className:`flex-1 text-xs truncate ${s.indexed_at?"line-through text-muted-foreground":""}`,children:s.url}),s.indexed_at&&e.jsx(f,{className:"bg-green-500/15 text-green-600 dark:text-green-400 text-[10px]",children:"Indexed"}),s.notes&&e.jsx(f,{variant:"outline",className:"text-[10px]",children:s.notes}),e.jsxs(n,{size:"sm",variant:s.indexed_at?"secondary":"outline",onClick:()=>$(s),title:s.indexed_at?"Unmark indexed":"Mark as indexed in Google",children:[e.jsx(M,{className:"h-3.5 w-3.5 mr-1"}),s.indexed_at?"Indexed":"Mark indexed"]}),e.jsx(n,{size:"icon",variant:"ghost",onClick:()=>N([s.url]),children:e.jsx(v,{className:"h-3 w-3"})})]},s.id))})]})]})}export{ae 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.