import{d as g,b as x,e as a,w as o,j as l,f as t,J as h,K as y,L as C,E as d,M as b,D as m,Q as T,s as i,l as e,F as k,y as H,W as L,_ as v}from"./Dyw2fVvW.js";import{A as w}from"./CNWh2-s8.js";import{u as N,g as B,a as D}from"./C4PB36Nq.js";const S={key:0,class:"w-full border-b"},M=["onClick"],V={class:"px-2"},A={class:"font-semibold"},E={class:"p-1"},F={class:"block w-fit rounded bg-muted px-2 py-1 font-mono text-xs font-semibold"},$={class:"scale-75 truncate opacity-50"},j=["innerHTML"],J={key:1,class:"py-8 text-center text-sm text-muted-foreground"},z=g({__name:"index",setup(K){const{scripts:c}=N(),p=r=>new w().toHtml(r.trim());return(r,n)=>{const f=v;return a(),x(f,{name:"default",path:["Logs"]},{default:o(()=>[l(t(h),null,{default:o(()=>[l(t(y),null,{default:o(()=>[l(t(C),null,{default:o(()=>n[0]||(n[0]=[d("Logs")])),_:1}),l(t(b),null,{default:o(()=>[d(m(t(c).length)+" scripts are currently running.",1)]),_:1})]),_:1}),l(t(T),{class:"px-0"},{default:o(()=>[t(c).length>0?(a(),i("table",S,[e("tbody",null,[(a(!0),i(k,null,H(t(c),s=>{var u,_;return a(),i("tr",{class:"cursor-pointer border-t hover:bg-accent/50",onClick:Q=>("navigateTo"in r?r.navigateTo:t(L))(`/logs/${s.id}`)},[e("td",V,[e("p",A,m(t(B)({dynamic:s.command})),1)]),e("td",E,[e("code",F,m(t(D)({dynamic:s.command},s.package.path)),1)]),e("td",null,[e("pre",$,[n[1]||(n[1]=d("                  ")),e("code",{innerHTML:(_=p(((u=s.logs[s.logs.length-1])==null?void 0:u.text)??""))==null?void 0:_.slice(0,240)},null,8,j),n[2]||(n[2]=d(`
                `))])])],8,M)}),256))])])):(a(),i("p",J,"Run a command and it'll appear here."))]),_:1})]),_:1})]),_:1})}}});export{z as default};
