PageSourceSearch

https://trueresume.ai/_next/static/chunks/pages/admin/job-sync-dashboard-37493c3258a5e893.js

js trueresume.ai collected 2026-10-02 01:12:50 UTC 12,357 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3080],{38174:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/job-sync-dashboard",function(){return s(76357)}])},52217:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]])},39200:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},60493:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},61258:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},89354:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},44976:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},90437:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]])},9475:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(63759).Z)("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},76357:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return j}});var a=s(85893),r=s(67294),n=s(9008),l=s.n(n),c=s(11163),i=s(85412),d=s(67694),o=s(39200),x=s(61258),h=s(44976),m=s(52217),u=s(89354),b=s(60493),g=s(9475),p=s(90437),y=s(34155);function j(){let{theme:e}=(0,d.F)(),t=(0,c.useRouter)(),[s,n]=(0,r.useState)(null),[j,N]=(0,r.useState)(!0),[w,k]=(0,r.useState)(""),[S,Z]=(0,r.useState)(""),F=async()=>{try{let e=await fetch("/api/jobs/sync-status"),t=await e.json();t.success?(n(t),k("")):k("Failed to fetch status")}catch(e){k("Error fetching sync status"),console.error(e)}finally{N(!1)}};(0,r.useEffect)(()=>{let e=localStorage.getItem("admin_key");if(!e){t.push("/admin");return}Z(e),F();let s=setInterval(F,3e5);return()=>clearInterval(s)},[t]);let C=async()=>{N(!0);try{let e=await fetch("/api/jobs/sync",{method:"POST",headers:{Authorization:"Bearer ".concat(y.env.NEXT_PUBLIC_CRON_SECRET),"Content-Type":"application/json"}}),t=await e.json();t.success?(alert("Sync completed!\nFetched: ".concat(t.stats.fetched,"\nInserted: ").concat(t.stats.inserted,"\nUpdated: ").concat(t.stats.updated)),F()):alert("Sync failed: "+t.error)}catch(e){alert("Error triggering sync")}finally{N(!1)}};return j&&!s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l(),{children:(0,a.jsx)("title",{children:"Scraper Dashboard - Admin"})}),(0,a.jsx)(i.Z,{}),(0,a.jsx)("div",{className:"min-h-screen pt-16 flex items-center justify-center ".concat("dark"===e?"bg-[#030303]":"bg-transparent"),children:(0,a.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})})]}):w?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l(),{children:(0,a.jsx)("title",{children:"Scraper Dashboard - Admin"})}),(0,a.jsx)(i.Z,{}),(0,a.jsx)("div",{className:"min-h-screen pt-16 flex items-center justify-center ".concat("dark"===e?"bg-[#030303]":"bg-transparent"),children:(0,a.jsxs)("div",{className:"glass rounded-2xl p-6 shadow-premium border-l-4 border-red-500",children:[(0,a.jsx)(o.Z,{className:"w-8 h-8 text-red-500 mb-2"}),(0,a.jsx)("p",{className:"text-red-600",children:w}),(0,a.jsx)("button",{onClick:F,className:"mt-4 btn-premium",children:"Retry"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l(),{children:(0,a.jsx)("title",{children:"Scraper Dashboard - Admin"})}),(0,a.jsx)(i.Z,{}),(0,a.jsxs)("div",{className:"min-h-screen pt-16 ".concat("dark"===e?"bg-[#030303]":"bg-transparent"),children:[(0,a.jsx)("div",{className:"border-b ".concat("dark"===e?"bg-[#1A1A1B] border-[#343536]":"bg-white  border-[#
1EDEFF1]"),children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("button",{onClick:()=>t.push("/admin"),className:"p-2 rounded-lg ".concat("dark"===e?"hover:bg-[#272729]":"hover:bg-gray-100"),children:(0,a.jsx)(x.Z,{className:"w-5 h-5"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-sharp text-3xl font-bold",style:{fontFamily:"Rajdhani, sans-serif"},children:"Scraper Dashboard"}),(0,a.jsx)("p",{className:"text-sm mt-1 ".concat("dark"===e?"text-[#818384]":"text-gray-600"),children:"Real-time job sync monitoring"})]})]}),(0,a.jsxs)("button",{onClick:C,disabled:j,className:"btn-premium flex items-center gap-2 disabled:opacity-50",children:[(0,a.jsx)(h.Z,{className:"w-5 h-5 ".concat(j?"animate-spin":"")}),"Manual Sync"]})]})})}),(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,a.jsx)("div",{className:"glass border-2 rounded-2xl p-6 mb-8 shadow-premium ".concat((t=>{if("dark"===e)switch(t){case"healthy":return"bg-green-500/20 text-green-400 border-green-500/30";case"warning":return"bg-[#FF4500]/20 text-yellow-400 border-yellow-500/30";case"critical":return"bg-red-500/20 text-red-400 border-red-500/30";default:return"bg-gray-500/20 text-gray-400 border-gray-500/30"}else switch(t){case"healthy":return"bg-green-100 text-green-800 border-green-300";case"warning":return"bg-[#FFF1EE] text-[#CC3700] border-yellow-300";case"critical":return"bg-red-100 text-red-800 border-red-300";default:return"bg-gray-100 text-gray-800 border-gray-300"}})(s.health.status)," ").concat("dark"===e?"glass-dark":""),children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-xl font-bold mb-2 flex items-center gap-2",children:[(0,a.jsx)(m.Z,{className:"w-6 h-6"}),"System Health: ",s.health.status.toUpperCase()]}),(0,a.jsxs)("p",{className:"text-lg",children:["Score: ",s.health.score,"/100"]}),s.health.issues.length>0&&(0,a.jsx)("ul",{className:"mt-2 space-y-1",children:s.health.issues.map((e,t)=>(0,a.jsxs)("li",{className:"text-sm flex items-center gap-2",children:[(0,a.jsx)(o.Z,{className:"w-4 h-4"}),e]},t))})]}),s.lastSync&&(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("p",{className:"text-sm",children:"Last Sync"}),(0,a.jsx)("p",{className:"font-semibold",children:new Date(s.lastSync.lastUpdated).toLocaleString()}),(0,a.jsxs)("p",{className:"text-xs mt-1",children:["Source: ",s.lastSync.source]})]})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 mb-8",children:[(0,a.jsx)(f,{title:"Total Jobs",value:s.overview.total.toLocaleString(),icon:(0,a.jsx)(u.Z,{className:"w-6 h-6"}),theme:e}),(0,a.jsx)(f,{title:"Active Jobs",value:s.overview.active.toLocaleString(),icon:(0,a.jsx)(b.Z,{className:"w-6 h-6"}),color:"green",theme:e}),(0,a.jsx)(f,{title:"Inactive Jobs",value:s.overview.inactive.toLocaleString(),icon:(0,a.jsx)(g.Z,{className:"w-6 h-6"}),color:"gray",theme:e}),(0,a.jsx)(f,{title:"Stale Jobs",value:s.overview.stale.toLocaleString(),icon:(0,a.jsx)(o.Z,{className:"w-6 h-6"}),color:"yellow",theme:e})]}),(0,a.jsxs)("div",{className:"glass rounded-2xl p-6 mb-8 shadow-premium ".concat("dark"===e?"glass-dark":""),children:[(0,a.jsxs)("h2",{className:"text-xl font-bold mb-4 flex items-center gap-2",children:[(0,a.jsx)(p.Z,{className:"w-6 h-6"}),"Recent Activity"]}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm ".concat("dark"===e?"text-[#818384]":"text-gray-600"),children:"Last Hour"}),(0,a.jsx)("p",{className:"text-3xl font-bold text-sharp text-blue-600",children:s.recentActivity.lastHour})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm ".concat("dark"===e?"text-[#818384]":"text-gray-600"),children:"Last 24 Hours"}),(0,a.jsx)("p",{className:"text-3xl font-bold text-sharp text-blue-600",children:s.recentActivity.last24Hours})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm ".concat("dark"===e?"text-[#818384]":"text-gray-600"),children:"New Jobs (24h)"}),(0,a.jsx)("p",{className:"text-3xl font-bold text-sharp text-green-600",children:s.recentActivity.newJobsLast24Hours})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:[(0,a.jsx)(v,{title:"Jobs by Source",data:s.distribution.bySource,total:s.overview.active,theme:e}),(0,a.jsx)(v,{title:"Jobs by ATS System",data:s.distribution.byATS,total:s.overview.active,theme:e}),(0,a.jsx)(v,{title:"Jobs by Location Type",data:s.distribution.byLocationType,total:s.overview.active,theme:e}),(0,a.jsx)(v,{title:"Jobs by Experience Level",data:s.distribution.byExperience,total:s.overview.active,theme:e})]}),(0,a.jsxs)("div",{className:"glass rounded-2xl p-6 shadow-premium ".concat("dark"===e?"glass-dark":""),children:[(0,a.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Top Companies Hiring"}),(0,a.jsx)("div",{className:"space-y-3",children:s.topCompanies.map((t,r)=>(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("span",{className:"text-lg font-bold ".concat("dark"===e?"text-[#818384]":"text-gray-400"),children:["#",r+1]}),(0,a.jsx)("span",{className:"font-medium",children:t._id})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-32 rounded-full h-2 ".concat("dark"===e?"bg-[#343536]":"bg-gray-200"),children:(0,a.jsx)("div",{className:"bg-blue-600 h-2 rounded-full",style:{width:"".concat(t.count/s.topCompanies[0].count*100,"%")}})}),(0,a.jsx)("span",{className:"font-semibold w-12 text-right",children:t.count})]})]},r))})]})]})]})]})}function f(e){let{title:t,value:s,icon:r,color:n="blue",theme:l}=e;return(0,a.jsxs)("div",{className:"glass border-2 rounded-2xl p-6 shadow-premium ".concat({blue:"dark"===l?"border-blue-500/30 bg-blue-500/10":"border-blue-200 bg-blue-50",green:"dark"===l?"border-green-500/30 bg-green-500/10":"border-green-200 bg-green-50",yellow:"dark"===l?"border-yellow-500/30 bg-[#FF4500]/10":"border-yellow-200 bg-[#FFF1EE]",gray:"dark"===l?"border-gray-500/30 bg-gray-500/10":"border-gray-200 bg-gray-50"}[n]," ").concat("dark"===l?"glass-dark":""),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium ".concat("dark"===l?"text-[#818384]":"text-gray-600"),children:t}),(0,a.jsx)("span",{className:{blue:"text-blue-500",green:"text-green-500",yellow:"text-[#FF4500]",gray:"text-gray-500"}[n],children:r})]}),(0,a.jsx)("p",{className:"text-3xl font-bold text-sharp",children:s})]})}function v(e){let{title:t,data:s,total:r,theme:n}=e;return(0,a.jsxs)("div",{className:"glass rounded-2xl p-6 shadow-premium ".concat("dark"===n?"glass-dark":""),children:[(0,a.jsx)("h3",{className:"text-lg font-bold mb-4",children:t}),(0,a.jsx)("div",{className:"space-y-3",children:s.slice(0,5).map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-medium",children:e._id||"Unknown"}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-24 rounded-full h-2 ".concat("dark"===n?"bg-[#343536]":"bg-gray-200"),children:(0,a.jsx)("div",{className:"bg-blue-600 h-2 rounded-full",style:{width:"".concat(e.count/r*100,"%")}})}),(0,a.jsx)("span",{className:"text-sm font-semibold w-12 text-right",children:e.count})]})]},t))})]})}}},function(e){e.O(0,[4968,1296,5412,2888,9774,179],function(){return e(e.s=38174)}),_N_E=e.O()}]);

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.