Files
archie/ui/dist/assets/ScheduleRunsPage.js
T
sam a5137a4eca refactor(ui): audit leftovers use Alert, Item, CodeView and Tooltip
Inline error paragraphs become destructive Alerts, divided record lists
become Item rows, the redirect URI box uses CodeView, and icon-button
title hints use Tooltip. Native titles remain on truncated values and on
disabled controls.
2026-10-26 22:35:47 +11:00

1 line
3.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{t as e}from"./badge.js";import{A as t,C as n,Ct as r,Gt as i,M as a,S as o,Tt as s,Xt as c,_t as l,b as u,ht as d,ir as f,jn as p,k as m,l as h,t as g,x as _,xn as v,y}from"./PageHeader.js";import{N as b,d as x,r as S,u as C}from"./createLucideIcon.js";import{A as w,Y as T,Z as E,d as D,et as O,ht as k,n as A,q as j,r as M,tt as N,vt as P,wt as F}from"./index.js";var I={key:0,class:`space-y-2`},L={class:`tabular-nums text-fg-muted`},R={class:`block max-w-md break-words whitespace-normal text-danger`},z={class:`flex flex-wrap gap-2`},B=a({__name:`ScheduleRunsPage`,setup(a){let B=F(),V=y(()=>String(B.params.id??``)),H=v(null),U=v(null),W=v(``);async function G(){let e=V.value;try{let[t,n]=await Promise.all([S.schedules(),S.scheduleRuns(e)]);if(e!==V.value)return;H.value=t.schedules?.find(t=>t.id===e)??null,U.value=n.runs??[],W.value=``}catch(t){e===V.value&&(W.value=t instanceof Error?t.message:String(t))}}i(V,()=>{U.value=null,G()},{immediate:!0});let K=setInterval(()=>void G(),15e3);d(()=>clearInterval(K));async function q(){W.value=``;try{await S.scheduleRunNow(V.value),await G()}catch(e){W.value=e instanceof Error?e.message:String(e)}}let J=[{id:`scheduled`,label:`Scheduled`,fixed:!0,sort:e=>e.scheduled_for},{id:`started`,label:`Started`},{id:`duration`,label:`Duration`},{id:`result`,label:`Result`,sort:e=>e.result},{id:`error`,label:`Error`},{id:`tasks`,label:`Tasks`}];return(i,a)=>{let d=s(`RouterLink`);return l(),n(`div`,null,[t(g,{title:H.value?.name||`Schedule runs`},{default:c(()=>[t(p(b),{variant:`ghost`,size:`sm`,"as-child":``},{default:c(()=>[t(d,{to:`/org/schedules`},{default:c(()=>[t(p(P),{"data-icon":`inline-start`}),a[0]||=m(`Schedules`,-1)]),_:1})]),_:1}),t(p(b),{size:`sm`,disabled:!H.value,onClick:q},{default:c(()=>[t(p(k),{"data-icon":`inline-start`}),a[1]||=m(`Run now`,-1)]),_:1},8,[`disabled`])]),_:1},8,[`title`]),W.value?(l(),_(p(x),{key:0,variant:`destructive`,class:`mb-4`},{default:c(()=>[t(p(C),null,{default:c(()=>[m(f(W.value),1)]),_:1})]),_:1})):o(``,!0),t(p(w),null,{default:c(()=>[!U.value&&!W.value?(l(),n(`div`,I,[t(p(N),{class:`h-8 w-full`}),t(p(N),{class:`h-8 w-full`})])):U.value?(l(),_(p(D),{key:1,columns:J,rows:U.value,"row-key":e=>String(e.id),"storage-key":`schedule-runs`,"initial-sort":{id:`scheduled`,desc:!0}},{empty:c(()=>[t(p(O),null,{default:c(()=>[t(p(E),null,{default:c(()=>[t(p(T),null,{default:c(()=>[...a[2]||=[m(`No runs yet`,-1)]]),_:1})]),_:1})]),_:1})]),"cell-scheduled":c(({row:e})=>[t(p(j),{at:e.scheduled_for,absolute:``},null,8,[`at`])]),"cell-started":c(({row:e})=>[t(p(j),{at:e.started,absolute:``},null,8,[`at`])]),"cell-duration":c(({row:e})=>[u(`span`,L,f(p(M)(e)||`–`),1)]),"cell-result":c(({row:n})=>[t(p(e),{variant:p(A)[n.result]??`idle`},{default:c(()=>[m(f(n.result),1)]),_:2},1032,[`variant`])]),"cell-error":c(({row:e})=>[u(`span`,R,f(e.error),1)]),"cell-tasks":c(({row:e})=>[u(`span`,z,[(l(!0),n(h,null,r(e.task_ids??[],e=>(l(),_(d,{key:e,to:`/tasks/${e}`,class:`font-mono hover:underline`},{default:c(()=>[m(`#`+f(e),1)]),_:2},1032,[`to`]))),128))])]),_:1},8,[`rows`,`row-key`])):o(``,!0)]),_:1})])}}});export{B as default};