import{_ as H}from"./CVsqerjz.js";import{d as K,Y as R,c as V,x as $,b as S,e as f,w as t,l as d,j as s,f as e,J as c,K as m,L as x,E as o,Q as g,D as r,A as w,s as P,F as z,y as F,t as W,_ as Y}from"./Dyw2fVvW.js";import{T as q,a as G,b as B,c as p,d as J,e as i}from"./_VHcWE9c.js";import{L as b}from"./D-c8ddLn.js";import{S as M}from"./CmgZV_vY.js";import{K as O}from"./BBUbqgGn.js";import{u as Q}from"./CGYxsk1h.js";import"./4ryIOjig.js";const U={class:"grid grid-cols-3 gap-2"},X={class:"flex flex-col gap-1"},Z={class:"min-h-7 rounded-md border border-border px-2 py-1 leading-none"},ee={class:"flex flex-col gap-1"},te={class:"min-h-7 rounded-md border border-border px-2 py-1 leading-none"},se={class:"flex flex-col gap-1"},le={class:"flex flex-col gap-1"},ae={class:"min-h-7 rounded-md border border-border px-2 py-1 leading-none"},oe={class:"h-0 min-h-7 flex-grow overflow-scroll break-words rounded-md border border-border px-2 py-1 leading-none"},de={class:"text-xs text-muted-foreground"},re={class:"text-xs text-muted-foreground"},ne={key:1,class:"py-8 text-center text-sm text-muted-foreground"},ye=K({__name:"[processId]",async setup(ue){let _,T;const h=R(),y=V(()=>h.params.processId),{data:n}=([_,T]=$(()=>Q("get-port",()=>$fetch("/api/process/get-process",{query:{process:y.value}}),{watch:[y]})),_=await _,T(),_);return(fe,l)=>{const v=H,j=Y;return f(),S(j,{name:"default",path:["Processes",""]},{default:t(()=>[d("div",U,[s(e(c),null,{default:t(()=>[s(e(m),null,{default:t(()=>[s(e(x),null,{default:t(()=>l[0]||(l[0]=[o("Process Statistics")])),_:1})]),_:1}),s(e(g),{class:"flex flex-col gap-2"},{default:t(()=>{var u,a,C,I,N,L;return[d("div",X,[s(e(b),null,{default:t(()=>l[1]||(l[1]=[o("Process ID")])),_:1}),d("div",Z,r((a=(u=e(n))==null?void 0:u.processStats)==null?void 0:a.pid),1)]),d("div",ee,[s(e(b),null,{default:t(()=>l[2]||(l[2]=[o("Name")])),_:1}),d("div",te,r((I=(C=e(n))==null?void 0:C.processStats)==null?void 0:I.name),1)]),d("div",se,[s(e(b),null,{default:t(()=>l[3]||(l[3]=[o("Parent Process ID")])),_:1}),s(e(w),{variant:"outline","as-child":"",class:"h-7 justify-start px-2 py-1"},{default:t(()=>{var k,A;return[s(v,{href:`/processes/${(A=(k=e(n))==null?void 0:k.processStats)==null?void 0:A.ppid}`},{default:t(()=>{var D,E;return[o(r((E=(D=e(n))==null?void 0:D.processStats)==null?void 0:E.ppid),1)]}),_:1},8,["href"])]}),_:1})]),d("div",le,[s(e(b),null,{default:t(()=>l[4]||(l[4]=[o("User ID")])),_:1}),d("div",ae,r((L=(N=e(n))==null?void 0:N.processStats)==null?void 0:L.uid),1)])]}),_:1})]),_:1}),s(e(c),{class:"col-span-2 flex flex-col"},{default:t(()=>[s(e(m),null,{default:t(()=>[s(e(x),null,{default:t(()=>l[5]||(l[5]=[o("Commands")])),_:1})]),_:1}),s(e(g),{class:"flex flex-grow flex-col"},{default:t(()=>{var u,a;return[d("div",oe,[d("span",null,r((a=(u=e(n))==null?void 0:u.processStats)==null?void 0:a.cmd),1)])]}),_:1})]),_:1})]),s(e(c),null,{default:t(()=>[s(e(m),null,{default:t(()=>[s(e(x),null,{default:t(()=>l[6]||(l[6]=[o("Actions")])),_:1})]),_:1}),s(e(g),{class:"flex gap-1"},{default:t(()=>[s(O,{process:e(y)},null,8,["process"])]),_:1})]),_:1}),s(e(c),{class:"flex-grow"},{default:t(()=>[s(e(m),null,{default:t(()=>[s(e(x),null,{default:t(()=>l[7]||(l[7]=[o("Network Statistics")])),_:1})]),_:1}),s(e(g),{class:"px-0"},{default:t(()=>[s(e(M),{class:"justify-content-flex-start flex h-full flex-col justify-center"},{default:t(()=>{var u;return[l[13]||(l[13]=d("div",{class:"absolute z-10 h-4 w-full bg-gradient-to-t from-card/0 to-card/100"},null,-1)),(u=e(n))!=null&&u.netstat&&e(n).netstat.length>0?(f(),S(e(q),{key:0},{default:t(()=>[s(e(G),null,{default:t(()=>[s(e(B),null,{default:t(()=>[s(e(p),{class:"pl-3"},{default:t(()=>l[8]||(l[8]=[o("PID")])),_:1}),s(e(p),null,{default:t(()=>l[9]||(l[9]=[o("State")])),_:1}),s(e(p),null,{default:t(()=>l[10]||(l[10]=[o("Protocol")])),_:1}),s(e(p),null,{default:t(()=>l[11]||(l[11]=[o("Local")])),_:1}),s(e(p),{class:"pr-3"},{default:t(()=>l[12]||(l[12]=[o("Remote")])),_:1})]),_:1})]),_:1}),s(e(J),null,{default:t(()=>[(f(!0),P(z,null,F(e(n).netstat,a=>(f(),S(e(B),{asChild:""},{default:t(()=>[s(v,{href:`/processes/${a.pid}`},{default:t(()=>[s(e(i),{class:"pl-3"},{default:t(()=>[o(r(a.pid),1)]),_:2},1024),s(e(i),{class:"py-1"},{default:t(()=>[d("span",{class:W(["rounded-md px-2 py-1 text-xs text-background",{"bg-green-500":a.state==="LISTENING","bg-amber-500":a.state==="TIME_WAIT","bg-yellow-500":a.state==="SYN_SENT","bg-blue-500":a.state==="ESTABLISHED","bg-violet-500":a.state==="CLOSE_WAIT"}])},r(a.state),3)]),_:2},1024),s(e(i),null,{default:t(()=>[o(r(a.protocol),1)]),_:2},1024),s(e(i),null,{default:t(()=>[d("span",de,r(a.local.address)+":",1),o(" "+r(a.local.port),1)]),_:2},1024),s(e(i),{class:"pr-3"},{default:t(()=>[d("span",re,r(a.remote.address)+":",1),o(" "+r(a.remote.port),1)]),_:2},1024)]),_:2},1032,["href"])]),_:2},1024))),256))]),_:1})]),_:1})):(f(),P("p",ne,"No logs yet."))]}),_:1})]),_:1})]),_:1})]),_:1})}}});export{ye as default};
