PageSourceSearch

https://djvibe.com/build/assets/jobs-Bqgqik1V.js

js djvibe.com collected 2026-10-02 13:39:34 UTC 8,324 bytes, 1 lines download raw bytes

1import{l as k,b as T,j as e,H as R,B as g,k as S,R as D,e as N,p as y,E as A,f as J}from"./button-HZc97v05.js";import{R as L}from"./running-job-tail-7AFXB7z1.js";import{aG as $,B as m,a6 as B}from"./site-footer-Cy6cE85D.js";import{C as h,d as p,a as E,b as H}from"./card-CblF0dUb.js";import{T as M,a as z,b as j,c as i,d as O,e as d}from"./table-FYLIOzgd.js";import{A as U}from"./app-layout-BfCVzEBY.js";import{u as P}from"./date-time-DK7V0H1-.js";import{C as G}from"./terminal-Ch9txFWE.js";import{C as I}from"./clock-3-CTYwjN7s.js";import{T as K}from"./timer-wuiXGJEd.js";import"./label-RHnzPLFK.js";import"./index-BFR9jqNY.js";import"./skip-navigation-link-DiDXDurQ.js";import"./index-CaDo1t_1.js";import"./input-BaapFWSc.js";import"./text-link-D6iXOZfb.js";function oe(){const{jobs:s,lastUpdatedAt:t}=k().props,{formatDateTime:n,formatDate:r}=P(),[l,c]=T.useState(null);return e.jsxs(U,{children:[e.jsx(R,{title:"Automation Jobs"}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-primary",children:"Operator"}),e.jsx("h1",{className:"text-3xl font-bold tracking-normal",children:"Automation Jobs"}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Last updated ",n(t)]})]}),e.jsxs(g,{type:"button",variant:"outline",onClick:()=>S.reload({only:["jobs","lastUpdatedAt"]}),children:[e.jsx(D,{}),"Refresh"]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-5",children:[e.jsx(o,{label:"Running",value:s.summary.running,icon:G}),e.jsx(o,{label:"Up next",value:s.summary.upcoming,icon:I}),e.jsx(o,{label:"Schedules",value:s.summary.schedules,icon:$}),e.jsx(o,{label:"One-off recent",value:s.summary.oneOffRecent,icon:K}),e.jsx(o,{label:"Recent failures",value:s.summary.failedRecent,icon:N})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx(x,{title:"Running Jobs",count:s.running.length}),s.running.length===0?e.jsx(b,{label:"No automation jobs are running."}):e.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:s.running.map(a=>e.jsx(q,{job:a,onInspect:c},`${a.pid}-${a.goal}`))})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx(x,{title:"Up Next",count:s.upcoming.length}),e.jsx(f,{jobs:s.upcoming,emptyLabel:"No upcoming automation triggers were found.",timeColumn:"next",formatDateTime:n,formatDate:r})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx(x,{title:"Previous Runs",count:s.recent.length}),e.jsx(f,{jobs:s.recent,emptyLabel:"No prior automation runs were found.",timeColumn:"started",formatDateTime:n,formatDate:r})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx(x,{title:"Schedules",count:s.schedules.length}),e.jsx(f,{jobs:s.schedules,emptyLabel:"No automation schedules were found.",timeColumn:"next",formatDateTime:n,formatDate:r,showCommand:!0})]}),e.jsx(L,{job:l,open:l!==null,onOpenChange:a=>{a||c(null)}})]})]})}function o({label:s,value:t,icon:n}){return e.jsx(h,{className:"rounded-lg",children:e.jsxs(p,{className:"flex items-center justify-between gap-3 p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:s}),e.jsx("p",{className:"mt-1 text-2xl font-bold tabular-nums",children:t})]}),e.jsx(n,{className:"size-5 text-primary"})]})})}function x({title:s,count:t}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold tracking-normal",children:s}),e.jsx(m,{variant:"secondary",children:t})]})}function b({label:s}){return e.jsx(h,{className:"rounded-lg",children:e.jsx(p,{className:"p-5 text-sm text-muted-foreground",children:s})})}function q({job:s,onInspect:t}){return e.jsxs(h,{className:"rounded-lg transition-colors hover:border-primary/40",children:[e.jsx(E,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(H,{className:"truncate text-base tracking-normal",children:s.title}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[s.area?.title??"Automation"," - PID ",s.pid]})]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-2",children:[e.jsx(_,{status:s.status}),s.merged_count>1&&e.jsxs(m,{variant:"secondary",children:[s.merged_count," merged"]})]})]})}),e.jsxs(p,{className:"space-y-3 pt-0",children:[e.jsxs("div",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[e.jsx(u,{label:"Kind",value:s.kind}),e.jsx(u,{label:"Elapsed",value:C(s.duration_seconds)}),e.jsx(u,{label:"Runner",value:s.runner??"Unknown"}),e.jsx(u,{label:"Goal",value:s.goal})]}),s.merged_details.length>1&&e.jsx(v,{details:s.merged_details}),s.command&&e.jsx("p",{className:"rounded-md bg-muted px-3 py-2 font-mono text-xs break-all text-muted-foreground",children:s.command}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t&&e.jsxs(g,{type:"button",size:"sm",onClick:()=>t(s),children:[e.jsx(B,{}),"Live tail"]}),s.goal_href&&e.jsx(g,{asChild:!0,variant:"outline",size:"sm",children:e.jsxs(y,{href:s.goal_href,children:[e.jsx(A,{}),"Goal"]})})]})]})]})}function f({jobs:s,emptyLabel:t,timeColumn:n,formatDateTime:r,formatDate:l,showCommand:c=!1}){return s.length===0?e.jsx(b,{label:t}):e.jsx(h,{className:"rounded-lg",children:e.jsx(p,{className:"overflow-x-auto p-0",children:e.jsxs(M,{children:[e.jsx(z,{children:e.jsxs(j,{children:[e.jsx(i,{children:"Job"}),e.jsx(i,{children:"Area"}),e.jsx(i,{children:"Status"}),e.jsx(i,{children:n==="next"?"Next Run":"Started"}),e.jsx(i,{children:"Duration"}),e.jsx(i,{children:"Schedule"}),c&&e.jsx(i,{children:"Command"})]})}),e.jsx(O,{children:s.map((a,w)=>e.jsxs(j,{children:[e.jsxs(d,{className:"min-w-52",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[a.goal_href?e.jsx(y,{href:a.goal_href,className:"font-semibold text-primary hover:underline",children:a.title}):e.jsx("span",{className:"font-semibold",children:a.title}),a.kind==="one_off"&&e.jsx(m,{variant:"outline",children:"One-off"}),a.merged_count>1&&e.jsxs(m,{variant:"secondary",children:[a.merged_count," merged"]})]}),a.failure_reason&&e.jsx("p",{className:"mt-1 text-xs text-destructive",children:a.failure_reason}),a.log_path&&e.jsx("p",{className:"mt-1 max-w-72 truncate text-xs text-muted-foreground",children:a.log_path}),a.merged_details.length>1&&e.jsx(v,{details:a.merged_details,compact:!0})]}),e.jsx(d,{className:"min-w-40",children:a.area?.title??"Automation"}),e.jsx(d,{children:e.jsx(_,{status:a.status})}),e.jsx(d,{className:"min-w-44",children:F(n==="next"?a.next_run_at:a.started_at,r,l)??"Not available"}),e.jsx(d,{children:C(a.duration_seconds)}),e.jsx(d,{className:"font-mono text-xs",children:a.schedule??"Manual"}),c&&e.jsx(d,{className:"max-w-96 font-mono text-xs break-all text-muted-foreground",children:a.command})]},`${a.goal}-${a.started_at??a.next_run_at??w}`))})]})})})}function u({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:s}),e.jsx("p",{className:"mt-0.5 font-medium",children:t})]})}function v({details:s,compact:t=!1}){return e.jsx("div",{className:t?"mt-2 space-y-1 text-xs text-muted-foreground":"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:s.map(n=>e.jsx("p",{className:"break-all",children:n},n))})}function _({status:s}){const t=s.toLowerCase(),n=t.includes("running")?"border-transparent bg-primary/10 text-primary":t.includes("success")||t.includes("active")?"border-transparent bg-emerald-100 text-emerald-800":t.includes("fail")||t.includes("error")?"border-transparent bg-red-100 text-red-800":t.includes("skip")?"border-transparent bg-amber-100 text-amber-800":"border-transparent bg-gray-100 text-gray-600",r=t.includes("fail")?N:J;return e.jsxs(m,{variant:"outline",className:n,children:[e.jsx(r,{className:"size-3"}),s]})}function C(s){if(s===null)return"Not available";if(s<60)return`${s}s`;const t=Math.floor(s/60),n=s%60;if(t<60)return`${t}m ${n}s`;const r=Math.floor(t/60),l=t%60;return`${r}h ${l}m`}function F(s,t,n){if(!s)return null;const r=new Date(s);if(Number.isNaN(r.getTime()))return s;const l=new Date;return r.toDateString()===l.toDateString()?t(s):n(s)}export{oe 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.