1import{j as e,H as y,L as C,r as l}from"./app-ByQch4I5.js";import{A as S}from"./AuthenticatedLayout-CJ_-9G1k.js";import{C as _,a as T,b as F,c as H}from"./card-BuV06XZb.js";import{B as o}from"./button-CO2CfBCy.js";import{B as k}from"./badge-hIqUqezW.js";import{I as p}from"./input-oWbSJjZA.js";import{T as A,a as B,b as n,c as t,d as R,e as r}from"./table-JIfsKhVu.js";import{b as u}from"./vendor-charts-BKAt7cDO.js";import{T as z}from"./triangle-alert-DqaUqV91.js";import{S as I}from"./search-dj5XOZjc.js";import{R as h}from"./refresh-cw-CY4ju8DI.js";import{T as L}from"./trash-2-B5D0xTMv.js";import"./IntercomProvider-YCDMJfYS.js";import"./select-CpwNcpia.js";import"./index-B55C8FZP.js";import"./index-CqaWym_s.js";import"./index-C6kCe8uY.js";import"./Combination-DeVoTXCW.js";import"./index-wp-dmnFN.js";import"./utils-CUI6UMdp.js";import"./createLucideIcon-DK2HYjz_.js";import"./check-Drz9NtyC.js";import"./IntegrationLogos-Z8S5Bw8D.js";import"./x-B4BqlaU8.js";import"./plug-B2gyJ7AY.js";import"./sparkles-CU073Ka0.js";import"./message-circle-Ox8NpyAr.js";import"./bot-DzPro7Ls.js";import"./workflow-DHTzOaUG.js";import"./users-CqxZ7oGj.js";function pe({auth:j,failedJobs:a,filters:m,jobClasses:c}){const[d,f]=u.useState(m?.search??""),[x,v]=u.useState(m?.job_class??""),g=s=>{s.preventDefault(),l.get(route("admin.failed-jobs.index"),{search:d,job_class:x},{preserveState:!0,replace:!0})},b=s=>{l.post(route("admin.failed-jobs.retry",s),{},{preserveScroll:!0})},N=s=>{confirm("Delete this failed job permanently?")&&l.delete(route("admin.failed-jobs.destroy",s),{preserveScroll:!0})},w=s=>{confirm(`Retry all failed jobs of class "${s}"?`)&&l.post(route("admin.failed-jobs.retry-by-class"),{job_class:s},{preserveScroll:!0})};return e.jsxs(S,{user:j.user,header:e.jsx("h2",{className:"font-semibold text-xl text-gray-800 leading-tight",children:"Failed Jobs"}),children:[e.jsx(y,{title:"Failed Jobs"}),e.jsx("div",{className:"py-8",children:e.jsx("div",{className:"max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-4",children:e.jsxs(_,{children:[e.jsxs(T,{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs(F,{className:"flex items-center gap-2",children:[e.jsx(z,{className:"h-5 w-5 text-amber-600"}),"Failed jobs (",a.total,")"]}),e.jsxs("form",{onSubmit:g,className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"relative",children:[e.jsx(I,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(p,{placeholder:"Search uuid / queue / exception",value:d,onChange:s=>f(s.target.value),className:"pl-8 w-72"})]}),e.jsx(p,{placeholder:"Filter by job class",value:x,onChange:s=>v(s.target.value),className:"w-56"}),e.jsx(o,{type:"submit",size:"sm",variant:"secondary",children:"Filter"})]})]}
1),e.jsxs(H,{children:[c&&Object.keys(c).length>0&&e.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:Object.entries(c).map(([s,i])=>e.jsxs(k,{variant:"outline",className:"cursor-pointer hover:bg-accent",onClick:()=>w(s),title:`Click to retry all ${i} failed jobs of this class`,children:[e.jsx(h,{className:"h-3 w-3 mr-1"}),s.split("\\").pop()," (",i,")"]},s))}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(A,{children:[e.jsx(B,{children:e.jsxs(n,{children:[e.jsx(t,{children:"UUID"}),e.jsx(t,{children:"Job class"}),e.jsx(t,{children:"Queue"}),e.jsx(t,{children:"Args preview"}),e.jsx(t,{children:"Failed at"}),e.jsx(t,{children:"Exception"}),e.jsx(t,{className:"text-right",children:"Actions"})]})}),e.jsxs(R,{children:[a.data.length===0&&e.jsx(n,{children:e.jsx(r,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"No failed jobs."})}),a.data.map(s=>e.jsxs(n,{children:[e.jsx(r,{className:"font-mono text-xs",children:e.jsx(C,{href:route("admin.failed-jobs.show",s.uuid),className:"text-blue-600 hover:underline",children:s.uuid.substring(0,8)})}),e.jsx(r,{className:"font-mono text-xs",children:s.job_class?.split("\\").pop()??"â"}),e.jsx(r,{children:s.queue}),e.jsx(r,{className:"font-mono text-xs max-w-xs truncate",title:s.args_preview,children:s.args_preview}),e.jsx(r,{className:"text-xs",children:s.failed_at}),e.jsx(r,{className:"font-mono text-xs max-w-sm truncate",title:s.exception_preview,children:s.exception_preview}),e.jsxs(r,{className:"text-right space-x-1",children:[e.jsx(o,{size:"sm",variant:"secondary",onClick:()=>b(s.uuid),children:e.jsx(h,{className:"h-3 w-3"})}),e.jsx(o,{size:"sm",variant:"destructive",onClick:()=>N(s.uuid),children:e.jsx(L,{className:"h-3 w-3"})})]})]},s.uuid))]})]})}),a.links&&a.last_page>1&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-4",children:a.links.map((s,i)=>e.jsx(o,{size:"sm",variant:s.active?"default":"outline",disabled:!s.url,onClick:()=>s.url&&l.get(s.url,{},{preserveState:!0}),dangerouslySetInnerHTML:{__html:s.label}},i))})]})]})})})]})}export{pe 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.