import{l as a,K as e,ak as s,j as t,b as l,e as o}from"./utils-lib.js?v=1761009159";import{c as n,r,h as p,o as i,k as m,l as d,e as u,x as c,I as _,aY as v,p as b,q as f,v as y,M as h,C as w,y as k,aO as g,bL as q,bM as x,aw as j,a7 as P,a4 as D,z as S,bt as V}from"./base-lib.js?v=1761009159";import{createPhpAppSite as I,getPhpAppUpload as M}from"./site.js?v=1761009159";import{u as H}from"./useStore5.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const O={class:"p-[20px]"},U={key:0},C={class:"truncate w-[25rem]"},L=o(n({__name:"deploy-package",props:{compData:{default:()=>{}},isConfig:{type:Boolean},formData:{}},emits:["update:formData"],setup(o,{expose:n,emit:L}){const R=o,z=l(),{isRefreshList:A}=H(),E=r(!1),F=p({domain:"",ps:""}),B=r(),J=r(!1),K=r({}),N=p({php_versions:!1,mysql_versions:!1}),T=[{key:"app_name",label:"名称"},{key:"app_version",label:"版本"},{key:"php_versions",label:"支持的PHP",text:"您服务器没有安装环境包支持的PHP版本，请先安装后再部署"},{key:"mysql_versions",label:"支持的Mysql",text:"您服务器没有安装环境包支持的Mysql版本，���先安装后再部署"},{key:"php_functions",label:"解禁的函数"},{key:"db_character",label:"Mysql字符集"},{key:"php_libs",label:"安装的扩展"}],Y={domain:[{required:!0,message:"请输入域名",trigger:"blur"}]},G=a=>{var e,s,t;switch(a){case"php_versions":const l=K.value.installed_phps||[],o=new Set((null==(e=K.value.php_versions)?void 0:e.split(","))||[]);return l.some((a=>o.has(a)))||(N.php_versions=!0),K.value.php_versions||"--";case"mysql_versions":if("00"===K.value.mysql_versions)return"无";const n=K.value.installed_mysql||[];return(null==(s=K.value.mysql_versions)?void 0:s.split(",")).some((a=>n===a))||(N.mysql_versions=!0),K.value.mysql_versions||"无";case"php_libs":return(null==(t=K.value.php_libs)?void 0:t.map((a=>a.name)).join(","))||"--";default:return K.value[a]||"--"}},Q=a=>{F.ps=a.split("\n")[0]};return i((()=>{(async()=>{try{const a=await M({app_name:R.compData.app_name,app_version:R.compData.app_version});a.status?K.value=a.data:z.error(a.msg)}catch(a){s(a)}})()})),n({onConfirm:async t=>{try{if(N.php_versions||N.mysql_versions)return void z.error("您服务器没有安装环境包支持的PHP或Mysql版本，请先安装后再部署");await B.value.validate(),J.value=!0;const s=F.domain.split("\n"),l=s[0];s.shift();const o={site_name:l,app_name:K.value.app_name,app_version:K.value.app_version,ps:F.ps,webname:JSON.stringify({domain:l,domainlist:s,count:s.length})},n=await I(o);if(n.status&&(t(),R.compData.close(),A.value=!0,n.data&&Object.keys(n.data).length))return void a({isAsync:!0,title:"网站添加结果",area:46,component:()=>e((()=>import("./add-result.js?v=1761009159")),__vite__mapDeps([]),import.meta.url),compData:{siteStatus:n.status,sql:n.data.databaseStatus,databaseStatus:n.data.databaseStatus,sqlData:{username:n.data.databaseUser,password:n.data.databasePass},site:{name:""},accessSite:n.data.success_url||""}});z.request(n)}catch(l){s(l)}finally{J.value=!1}}}),(a,e)=>{const s=g,l=q,o=x,n=t,r=j,p=P,i=D,I=V;return m(),d("div",O,[u(o,{column:3,border:""},{default:c((()=>[(m(),d(_,null,v(T,(a=>u(l,{key:a.key,label:a.label},{default:c((()=>[k(y(b(K).app_name?G(a.key):"正在获取中...")+" ",1),b(N)[a.key]?(m(),d("span",U,[u(s,{effect:"dark",content:a.text,placement:"top"},{default:c((()=>e[4]||(e[4]=[f("span",{class:"svgtofont-el-warning text-[#e6a23c] text-[1.6rem]"},null,-1)]))),_:2},1032,["content"])])):S("",!0)])),_:2},1032,["label"]))),64)),u(l,{label:"更新日志"},{default:c((()=>[u(s,{effect:"dark",content:b(K).update_log||"无",placement:"top"},{default:c((()=>[f("div",C,y(b(K).update_log||"无"),1)])),_:1},8,["content"])])),_:1})])),_:1}),u(i,{ref_key:"packFormRef",ref:B,class:"mt-[1.6rem]",model:b(F),disabled:b(J),rules:Y,"label-width":"50px"},{default:c((()=>[u(p,{label:"域名",prop:"domain"},{default:c((()=>[u(r,{ref:"popover",placement:"top-start","popper-class":"green-tips-popover !p-0",title:"",width:"400",visible:b(E),"onUpdate:visible":e[2]||(e[2]=a=>h(E)?E.value=a:null),"trigger-keys":[],trigger:"focus"},{reference:c((()=>[w(u(n,{onInput:Q,modelValue:b(F).domain,"onUpdate:modelValue":e[0]||(e[0]=a=>b(F).domain=a),type:"textarea",width:"52rem",rows:7,resize:"none",onFocus:e[1]||(e[1]=a=>E.value=!0),placeholder:"如需填写多个域名，请换行填写，每行一个域名，默认为80端口\nIP地址格式：192.168.1.199\n泛解析添加方法 *.domain.com\n如另加端口格式为 www.domain.com:88"},null,8,["modelValue"]),[[I,void 0,"popover"]])])),default:c((()=>[e[5]||(e[5]=f("div",{class:"!p-[12px] bg-[#20a53a] text-white"},[k(" 如需填写多个域名，请换行填写，每行一个域名，默认为80端口 "),f("br"),k(" IP地址格式：192.168.1.199 "),f("br"),k(" 泛解析添加方法 *.domain.com "),f("br"),k(" 如另加端口格式为 www.domain.com:88 ")],-1))])),_:1},8,["visible"])])),_:1}),u(p,{label:"备注"},{default:c((()=>[u(n,{modelValue:b(F).ps,"onUpdate:modelValue":e[3]||(e[3]=a=>b(F).ps=a),width:"52rem"},null,8,["modelValue"])])),_:1})])),_:1},8,["model","disabled"])])}}}),[["__scopeId","data-v-894a3700"]]);export{L as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
