1import{g as ee,u as W,r as c,j as e,o as ne,s as _,t as j,X as te}from"./index-D2fOo6cO.js";import{P as ae}from"./plus-dPzat2CX.js";import{P as oe}from"./pencil-C3R_QmUH.js";import{T as le}from"./trash-2-5OrlGMr5.js";const ie=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],ce=ee("history",ie);const de=[["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-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Q=ee("triangle-alert",de);function y(t,a,i){const l=new Set;for(const o of t.split(",")){const n=o.match(/^(.+)\/(\d+)$/),x=n?n[1]:o,f=n?parseInt(n[2],10):1;let d=a,m=i;if(x!=="*"){const u=x.split("-");if(d=parseInt(u[0],10),m=u.length>1?parseInt(u[1],10):d,Number.isNaN(d)||Number.isNaN(m))throw new Error("bad range");if(!n&&u.length===1){if(d<a||d>i)throw new Error("out of range");l.add(d);continue}}for(let u=d;u<=m;u+=f){if(u<a||u>i)throw new Error("out of range");l.add(u)}}return l}function z(t){const a=t.trim().split(/\s+/);if(a.length!==5)return{ok:!1,error:"5 champs requis (m h dom mon dow)"};try{return y(a[0],0,59),y(a[1],0,23),y(a[2],1,31),y(a[3],1,12),y(a[4],
10,6),{ok:!0}}catch(i){return{ok:!1,error:i.message}}}function me(t,a){const i=t.trim().split(/\s+/);if(i.length!==5)return!1;try{return y(i[0],0,59).has(a.getUTCMinutes())&&y(i[1],0,23).has(a.getUTCHours())&&y(i[2],1,31).has(a.getUTCDate())&&y(i[3],1,12).has(a.getUTCMonth()+1)&&y(i[4],0,6).has(a.getUTCDay())}catch{return!1}}function ue(t,a=3,i=new Date){const l=[];if(!z(t).ok)return l;const o=new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes(),0,0));o.setUTCMinutes(o.getUTCMinutes()+1);for(let n=0;n<1440*366&&l.length<a;n++)me(t,o)&&l.push(new Date(o)),o.setUTCMinutes(o.getUTCMinutes()+1);return l}function se(t,a){if(!z(t).ok)return"â";const[l,o,n,x,f]=t.trim().split(/\s+/),d=a.startsWith("fr");if(l==="*"&&o==="*"&&n==="*"&&x==="*"&&f==="*")return d?"chaque minute":"every minute";if(x==="*"&&n==="*"&&f==="*"&&!l.includes("*")&&!o.includes("*"))return d?`tous les jours à ${o.padStart(2,"0")}:${l.padStart(2,"0")} UTC`:`every day at ${o.padStart(2,"0")}:${l.padStart(2,"0")} UTC`;if(x==="*"&&n==="*"&&!l.includes("*")&&!o.includes("*")){const m=d?["dim","lun","mar","mer","jeu","ven","sam"]:["sun","mon","tue","wed","thu","fri","sat"],u=[...new Set(f.split(/[,-]/))].map(T=>m[parseInt(T,10)]??T).join(", ");return d?`chaque ${u} à ${o.padStart(2,"0")}:${l.padStart(2,"0")} UTC`:`every ${u} at ${o.padStart(2,"0")}:${l.padStart(2,"0")} UTC`}return t}const V=t=>t&&t.charAt(0).toUpperCase()+t.slice(1);function xe(t,a){return t.toLocaleString(a,{timeZone:"Europe/Paris",day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}function pe(t,a){return t.toLocaleString(a,{timeZone:"UTC",day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}function he(){const[t,a]=c.useState(null),[i,l]=c.useState(null),[o,n]=c.useState(!0);return c.useEffect(()=>{let x=!1;return(async()=>{try{const{data:f,error:d}=await _.functions.invoke("agent-cron-tasks",{method:"GET"});if(d)throw d;const m=f;if(!m||!Array.isArray(m.profiles))throw new Error(m?.detail||m?.error||"Réponse inattendue du service d'agents");x||(a(m),l(null))}catch(f){x||(a(null),l(f.message||"Service injoignable"))}finally{x||n(!1)}})(),()=>{x=!0}},[]),{catalog:t,error:i,loading:o}}function ye(){const{t,i18n:a}=W(),i=a.language?.startsWith("fr")?"fr-FR":"en-US",[l,o]=c.useState([]),[n,x]=c.useState(!0),[f,d]=c.useState(null),[m,u]=c.useState(null),[T,q]=c.useState([]),[N,O]=c.useState(null),{catalog:p,error:E,loading:L}=he(),$=async()=>{x(!0);const{data:r}=await _.from("agent_cron_jobs").select("*").order("created_at",{ascending:!1});o(r??[]),x(!1)};c.useEffect(()=>{$()},[]);const R=async r=>{const{data:h}=await _.from("agent_cron_runs").select("*").eq("cron_job_id",r).order("triggered_at",{ascending:!1}).limit(50);q(h??[])};c.useEffect(()=>{m&&R(m.id)},[m]);const P=c.useMemo(()=>p?p.profiles.map(r=>r.name):[...new Set(l.map(r=>r.profile))],[p,l]),w=r=>{const h=V(r.profile),v=p?.profiles.find(b=>b.name===r.profile)?.tasks?.find(b=>b.name===r.task)?.label??r.task??"tâche par défaut",C=r.params&&typeof r.params=="object"?Object.entries(r.params).map(([b,k])=>b==="owner_email"?`pour ${String(k)}`:`${b} : ${String(k)}`):[];return`${h} : ${v}${C.length?`, ${C.join(", ")}`:""}`},I=async r=>{const{error:h}=await _.from("agent_cron_jobs").update({enabled:!r.enabled}).eq("id",r.id);if(h){j.error(h.message);return}$()},A=async r=>{if(!window.confirm(t("admin.cron.confirmDelete")))return;const{error:h}=await _.from("agent_cron_jobs").delete().eq("id",r);if(h){j.error(h.message);return}j.success(t("admin.cron.deleted")),$()},J=async r=>{O(r.id);try{const{data:h,error:F}=await _.functions.invoke("agent-cron-run-now",{body:{job_id:r.id}});if(F)throw F;const v=h;v?.status&&v.status.startsWith("error")?j.error(v.status):j.success(t("admin.cron.runStarted")),$()}catch(h){j.error(h.message)}finally{O(null)}};return e.jsxs("div",{className:"container mx-auto py-10 px-4 max-w-6xl",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-foreground",children:t("admin.cron.title")}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t("admin.cron.subtitle")})]}),e.jsxs("button",{onClick:()=>d({name:"",description:null,profile:P[0]??"",task:null,params:null,cron_expression:"0 6 * * *",enabled:!0}),disabled:L,className:"inline-flex items-center gap-2 bg-primary text-primary-foreground font-bold text-sm px-4 py-2 rounded-md hover:bg-primary-dark hover:text-white transition-colors disabled:opacity-50",children:[e.jsx(ae,{className:"w-4 h-4"})," ",t("admin.cron.create")]})]}),E&&e.jsxs("div",{className:"mt-5 flex items-start gap-3 rounded-lg border border-destructive/40 bg-destructive/5 p-4 text-sm",children:[e.jsx(Q,{className:"w-4 h-4 mt-0.5 text-destructive shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-destructive",children:"Catalogue des agents indisponible"}),e.jsxs("p",{className:"text-muted-foreground mt-1",children:["Le service d'agents n'a pas répondu, la liste des agents et des tâches n'a donc pas pu être chargée. Les déclencheurs existants restent consultables et modifiables, mais la tâche et ses paramètres se saisissent alors à la main. Détail technique : ",E]})]})]}),p&&p.unavailable&&p.unavailable.length>0&&e.jsxs("div",{className:"mt-5 flex items-start gap-3 rounded-lg border border-amber-500/40 bg-amber-500/5 p-4 text-sm",children:[e.jsx(Q,{className:"w-4 h-4 mt-0.5 text-amber-600 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-amber-700",children:"Agents partiellement indisponibles"}),e.jsx("ul",{className:"text-muted-foreground mt-1 space-y-0.5",children:p.unavailable.map(r=>e.jsxs("li",{children:["⢠",V(r.name)," n'a pas pu être lu",r.reason?` (${r.reason})`:""]},r.name))})]})]}),e.jsx("div",{className:"mt-6 bg-card border border-border rounded-lg overflow-hidden",children:n?e.jsx("p",{className:"p-6 text-sm text-muted-foreground text-center",children:"â¦"}):l.length===0?e.jsx("p",{className:"p-6 text-sm text-muted-foreground text-center",children:t("admin.cron.empty")}):e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-tag/40 text-xs uppercase text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-3",children:t("admin.cron.columns.name")}
1),e.jsx("th",{className:"text-left px-4 py-3",children:"Résumé"}),e.jsx("th",{className:"text-left px-4 py-3",children:t("admin.cron.columns.schedule")}),e.jsx("th",{className:"text-left px-4 py-3",children:t("admin.cron.columns.enabled")}),e.jsx("th",{className:"text-left px-4 py-3",children:t("admin.cron.columns.lastRun")}),e.jsx("th",{className:"text-right px-4 py-3",children:t("admin.cron.columns.actions")})]})}),e.jsx("tbody",{children:l.map(r=>e.jsxs("tr",{className:"border-t border-border align-top",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("div",{className:"font-medium text-foreground",children:r.name}),r.description&&e.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground max-w-xs",children:r.description})]}),e.jsx("td",{className:"px-4 py-3 text-muted-foreground max-w-xs",children:w(r)}),e.jsxs("td",{className:"px-4 py-3 text-muted-foreground",children:[e.jsx("div",{children:se(r.cron_expression,a.language)}),e.jsx("code",{className:"text-xs text-muted-foreground/70",children:r.cron_expression})]}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("button",{onClick:()=>I(r),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${r.enabled?"bg-primary":"bg-muted"}`,"aria-label":"toggle",children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${r.enabled?"translate-x-4":"translate-x-0.5"}`})})}),e.jsx("td",{className:"px-4 py-3 text-xs",children:r.last_run_at?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-muted-foreground",children:new Date(r.last_run_at).toLocaleString(i)}),e.jsx("div",{className:r.last_status?.startsWith("error")?"text-destructive":"text-green-700",children:r.last_status})]}):e.jsx("span",{className:"text-muted-foreground",children:t("admin.cron.never")})}),e.jsx("td",{className:"px-4 py-3 text-right",children:e.jsxs("div",{className:"inline-flex items-center gap-1",children:[e.jsxs("button",{onClick:()=>J(r),disabled:N===r.id,className:"inline-flex items-center gap-1 text-xs px-2 py-1 rounded hover:bg-tag disabled:opacity-50",title:t("admin.cron.runNow"),children:[e.jsx(ne,{className:"w-3.5 h-3.5"})," ",t("admin.cron.runNow")]}),e.jsx("button",{onClick:()=>u(r),className:"inline-flex items-center gap-1 text-xs px-2 py-1 rounded hover:bg-tag",title:t("admin.cron.history"),children:e.jsx(ce,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>d(r),className:"inline-flex items-center gap-1 text-xs px-2 py-1 rounded hover:bg-tag",title:t("admin.cron.edit"),children:e.jsx(oe,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>A(r.id),className:"inline-flex items-center gap-1 text-xs px-2 py-1 rounded hover:bg-destructive/10 text-destructive",title:t("admin.cron.delete"),children:e.jsx(le,{className:"w-3.5 h-3.5"})})]})})]},r.id))})]})}),e.jsxs("div",{className:"mt-6 bg-card border border-border rounded-lg p-5 text-sm",children:[e.jsx("h2",{className:"text-sm font-bold uppercase tracking-wide text-foreground mb-2",children:t("admin.cron.docs.title")}),e.jsx("p",{className:"text-muted-foreground",children:t("admin.cron.docs.utc")}),e.jsxs("p",{className:"text-muted-foreground mt-1",children:[t("admin.cron.docs.secrets")," ",e.jsx("code",{className:"text-xs bg-tag px-1.5 py-0.5 rounded",children:"AGENT_SERVICE_URL"}),", ",e.jsx("code",{className:"text-xs bg-tag px-1.5 py-0.5 rounded",children:"CRON_TRIGGER_TOKEN"})]})]}),f&&e.jsx(fe,{job:f,catalog:p,fallbackProfiles:P,onClose:()=>d(null),onSaved:()=>{d(null),$()}}),m&&e.jsx(ge,{job:m,runs:T,onClose:()=>{u(null),q([])},locale:i})]})}function fe({job:t,catalog:a,fallbackProfiles:i,onClose:l,onSaved:o}){const{t:n,i18n:x}=W(),f=x.language?.startsWith("fr")?"fr-FR":"en-US",d=a?a.profiles.map(s=>s.name):i,[m,u]=c.useState(t.name??""),[T,q]=c.useState(t.description??""),[N,O]=c.useState(t.profile??d[0]??""),[p,E]=c.useState(t.task??""),[L,$]=c.useState(()=>{const s={};if(t.params&&typeof t.params=="object")for(const[g,U]of Object.entries(t.params))s[g]=U==null?"":String(U);return s}),[R,P]=c.useState(t.params&&Object.keys(t.params).length>0?JSON.stringify(t.params,null,2):""),[w,I]=c.useState(t.cron_expression??"0 6 * * *"),[A,J]=c.useState(t.enabled??!0),[r,h]=c.useState(!1),v=a?.profiles.find(s=>s.name===N)?.tasks??[],C=v.find(s=>
1s.name===p),b=!!a;c.useEffect(()=>{b&&p&&!v.some(s=>s.name===p)&&E("")},[N,b,v,p]);const k=c.useMemo(()=>z(w),[w]),G=c.useMemo(()=>ue(w,3),[w]),M=c.useMemo(()=>{const s=R.trim();if(s==="")return{ok:!0,value:null};try{const g=JSON.parse(s);return!g||typeof g!="object"||Array.isArray(g)?{ok:!1,error:'Doit être un objet JSON, ex. {"owner_email": "[email protected]"}'}:Object.keys(g).length===0?{ok:!0,value:null}:{ok:!0,value:g}}catch{return{ok:!1,error:"JSON invalide"}}},[R]),re=async()=>{if(!m.trim()){j.error(n("admin.cron.form.nameRequired"));return}if(!N){j.error("Sélectionne un agent.");return}if(!k.ok){j.error(n("admin.cron.form.invalidCron"));return}let s=null;if(b){const K=C?.params??[],X=K.filter(S=>S.required&&!(L[S.name]??"").trim());if(X.length>0){j.error(`Paramètre obligatoire manquant : ${X.map(S=>S.label??S.name).join(", ")}`);return}const H={};for(const S of K){const Y=(L[S.name]??"").trim();Y&&(H[S.name]=Y)}s=Object.keys(H).length>0?H:null}else{if(!M.ok){j.error(M.error);return}s=M.value}h(!0);const g=p.trim(),U=T.trim(),B={name:m.trim(),description:U===""?null:U,profile:N,task:g===""?null:g,params:s??null,cron_expression:w.trim(),enabled:A},Z=t.id?await _.from("agent_cron_jobs").update(B).eq("id",t.id):await _.from("agent_cron_jobs").insert(B);if(h(!1),Z.error){j.error(Z.error.message);return}j.success(n("admin.cron.saved")),o()},D="w-full text-sm px-3 py-2 rounded-md border border-border bg-background focus:outline-none focus:border-primary";return e.jsx("div",{className:"fixed inset-0 bg-black/40 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-card rounded-lg shadow-soft max-w-lg w-full p-6 max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-lg font-bold text-foreground",children:t.id?n("admin.cron.form.editTitle"):n("admin.cron.form.newTitle")}),e.jsx("button",{onClick:l,className:"text-muted-foreground hover:text-foreground",children:e.jsx(te,{className:"w-4 h-4"})})]}),!b&&e.jsx("p",{className:"mt-3 rounded-md border border-destructive/40 bg-destructive/5 p-3 text-xs text-muted-foreground",children:"Le catalogue des agents est indisponible : la tâche et les paramètres se saisissent à la main, comme auparavant. Vérifie bien l'orthographe de la tâche avant d'enregistrer."}),e.jsx("label",{className:"block text-xs font-semibold mt-4 mb-1.5",children:n("admin.cron.form.name")}),e.jsx("input",{value:m,onChange:s=>u(s.target.value),className:D}),e.jsxs("label",{className:"block text-xs font-semibold mt-4 mb-1.5",children:["Description ",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(optionnel)"})]}),e.jsx("textarea",{value:T,onChange:s=>q(s.target.value),rows:2,placeholder:"à quoi sert ce déclencheur, et pour qui.",className:D}),e.jsx("label",{className:"block text-xs font-semibold mt-4 mb-1.5",children:n("admin.cron.form.profile")}),e.jsxs("select",{value:N,onChange:s=>O(s.target.value),className:D,children:[N&&!d.includes(N)&&e.jsx("option",{value:N,children:N}),d.length===0&&e.jsx("option",{value:"",children:"Aucun agent disponible"}),d.map(s=>e.jsx("option",{value:s,children:a?.profiles.find(g=>g.name===s)?.label??V(s)},s))]}),e.jsx("label",{className:"block text-xs font-semibold mt-4 mb-1.5",children:"Tâche"}),b?e.jsxs(e.Fragment,{children:[e.jsxs("select",{value:p,onChange:s=>E(s.target.value),className:D,children:[e.jsx("option",{value:"",children:"Tâche par défaut de l'agent"}),v.map(s=>e.jsx("option",{value:s.name,children:s.label??s.name},s.name))]}),e.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:C?.description??"Laisser sur « tâche par défaut » ne transmet aucune tâche : l'agent choisit lui-même."})]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{value:p,onChange:s=>E(s.target.value),placeholder:"article-du-jour",className:`${D} font-mono`}),e.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Laisser vide ne transmet aucune tâche : l'agent choisit sa tâche par défaut."})]}),b?C&&(C.params?.length??0)>0?e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsx("p",{className:"text-xs font-semibold",children:"Paramètres"}),C.params.map(s=>e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs font-semibold mb-1.5",children:[s.label??s.name,s.required?e.jsx("span",{className:"text-destructive",children:" *"}):e.jsx("span",{className:"text-muted-foreground font-normal",children:" (optionnel)"})]}),e.jsx("input",{value:L[s.name]??"",onChange:g=>$(U=>({...U,[s.name]:g.target.value})),placeholder:s.example??"",className:D}),s.description&&e.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:s.description})]},s.name))]}):null:e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"block text-xs font-semibold mt-4 mb-1.5",children:["Paramètres JSON ",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(optionnel)"})]}),e.jsx("textarea",{value:R,onChange:s=>P(s.target.value),rows:4,placeholder:`{ 2 "owner_email": "[email protected]" 3}`,className:`w-full text-sm font-mono px-3 py-2 rounded-md border bg-background focus:outline-none ${M.ok?"border-border focus:border-primary":"border-destructive"}`}),e.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:M.ok?"Objet JSON transmis à l'agent.":M.error})]}),e.jsxs("label",{className:"block text-xs font-semibold mt-4 mb-1.5",children:[n("admin.cron.form.cron")," ",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(UTC)"})]}),e.jsx("input",{value:w,onChange:s=>I(s.target.value),placeholder:"0 6 * * *",className:`w-full text-sm font-mono px-3 py-2 rounded-md border bg-background focus:outline-none ${k.ok?"border-border focus:border-primary":"border-destructive"}`}),e.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:k.ok?se(w,x.language):k.error||n("admin.cron.form.invali
3dCron")}),k.ok&&G.length>0&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"font-semibold mb-1",children:n("admin.cron.form.next3")}),e.jsx("ul",{className:"space-y-0.5",children:G.map(s=>e.jsxs("li",{children:["⢠",pe(s,f)," UTC",e.jsxs("span",{className:"text-muted-foreground/80",children:[" soit ",xe(s,f)," à Paris"]})]},s.toISOString()))})]}),e.jsxs("label",{className:"flex items-center gap-2 mt-4 text-sm cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:A,onChange:s=>J(s.target.checked)}),n("admin.cron.form.enabled")]}),e.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[e.jsx("button",{onClick:l,className:"text-sm px-3 py-1.5 rounded-md hover:bg-tag",children:n("admin.cron.form.cancel")}),e.jsx("button",{onClick:re,disabled:r||!k.ok,className:"bg-primary text-primary-foreground font-bold text-sm px-4 py-1.5 rounded-md disabled:opacity-50",children:n(r?"admin.cron.form.saving":"admin.cron.form.save")})]})]})})}function ge({job:t,runs:a,onClose:i,locale:l}){const{t:o}=W();return e.jsx("div",{className:"fixed inset-0 bg-black/40 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-card rounded-lg shadow-soft max-w-3xl w-full p-6 max-h-[90vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-foreground",children:o("admin.cron.history")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.name})]}),e.jsx("button",{onClick:i,className:"text-muted-foreground hover:text-foreground",children:e.jsx(te,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"mt-4",children:a.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:o("admin.cron.noHistory")}):e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-tag/40 text-xs uppercase text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-3 py-2",children:o("admin.cron.runs.date")}),e.jsx("th",{className:"text-left px-3 py-2",children:o("admin.cron.runs.source")}),e.jsx("th",{className:"text-left px-3 py-2",children:o("admin.cron.runs.http")}),e.jsx("th",{className:"text-left px-3 py-2",children:o("admin.cron.runs.response")})]})}),e.jsx("tbody",{children:a.map(n=>e.jsxs("tr",{className:"border-t border-border align-top",children:[e.jsx("td",{className:"px-3 py-2 text-xs text-muted-foreground whitespace-nowrap",children:new Date(n.triggered_at).toLocaleString(l)}),e.jsx("td",{className:"px-3 py-2 text-xs",children:n.trigger_source}),e.jsx("td",{className:`px-3 py-2 text-xs font-medium ${n.http_status&&n.http_status>=200&&n.http_status<300?"text-green-700":"text-destructive"}`,children:n.http_status??"â"}),e.jsx("td",{className:"px-3 py-2 text-xs",children:e.jsx("pre",{className:"text-xs bg-tag/40 rounded p-2 overflow-x-auto max-w-md",children:JSON.stringify(n.response,null,2)})})]},n.id))})]})})]})})}export{ye as component};
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.