PageSourceSearch

https://www.getvisajobs.com/assets/AdminSystemPage-DGXcpga4.js

js getvisajobs.com collected 2026-10-02 00:49:58 UTC 9,322 bytes, 1 lines download raw bytes

1import{r,a4 as w,a5 as _,a6 as S,k as m,j as e,I as j,J as b,V as $,y as i,A as h,R as p}from"./index-B_t1Maj0.js";import{A as C,S as R}from"./AdminLayout-D9pmMEje.js";const d={completed:{icon:j,color:"text-emerald-400",bg:"bg-emerald-500/20"},running:{icon:p,color:"text-blue-400",bg:"bg-blue-500/20"},failed:{icon:b,color:"text-rose-400",bg:"bg-rose-500/20"},swapping:{icon:p,color:"text-amber-400",bg:"bg-amber-500/20"},pending:{icon:i,color:"text-gray-400",bg:"bg-gray-700"}};function g(l,c){if(!c)return"In progress";const t=new Date(c).getTime()-new Date(l).getTime();return t<1e3?`${t}ms`:t<6e4?`${Math.round(t/1e3)}s`:t<36e5?`${Math.round(t/6e4)}m`:`${(t/36e5).toFixed(1)}h`}function A(){const[l,c]=r.useState([]),[t,y]=r.useState([]),[N,f]=r.useState(!0),[o,u]=r.useState("batch");r.useEffect(()=>{Promise.all([w(),_()]).then(([s,a])=>{c(s),y(a),f(!1)})},[]);const v=[{value:"batch",label:"Batch Job Fetches",icon:S,count:l.length},{value:"company",label:"Company Registry",icon:m,count:t.length}];return e.jsx(C,{children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"System"}),e.jsx("p",{className:"text-gray-500 text-sm mt-1",children:"Backgroun
1d job runs and system health"})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-gray-900/50 border border-gray-800/50 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(R,{className:"w-4 h-4 text-emerald-400"}),e.jsx("span",{className:"text-xs text-gray-500",children:"Batch Runs"})]}),e.jsx("p",{className:"text-xl font-bold text-white",children:l.length})]}),e.jsxs("div",{className:"bg-gray-900/50 border border-gray-800/50 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(j,{className:"w-4 h-4 text-emerald-400"}),e.jsx("span",{className:"text-xs text-gray-500",children:"Completed"})]}),e.jsx("p",{className:"text-xl font-bold text-white",children:l.filter(s=>s.status==="completed").length+t.filter(s=>s.status==="completed").length})]}),e.jsxs("div",{className:"bg-gray-900/50 border border-gray-800/50 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(b,{className:"w-4 h-4 text-rose-400"}),e.jsx("span",{className:"text-xs text-gray-500",children:"Failed"})]}),e.jsx("p",{className:"text-xl font-bold text-white",children:l.filter(s=>s.status==="failed").length+t.filter(s=>s.status==="failed").length})]}),e.jsxs("div",{className:"bg-gray-900/50 border border-gray-800/50 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(m,{className:"w-4 h-4 text-blue-400"}),e.jsx("span",{className:"text-xs text-gray-500",children:"Company Runs"})]}),e.jsx("p",{className:"text-xl font-bold text-white",children:t.length})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:v.map(s=>e.jsxs("button",{onClick:()=>u(s.value),className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all ${o===s.value?"bg-emerald-500/20 text-emerald-400 border border-emerald-500/30":"text-gray-500 hover:text-gray-300 hover:bg-gray-800/50 border border-transparent"}`,children:[e.jsx(s.icon,{className:"w-4 h-4"}),s.label,e.jsxs("span",{className:"text-xs opacity-60",children:["(",s.count,")"]})]},s.value))}),e.jsx("div",{className:"bg-gray-900/50 border border-gray-800/50 rounded-xl overflow-hidden",children:N?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx($,{size:"sm"})}):o==="batch"?l.length===0?e.jsx("div",{className:"text-center py-20 text-gray-600 text-sm",children:"No batch runs found"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-800/50",children:[e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Status"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Target"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Progress"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase hidden md:table-cell",children:"Jobs"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase hidden lg:table-cell",children:"Duration"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Started"})]})}),e.jsx("tbody",{children:l.map(s=>{const a=d[s.status]||d.pending,x=a.icon,n=s.total_categories>0?Math.round(s.processed_categories/s.total_categories*100):0;return e.jsxs("tr",{className:"border-b border-gray-800/30 hover:bg-gray-800/20 transition-colors",children:[e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`w-7 h-7 ${a.bg} rounded-lg flex items-center justify-center`,children:e.jsx(x,{className:`w-3.5 h-3.5 ${a.color} ${s.status==="running"?"animate-spin":""}`})}),e.jsx("span",{className:`text-sm font-medium capitalize ${a.color}`,children:s.status})]})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"text-sm text-gray-300 capitalize",children:s.target_table})}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-24 h-1.5 bg-gray-800 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-emerald-500 rounded-full transition-all",style:{width:`${n}%`}})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[s.processed_categories,"/",s.total_categories]})]})}),e.jsx("td",{className:"px-4 py-3 hidden md:table-cell",children:e.jsx("span",{className:"text-sm text-gray-300",children:s.total_jobs_fetched.toLocaleStr
1ing()})}),e.jsx("td",{className:"px-4 py-3 hidden lg:table-cell",children:e.jsx("span",{className:"text-sm text-gray-400",children:g(s.started_at,s.completed_at)})}),e.jsxs("td",{className:"px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(i,{className:"w-3 h-3"}),new Date(s.started_at).toLocaleString()]}),s.error_message&&e.jsxs("div",{className:"flex items-start gap-1 mt-1",children:[e.jsx(h,{className:"w-3 h-3 text-rose-400 flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-[10px] text-rose-400 line-clamp-1",children:s.error_message})]})]})]},s.id)})})]})}):t.length===0?e.jsx("div",{className:"text-center py-20 text-gray-600 text-sm",children:"No company fetch runs found"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-800/50",children:[e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Status"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Progress"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase hidden md:table-cell",children:"Jobs Fetched"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase hidden lg:table-cell",children:"Duration"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Started"})]})}),e.jsx("tbody",{children:t.map(s=>{const a=d[s.status]||d.pending,x=a.icon,n=s.total_companies>0?Math.round(s.processed_companies/s.total_companies*100):0;return e.jsxs("tr",{className:"border-b border-gray-800/30 hover:bg-gray-800/20 transition-colors",children:[e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:`w-7 h-7 ${a.bg} rounded-lg flex items-center justify-center`,children:e.jsx(x,{className:`w-3.5 h-3.5 ${a.color} ${s.status==="running"?"animate-spin":""}`})}),e.jsx("span",{className:`text-sm font-medium capitalize ${a.color}`,children:s.status})]})}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-24 h-1.5 bg-gray-800 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-blue-500 rounded-full transition-all",style:{width:`${n}%`}})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[s.processed_companies,"/",s.total_companies]})]})}),e.jsx("td",{className:"px-4 py-3 hidden md:table-cell",children:e.jsx("span",{className:"text-sm text-gray-300",children:s.total_jobs_fetched.toLocaleString()})}),e.jsx("td",{className:"px-4 py-3 hidden lg:table-cell",children:e.jsx("span",{className:"text-sm text-gray-400",children:g(s.started_at,s.completed_at)})}),e.jsxs("td",{className:"px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(i,{className:"w-3 h-3"}),new Date(s.started_at).toLocaleString()]}),s.error_message&&e.jsxs("div",{className:"flex items-start gap-1 mt-1",children:[e.jsx(h,{className:"w-3 h-3 text-rose-400 flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-[10px] text-rose-400 line-clamp-1",children:s.error_message})]})]})]},s.id)})})]})})})]})})}export{A 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.