PageSourceSearch

https://blockchain-jobs.lovable.app/assets/JobLinkVerifier-MWLeCSdm.js

js blockchain-jobs.lovable.app collected 2026-10-03 03:24:46 UTC 5,160 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-query-DUCmC_Bj.js";import{r as d}from"./vendor-react-CaN3RTC8.js";import{u as R,A as v,D as V,z as C,B as y}from"./index-BzzKpoj3.js";import{C as w,a as N,b as L,c as $,d as S}from"./card-DuaxMigU.js";import{P as M}from"./progress-YHtOGljo.js";import{C as P}from"./circle-check-big-Be_2pg_g.js";import{D}from"./download-DK1J1261.js";import"./vendor-heavy-LJgKymp8.js";import"./vendor-ui-UAm5eCyr.js";function X(){const[h,p]=d.useState(!1),[j,a]=d.useState(""),[n,u]=d.useState(0),[m,g]=d.useState(0),{toast:b}=R(),T=async()=>{p(!0),a("Starting verification..."),u(0),g(0);try{let s=0;const J=100;let o=0,r=!0,l=0,t=0;for(;r;){t++,a(`Processing batch ${t}... (${o} jobs completed)`),console.log(`Starting batch ${t} at offset ${s}`);const i=await fetch(`https://izfhsdkfxyddxylqprmy.supabase.co/functions/v1/verify-job-links?batch_size=${J}&offset=${s}`,{method:"GET",headers:{Authorization:"Bearer undefined"}});if(!i.ok){const f=await i.text();throw new Error(`HTTP ${i.status}: ${f}`)}l=parseInt(i.headers.get("X-Total-Jobs")||"0");const x=parseInt(i.headers.get("X-Checked")||"0"),k=i.headers.get("X-Has-More"),c=parseInt(i.headers.get("X-Next-Offset")||"0");t===1&&u(l),console.log(`Batch ${t} complete:`,{checked:x,nextOffset:c,totalJobs:n,hasMoreHeader:k,currentOffset:s}),o+=x,g(o),r=k==="true",s=c,(c>=l||!r)&&(console.log("Stopping loop:",{checked:x,nextOffset:c,totalJobs:l,hasMore:r}),r=!1),r&&(a(`Batch ${t} complete. Waiting 1 second before next batch...`),await new Promise(f=>setTimeout(f,1e3)))}a(`Complete! Verified ${o} of ${l} jobs. Results saved to database.`),b({title:"Success",description:`Job links verification complete. Verified ${o} jobs across ${t} batches. Check Link Manager for results.`})}catch(s){console.error("Error verifying links:",s),a(""),b({title:"Error",description:s instanceof Error?s.message:"Failed to verify job links",variant:"destructive"})}finally{p(!1)}};return e.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Job Link Verifier"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"Check all job application links to ensure they point to proper application pages"})]})}),e.jsxs(w,{children:[e.jsxs(N,{children:[e.jsx(L,{children:"Verify Job Application Links"}),e.jsx($,{children:"This tool checks all job listings with external URLs to verify they land on proper application pages. Results are saved to the database for review in the Link Manager."})]}),e.jsxs(S,{className:"space-y-4",children:[e.jsxs(v,{children:[e.jsx(V,{className:"h-4 w-4"}),e.jsxs(C,{children:[e.jsx("strong",{children:"CSV Format:"}),e.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Column 1:"})," Job ID (maps to job_listings.id)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Column 2:"})," Issue description"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Column 3:"})," Faulty address (current URL)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Column 4:"})," Suggested correct address"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Column 5:"})," Status message"]})]})]})]}),h&&n>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{children:["Progress: ",m," / ",n," jobs"]}),e.jsxs("span",{children:[Math.round(m/n*100),"%"]})]}),e.jsx(M,{value:m/n*100})]}),j&&e.jsxs(v,{children:[e.jsx(P,{className:"h-4 w-4"}),e.jsx(C,{children:j})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg space-y-2",children:[e.jsx("h3",{className:"font-semibold",children:"What this checks:"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-sm",children:[e.jsx("li",{children:"Verifies URLs are accessible (no 404s)"}),e.jsx("li",{children:"Checks if links redirect to homepages instead of application pages"}),e.jsx("li",{children:"Detects proper job board URLs (Greenhouse, Lever, etc.)"}),e.jsx("li",{children:"Suggests potential correct URLs when issues are found"})]})]}),e.jsx(y,{onClick:T,disabled:h,size:"lg",className:"w-full",children:h?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Checking Links..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"mr-2 h-4 w-4"}),"Run Verification"]})})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Note:"})," This process may take several minutes depending on the number of job listings. Results are saved to the database and can be managed in the Link Verification Manager."]})]})]}),e.jsxs(w,{children:[e.jsxs(N,{children:[e.jsx(L,{children:"Manage Verified Links"}),e.jsx($,{children:"Review and fix broken links from previous verification runs"})]}),e.jsx(S,{children:e.jsx(y,{variant:"outline",className:"w-full",onClick:()=>window.location.href="/admin/link-manager",children:"Open Link Manager"})})]})]})}export{X 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.