UNPKG

@runeya/runeya

Version:

Monitor processes as a stack

2 lines (1 loc) 2.42 kB
import{a as k,n as g}from"./router-CdfdQZKk.js";import{_ as x}from"./Section-D0z9MjV4.js";import{S as N}from"./Spinner-CkmZ5Bkp.js";import{s as S}from"./index-B-UE6JmD.js";import{_ as V}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{l as f,a as r,o as i,e as h,s as B,g as w,f as I,d as F,F as y,q as M,n as O,b as C,t as u,u as P,r as p,j as T,w as b}from"./index-CXxIspfv.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./Editor-B--wgkn6.js";import"./index-Bv49zKKl.js";import"./index-OI8gr_S5.js";const j={components:{sectionCmp:x,spinner:N,Select:S},props:{service:{default:null,required:!0,type:k},isInMultiMode:{type:Boolean}},setup(o){const n=p([]),t=p(!1),e=p([]),c=p(),d=async()=>{o.service&&(e.value=await o.service.getNpmPaths(),c.value||(c.value=e.value[0]))};return T(d),b(()=>o.service,d),{reload:d,launch:async()=>{n.value=[],t.value=!0,n.value=await o.service.getBugs(c.value).catch(a=>{var m,l,s,_;return((l=(m=a==null?void 0:a.response)==null?void 0:m.data)==null?void 0:l.code)==="TSC_NOT_FOUND"&&g.next("error",'Please "npm i -g typescript"'),((_=(s=a==null?void 0:a.response)==null?void 0:s.data)==null?void 0:_.code)==="JSCONFIG_NOT_FOUND"&&g.next("error","Please create a jsconfig.json in project"),[]}).finally(()=>{t.value=!1})},npmPaths:e,cwd:c,loading:t,bugs:n,openInVsCode(a){o.service.openLinkInVsCode(a.path)}}}},z={key:0,class:"loading"},D={key:1,class:"bugs"},L=["onClick"],U={class:"message"};function q(o,n,t,e,c,d){var l;const v=f("Select"),a=f("spinner"),m=f("section-cmp");return i(),r(y,null,[h(v,{modelValue:e.cwd,"onUpdate:modelValue":n[0]||(n[0]=s=>e.cwd=s),options:e.npmPaths,style:{marginBottom:"10px"}},null,8,["modelValue","options"]),t.service?(i(),B(m,{key:t.service.label,header:"Bugs("+(((l=e.bugs)==null?void 0:l.length)||0)+")",class:"bug-root",style:P({maxHeight:t.isInMultiMode?"400px":"inherit"}),actions:[{label:"Launch",icon:"fas fa-play",click:()=>e.launch(),hidden:e.loading}]},{default:I(()=>[e.loading?(i(),r("div",z,[h(a,{size:40}),n[1]||(n[1]=F(" Analyse en cours "))])):(i(),r("div",D,[(i(!0),r(y,null,M(e.bugs,s=>(i(),r("div",{class:O(["bug",s.category]),key:s},[C("div",{class:"path",onClick:_=>e.openInVsCode(s)},u(s.fileName)+"("+u(s.line)+","+u(s.column)+")",9,L),C("div",U,u(s.messageText),1)],2))),128))]))]),_:1},8,["header","style","actions"])):w("",!0)],64)}const Y=V(j,[["render",q],["__scopeId","data-v-6048e2b3"]]);export{Y as default};