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