PageSourceSearch

https://escortadvisor-b4fe68rl.manus.space/assets/AdminJobsStatus-CWH4prmi.js

js escortadvisor-b4fe68rl.manus.space collected 2026-10-03 05:02:16 UTC 7,299 bytes, 6 lines download raw bytes

1import{c as g,f as b,t as N,j as e,ah as m,S as w,a6 as j,w as p,N as v,L as h,_ as y,B as k,F as C,Y as S}from"./index-cscxoOf9.js";import{W as A}from"./wand-sparkles-hKU6W8Cl.js";import{D as L}from"./database-LDECHH4a.js";import{T as R}from"./trending-down-BrwL8aoe.js";import{R as D}from"./refresh-cw-D0KbhpJJ.js";import{C as z}from"./circle-x-DHp6YeSD.js";import{C as _}from"./circle-check-so_R1iP7.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const I=g("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);function T({name:r,schedule:d,isRunning:s,enabled:x,lastRunAt:c,lastResult:n,lastStatus:i,nextRunAt:a,icon:t,color:l}){const o=x===!1,u=s?"text-blue-400 bg-blue-400/10 border-blue-400/20":o?"text-white/30 bg-[#0f1117]/5 border-white/10":i==="failed"?"text-red-400 bg-red-400/10 border-red-400/20":"text-green-400 bg-green-400/10 border-green-400/20",f=s?"In esecuzione":o?"Disabilitato":i==="failed"?"Fallito":"Attivo";return e.jsxs("div",{className:`bg-[#0f1117] border border-white/5 rounded-2xl p-5 flex flex-col gap-3 ${s?"border-blue-500/20 shadow-lg shadow-blue-500/5":""}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center ${l}`,children:t}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-['Nunito'] font-bold text-white text-sm",children:r}),e.jsxs("p",{className:"text-xs text-white/40 font-['Nunito'] flex items-center gap-1 mt-0.5",children:[e.jsx(S,{className:"w-3 h-3"}),d]})]})]}),e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-['Nunito'] font-semibold border ${u}`,children:[s?e.jsx(m,{className:"w-3 h-3 animate-spin"}):o?e.jsx(I,{className:"w-3 h-3"}):i==="failed"?e.jsx(z,{className:"w-3 h-3"}):e.jsx(_,{className:"w-3 h-3"}),f]})]}),e.jsxs("div",{className:"border-t border-white/5 pt-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-white/40 font-['Nunito']",children:"Ultimo run"}),e.jsx("span",{className:"text-white/70 font-['Nunito']",children:c?new Date(c).toLocaleString("it-IT",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}):"—"})]}),n&&e.jsxs("div",{className:"flex items-start justify-between text-xs gap-2",children:[e.jsx("span",{className:"text-white/40 font-['Nunito'] shrink-0",children:"Risultato"}),e.jsx("span",{className:"text-white/70 font-['Nunito'] text-right",children:n})]}),a&&e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-white/40 font-['Nunito']",children:"Prossimo run"}),e.jsx("span",{className:"text-[#C28B2C] font-['Nunito']",children:new Date(a).toLocaleString("it-IT",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})})]})]})]})}function M(){const{user:r,loading:d}=b(),{data:s,isLoading:x,refetch:c,isFetching:n}=N.jobsStatus.getAll.useQuery(void 0,{refetchInterval:3e4});if(d)return e.jsx("div",{className:"min-h-screen bg-[oklch(0.10_0.015_280)] flex items-center justify-center pt-[94px]",children:e.jsx(m,{className:"w-8 h-8 text-rose-500 animate-spin"})});if(!r||r.role!=="admin"&&r.role!=="superadmin")return e.jsx("div",{className:"min-h-screen bg-[oklch(0.10_0.015_280)] flex items-center justify-center",children:e.jsx("p",{className:"text-white/60 font-['Nunito']",children:"Accesso non autorizzato"})});const i=s?[{key:"scraping",...s.scraping,icon:e.jsx(w,{className:"w-5 h-5"}),color:"bg-rose-500/15 text-rose-400"},{key:"rewrite",...s.rewrite,icon:e.jsx(A,{className:"w-5 h-5"}),color:"bg-violet-500/15 text-violet-400"},{key:"verify",...s.verify,icon:e.jsx(j,{className:"w-5 h-5"}),color:"bg-blue-500/15 text-blue-400"},{key:"watermark",...s.watermark,icon:e.jsx(L,{className:"w-5 h-5"}),color:"bg-fuchsia-500/15 text-fuchsia-400"},{key:"trustScore",...s.trustScore,icon:e.jsx(p,{className:"w-5 h-5"}
6),color:"bg-amber-500/15 text-amber-400"},{key:"decayScore",...s.decayScore,icon:e.jsx(R,{className:"w-5 h-5"}),color:"bg-green-500/15 text-green-400"}]:[],a=i.filter(t=>t.isRunning).length;return e.jsxs("div",{className:"min-h-screen bg-[oklch(0.10_0.015_280)]",children:[e.jsx(v,{}),e.jsxs("div",{className:"container py-8 pt-24 pb-24",children:[e.jsx("div",{className:"flex items-center gap-4 mb-8",children:e.jsxs(h,{href:"/admin",className:"flex items-center gap-2 text-white/40 hover:text-white/70 transition-colors text-sm font-['Nunito']",children:[e.jsx(y,{className:"w-4 h-4"}),"Admin"]})}),e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-['Nunito'] font-bold text-3xl text-white",children:"Stato Job Notturni"}),e.jsxs("p",{className:"text-white/40 font-['Nunito'] mt-1",children:[a>0?e.jsxs("span",{className:"text-blue-400",children:[a," job in esecuzione"]}):"Tutti i job sono in standby"," · ","Aggiornamento automatico ogni 30s"]})]}),e.jsxs(k,{onClick:()=>c(),disabled:n,variant:"outline",className:"bg-[#0f1117]/5 border-white/10 text-white/70 hover:bg-[#0f1117]/10 hover:text-white font-['Nunito']",children:[e.jsx(D,{className:`w-4 h-4 mr-2 ${n?"animate-spin":""}`}),"Aggiorna"]})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8",children:[{label:"Job totali",value:i.length,color:"text-white"},{label:"In esecuzione",value:a,color:"text-blue-400"},{label:"Attivi",value:i.filter(t=>!t.isRunning&&t.enabled!==!1).length,color:"text-green-400"},{label:"Disabilitati",value:i.filter(t=>t.enabled===!1).length,color:"text-white/30"}].map(({label:t,value:l,color:o})=>e.jsxs("div",{className:"bg-[#0f1117] border border-white/5 rounded-xl p-4 text-center",children:[e.jsx("div",{className:`font-['Nunito'] font-bold text-2xl ${o}`,children:l}),e.jsx("div",{className:"text-xs text-white/40 font-['Nunito'] mt-1",children:t})]},t))}),x?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(m,{className:"w-8 h-8 text-rose-500 animate-spin"})}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:i.map(t=>e.jsx(T,{name:t.name,schedule:t.schedule,isRunning:t.isRunning,enabled:t.enabled,lastRunAt:t.lastRunAt,lastResult:t.lastResult,lastStatus:t.lastStatus,nextRunAt:t.nextRunAt,icon:t.icon,color:t.color},t.key))}),e.jsxs("div",{className:"mt-8 border-t border-white/5 pt-6",children:[e.jsx("p",{className:"text-white/40 font-['Nunito'] text-sm mb-4",children:"Pannelli di dettaglio"}),e.jsx("div",{className:"flex flex-wrap gap-3",children:[{href:"/admin/scraping",label:"Scraping"},{href:"/admin/rewrite",label:"Riscrittura LLM"},{href:"/admin/verify-listings",label:"Verifica Annunci"},{href:"/admin/watermark",label:"Watermark"}].map(({href:t,label:l})=>e.jsx(h,{href:t,className:"px-4 py-2 bg-[#0f1117]/5 hover:bg-[#0f1117]/10 border border-white/10 rounded-xl text-sm text-white/60 hover:text-white font-['Nunito'] transition-colors",children:l},t))})]})]}),e.jsx(C,{})]})}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.