import{K as e,c5 as a,ar as l,ax as s,bq as t,k as r,e as o}from"./utils-lib.js?v=1761009159";import{c as n,r as u,s as i,g as m,e as p,C as d,aS as c,U as v,az as w,v as f,x as _,y as b,z as h,B as g,D as x}from"./base-lib.js?v=1761009159";import{l as y,b as j,d as k,g as V}from"./form-item.js?v=1761009159";import{S as U}from"./useStore4.js?v=1761009159";import{a as P,o as I,u as C,s as O}from"./index77.js?v=1761009159";const z={class:"p-2rem"},S={key:0,class:"mt-[20px] leading-8 text-small list-disc ml-[2rem]"},q=n({__name:"index",setup(n,{expose:q}){const B=u(!1),{siteInfo:F}=i(U()),{checkPortUseEvent:D}=U(),{BtForm:E,submit:K}=e({data:P,options:e=>m(()=>[y("项目执行文件","project_exe",{attrs:{placeholder:"请选择项目可执行文件",style:"width: 32rem;"},rules:[a({message:"请选择项目可执行文件"})]},()=>{I(e.value.project_exe,a=>{e.value.project_exe=a;let l=a.substring(a.lastIndexOf("/")+1).replace(/\W/g,"_");e.value.project_name||(e.value.project_name=l),e.value.project_ps||(e.value.project_ps=l)})}),j("项目名称","project_name",{attrs:{placeholder:"请输入项目名称",style:"width: 32rem;",disabled:!!F.value,onInput:()=>{}},rules:[a({message:"请输入项目名称"})]}),k([j("项目端口","port",{attrs:{placeholder:"请输入项目的真实端口",style:"width: 20rem;",onChange:D},rules:[a({message:"请输入端口号",trigger:"blur"}),l()]}),...F.value?[]:[{type:"custom",render:a=>(a.value.hasOwnProperty("release_firewall")||(a.value.release_firewall=!1),p(v,{modelValue:e.value.release_firewall,"onUpdate:modelValue":a=>e.value.release_firewall=a,class:"ml-1rem"},{default:()=>[p("div",{class:"flex items-center"},[p("span",{class:"!text-small"},[d("放行端口")]),p(c,{effect:"dark",placement:"right",content:"选中将在防火墙安全组放行监听端口，放行后该项目可在外网访问"},{default:()=>[p("i",{class:"svgtofont-el-question-filled text-small ml-[4px] text-warning"},null)]})])]}))}]]),j("执行命令","project_cmd",{attrs:{placeholder:"请输入项目的执行命令",style:"width: 32rem;"},rules:[a({message:"请输入项目执行命令"})]}),{type:"custom",render:a=>p(t,{label:"运行用户"},{default:()=>[p("div",{class:"flex items-center"},[p("div",{class:"w-[20rem]"},[p(s,{modelValue:e.value.run_user,"onUpdate:modelValue":a=>e.value.run_user=a,options:C.value},null)]),p("div",{class:"text-small ml-1rem"},[d("* 无特殊需求请选择www用户")])])]})},{type:"custom",render:a=>(a.value.hasOwnProperty("is_power_on")||(a.value.is_power_on=!1),p(t,{label:"开机启动"},{default:()=>[p(v,{modelValue:e.value.is_power_on,"onUpdate:modelValue":a=>e.value.is_power_on=a},{default:()=>[p("span",{class:"!text-small"},[d("是否设置开机启动")])]})]}))},j("项目备注","project_ps",{attrs:{placeholder:"输入项目备注，非必填",style:"width: 32rem;"}}),...F.value?[V("保存配置",{label:" ",attrs:{type:"primary",onClick:K}})]:[{type:"custom",render:a=>(a.value.hasOwnProperty("domains")||(a.value.domains=""),p(t,{label:"绑定域名"},{default:()=>[p(w,{ref:"popover",placement:"top-start","popper-class":"green-tips-popover !p-0",title:"",width:"400",visible:B.value,"onUpdate:visible":e=>B.value=e,"trigger-keys":[],trigger:"focus"},{default:()=>p("div",{class:"!p-[12px] bg-primary text-white"},[d("如需填写多个域名，请换行填写，每行一个域名，默认为80端口"),p("br",null,null),d("IP地址格式：192.168.1.199"),p("br",null,null),d("泛解析添加方法 *.domain.com"),p("br",null,null),d("如另加端口格式为 www.domain.com:88")]),reference:()=>p(r,{rows:6,resize:"none",width:"40rem",modelValue:e.value.domains,"onUpdate:modelValue":a=>e.value.domains=a,onFocus:()=>{B.value=!0},type:"textarea",placeholder:"如需填写多个域名，请换行填写，每行一个域名，默认为80端口\nIP地址格式：192.168.1.199\n泛解析添加方法 *.domain.com\n如另加端口格式为 www.domain.com:88"},null)})]}))}]]),submit:async(e,a)=>(await a(),await O(e.value))});return q({onConfirm:K}),(e,a)=>{const l=o;return f(),_("div",z,[p(b(E),{"label-width":"10rem"}),b(F)?x("",!0):(f(),_("ul",S,[a[2]||(a[2]=h("li",null,"执行命令：请输入项目需要携带的参数，默认请输入执行文件名",-1)),h("li",null,[a[1]||(a[1]=d(" 项目教程可参考: ",-1)),p(l,{href:"https://www.bt.cn/bbs/thread-93034-1-1.html",target:"_blank"},{default:g(()=>a[0]||(a[0]=[d(" https://www.bt.cn/bbs/thread-93034-1-1.html ",-1),h("i",{class:"svgtofont-el-link"},null,-1)])),_:1,__:[0]})])]))])}}});export{q as _};
