import{c as e,r as s,_ as a,q as o,v as t,x as r,I as l,J as n,y as i,e as u,D as m,F as c}from"./base-lib.js?v=1761009159";import{aj as p,b as d}from"./utils-lib.js?v=1761009159";import{u as _}from"./use-socket-request.js?v=1761009159";import{u as v}from"./useStore4.js?v=1761009159";import{n as j,g as y}from"./index71.js?v=1761009159";import{_ as f,a as g,b as x}from"./traditional-project.vue_vue_type_script_setup_true_lang.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./site.js?v=1761009159";import"./index105.js?v=1761009159";import"./index133.js?v=1761009159";import"./index106.js?v=1761009159";import"./validator.js?v=1761009159";import"./column.js?v=1761009159";import"./index.vue_vue_type_style_index_0_scoped_cdc7f4d3_lang.js?v=1761009159";import"./useController6.js?v=1761009159";import"./index143.js?v=1761009159";import"./index127.js?v=1761009159";import"./index.vue_vue_type_script_setup_true_lang13.js?v=1761009159";import"./index103.js?v=1761009159";import"./index115.js?v=1761009159";import"./ace.js?v=1761009159";const b=["innerHTML"],w=e({__name:"index",emits:["showFooterFun"],setup(e,{expose:w,emit:h}){const k=d(),F=h,{isRefreshList:D}=v(),H=s("nodeProject"),P=s(null),q=s(),M=s(!1),R=s("正在执行添加脚本...");a("nodeData",j);const{BtTabs:T,tabsRefs:L}=p({type:"card",value:H,options:[{label:"默认项目",name:"nodeProject",lazy:!0,render:f},{label:"PM2项目",name:"pmProject",lazy:!0,render:g},{label:"传统项目",name:"traditionalProject",lazy:!0,render:x}]}),z=async(e=!1)=>(j.value=await y(),e&&k.success("Node版本，刷新成功"),j.value);return a("getNodeData",z),o(()=>z),w({onConfirm:async e=>{const s=await L()[H.value].submit();if(s){let a={...s,mod_name:"nodejs",sub_mod_name:"com",def_name:"create",ws_callback:"create"};(async()=>{var e;null==(e=P.value)||e.socketDestroy();const{socketRequest:s,socketDestroy:a}=_("/ws_modsoc",!1);P.value={socketRequest:s,socketDestroy:a},new Promise((e,s)=>{e(P.value)})})(),P.value.socketRequest({params:a,onMessage:s=>(async(e,s)=>{var a;e.msg&&(R.value=R.value+"\n"+e.msg,(null==(a=q.value)?void 0:a.scrollHeight)&&(q.value.scrollTop=q.value.scrollHeight)),-1===e.code&&e.status?(k.success("添加成功"),s(),D.value=!0):[2,3,4,5].includes(e.code)&&!e.status&&(k.msg({message:e.msg,type:"error",duration:0,dangerouslyUseHTMLString:!0,showClose:!0}),5===e.code?(M.value=!1,s(),D.value=!0):(M.value=!1,F("showFooterFun",!0)))})(s,e)}),M.value=!0,F("showFooterFun",!1)}}}),(e,s)=>(t(),r(c,null,[l(u(i(T),{class:"p-2rem"},null,512),[[n,!i(M)]]),i(M)?(t(),r("pre",{key:0,ref_key:"installShow",ref:q,class:"whitespace-pre-wrap h-[40rem] overflow-auto bg-[#444] p-12px",innerHTML:i(R)},null,8,b)):m("",!0)],64))}});export{w as default};
