import{_ as a}from"./index133.js?v=1761009159";import{c as s,r as e,au as t,o as n,q as i,aF as o,y as r,v as l,N as u,B as m,x as c,z as p,e as v,C as d,D as f,b1 as x}from"./base-lib.js?v=1761009159";import{u as b,aH as y,b1 as _,e as k,b as g}from"./utils-lib.js?v=1761009159";import{k as w}from"./validator.js?v=1761009159";import{u as j}from"./useStore4.js?v=1761009159";const h={key:0,class:"content-mask"},I={key:1,class:"content-mask"},T=s({__name:"index",props:{compData:{default:{}}},emits:["init"],setup(s,{expose:T,emit:C}){const D=g(),N=C,{plugin:S,getGlobalInfo:q}=b(),{activeType:z}=j(),A=e(S.value.webserver),B=t("_".concat(z.value,"_mask"),!1),F=e(!1),G=n({title:"",name:"",status:!0,version:"",admin:!1,s_version:"",setup:!1}),H=async a=>{const{data:s}=await y({sName:a.name});if("-1"===s.task)return D.error("当前插件正在安装，不可重复安装");w({name:null==s?void 0:s.name,type:"i",pluginInfo:s}),O()};let L=!1;const O=async(a=!1)=>{try{if(L)return;const{data:s}=await _({name:"web"});s.status||a||setTimeout(()=>{O()},3e3),s.status&&!a&&N("init"),B.value=!s.status,Object.assign(G,s),"proxy"===z.value&&"nginx"!==s.name&&(B.value=!0,F.value=s.status)}catch(s){a||setTimeout(()=>{O()},3e3)}};return i(()=>{O(!0)}),o(()=>{L=!0}),T({checkInstallStatus:O,pluginInfo:G,maskLayer:B,webServerType:A}),(s,e)=>{const t=k,n=x,i=a;return r(B)?(l(),u(i,{key:0,width:"38rem"},{content:m(()=>[r(F)?(l(),c("div",I,e[6]||(e[6]=[p("span",null,"反向代理项目只支持nginx环境",-1)]))):(l(),c("div",h,[e[4]||(e[4]=p("i",{class:"svgtofont-el-warning text-warning !text-[2.2rem] mr-4px"},null,-1)),e[5]||(e[5]=p("span",null,"未安装运行环境，",-1)),v(t,{onClick:e[0]||(e[0]=a=>H({name:"nginx"})),class:"!font-bold !text-base"},{default:m(()=>e[2]||(e[2]=[d("安装Nginx",-1)])),_:1,__:[2]}),v(n,{direction:"vertical"}),"proxy"!==s.compData.type?(l(),u(t,{key:0,onClick:e[1]||(e[1]=a=>H({name:"apache"})),class:"!font-bold !text-base"},{default:m(()=>e[3]||(e[3]=[d("安装Apache",-1)])),_:1,__:[3]})):f("",!0)]))]),_:1})):f("",!0)}}});export{T as _};
