UNPKG

@runeya/runeya

Version:

Monitor processes as a stack

2 lines (1 loc) 1.79 kB
import{W as N}from"./json-tree-view-vue3.es-BsglhTJu.js";import{a as S}from"./router-CdfdQZKk.js";import{_ as j}from"./Section-D0z9MjV4.js";import{r as w,j as B,S as s,a0 as C,s as x,g as D,o as r,f as q,b as c,a as i,F as A,q as F,t as y,Z as J,k as M}from"./index-CXxIspfv.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./Editor-B--wgkn6.js";const V={class:"label"},$={class:"value"},E={key:1},L={__name:"Index",props:{service:{default:null,required:!0,type:S}},setup(n){var f,u,d,v,m,h;const b={containerName:"Name of container",isAlive:"Is Alive",pid:"PID",image:"Image",dockerInfos:"More infos"},g=n,l=w([]),I=a=>{try{return JSON.stringify(a)}catch{return"{}"}};async function e(){const{data:a}=await M.get(`/docker/${g.service.label}`);l.value=a}return B(e),(f=s)==null||f.on("stack:selectConf",e),(u=s)==null||u.on("service:crash",e),(d=s)==null||d.on("service:start",e),(v=s)==null||v.on("service:exit",e),(m=s)==null||m.on("service:healthcheck:down",e),(h=s)==null||h.on("service:healthcheck:up",e),C(()=>{var a,o,t,p,_,k;(a=s)==null||a.off("stack:selectConf",e),(o=s)==null||o.off("service:crash",e),(t=s)==null||t.off("service:start",e),(p=s)==null||p.off("service:exit",e),(_=s)==null||_.off("service:healthcheck:down",e),(k=s)==null||k.off("service:healthcheck:up",e)}),(a,o)=>n.service?(r(),x(j,{key:n.service.label},{default:q(()=>[o[0]||(o[0]=c("h2",null,"Docker",-1)),c("ul",null,[(r(!0),i(A,null,F(l.value,t=>(r(),i("li",null,[c("div",V,y(b[t.label]||t.label),1),c("div",$,[t.type==="json"?(r(),x(J(N),{key:0,class:"json",maxDepth:1,json:I(t.value),copyable:!0},null,8,["json"])):(r(),i("div",E,y(t.value),1))])]))),256))])]),_:1,__:[0]})):D("",!0)}},H=O(L,[["__scopeId","data-v-d0d094e9"]]);export{H as default};