← Back
Editing: index374.js
import{u as e,G as a,k as t,bU as l,bg as r,bV as s,bW as p}from"./utils-lib.js?v=VERSION_NUMBER";import{c as o,r as n,t as u,g as i,e as m,ax as d,B as v,p as w,q as c,M as f,x as _}from"./base-lib.js?v=VERSION_NUMBER";import{l as b}from"./form-item.js?v=VERSION_NUMBER";import{a as g,o as h}from"./index75.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";import"./index103.js?v=VERSION_NUMBER";import"./index.vue_vue_type_script_setup_true_lang6.js?v=VERSION_NUMBER";import"./index130.js?v=VERSION_NUMBER";import"./validator.js?v=VERSION_NUMBER";import"./column.js?v=VERSION_NUMBER";import"./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang.js?v=VERSION_NUMBER";import"./useStore4.js?v=VERSION_NUMBER";import"./site.js?v=VERSION_NUMBER";import"./index131.js?v=VERSION_NUMBER";import"./index141.js?v=VERSION_NUMBER";import"./index124.js?v=VERSION_NUMBER";import"./useController6.js?v=VERSION_NUMBER";const x=o({__name:"index",setup(o,{expose:x}){const j=n(!1),{panel:y}=e(),{sitePath:P}=u(y.value),F=i((()=>{var e;return P.value?null==(e=P.value+"/")?void 0:e.replace(/\/\//g,"/"):"/www/wwwroot/"})),T=n({webname:"",path:"/www/wwwroot",ftp:!1,ps:"",port:80,ftp_username:"",ftp_password:""}),{BtForm:V,submit:k}=a({data:T.value,options:e=>i((()=>(e.value.hasOwnProperty("ftp")||(e.value.ftp=!1),[{type:"custom",render:a=>(a.value.hasOwnProperty("webname")||(a.value.webname=""),m(r,{label:"绑定域名",prop:"webname"},{default:()=>[m(d,{ref:"popover",placement:"top-start","popper-class":"green-tips-popover !p-0",title:"",width:"370",visible:j.value,"onUpdate:visible":e=>j.value=e,"trigger-keys":[],trigger:"focus"},{default:()=>m("div",{class:"!p-[12px] bg-[#20a53a] text-white"},[v("如需填写多个域名,请换行填写,每行一个域名,默认为80端口"),m("br",null,null),v("IP地址格式:192.168.1.199"),m("br",null,null),v("泛解析添加方法 *.domain.com"),m("br",null,null),v("如另加端口格式为 www.domain.com:88")]),reference:()=>m(t,{rows:6,resize:"none",width:"42rem",modelValue:e.value.webname,"onUpdate:modelValue":a=>e.value.webname=a,onInput:a=>{var t,r,s,p,o;"string"==typeof a&&(e.value.ps=a.split("\n")[0],e.value.path=(null==(t=F.value)?void 0:t.replace(/\/\//g,"/"))+(null==(s=null==(r=a.split("\n")[0])?void 0:r.replace(/:/g,"_"))?void 0:s.trim()),e.value.ftp_username=null==(o=null==(p=a.split("\n")[0])?void 0:p.toString())?void 0:o.replace(/\W/g,"_").substring(0,16),e.value.ftp_password=l(12))},onFocus:()=>{j.value=!0},type:"textarea",placeholder:"如需填写多个域名,请换行填写,每行一个域名,默认为80端口\nIP地址格式:192.168.1.199\n泛解析添加方法 *.domain.com\n如另加端口格式为 www.domain.com:88"},null)})]})),key:"webname",rules:{webname:[s({message:"请输入域名",trigger:"blur"}),p()]}},{type:"input",label:"备注",key:"ps",attrs:{placeholder:"请输入备注,可为空",width:"42rem"}},b("根目录","path",{attrs:{width:"42rem",placeholder:"请输入根目录"},rules:[s({message:"请选择路径"})]},(()=>{h(e.value.path,(a=>{e.value.path=a}))})),{type:"select",label:"FTP",key:"ftp",options:[{label:"不创建",value:!1},{label:"创建",value:!0}],attrs:{style:"width: 16rem;"}},...e.value.ftp?[{type:"custom",render:a=>(a.value.hasOwnProperty("ftp_username")||(a.value.ftp_username="",a.value.ftp_password=""),m(r,{label:"FTP账号"},{default:()=>[m("div",{class:"flex items-center mb-[12px]"},[m(r,{prop:"ftp_username"},{default:()=>[m(t,{placeholder:"创建FTP账号",width:"16rem",modelValue:e.value.ftp_username,"onUpdate:modelValue":a=>e.value.ftp_username=a},null)]}),m(r,{label:"密码",class:"!mt-0",prop:"ftp_password"},{default:()=>[m(t,{width:"16rem",placeholder:"FTP密码",modelValue:e.value.ftp_password,"onUpdate:modelValue":a=>e.value.ftp_password=a},null)]})]),m("span",{class:"text-[#999] text-[1.2rem]"},[v("创建站点的同时,为站点创建一个对应FTP帐户,并且FTP目录指向站点所在目录。")])]})),rules:{ftp_username:[{validator:(a,t,l)=>{e.value.ftp?0===t.length?l(new Error("FTP用户名不能为空!")):/^[a-zA-Z0-9_]+$/g.test(t)?t.length<=3?l(new Error("FTP用户名长度错误,不能少于3个字符!")):l():l(new Error("FTP用户名只能包含字母、数字和下划线!")):l()},trigger:["blur","change"]}],ftp_password:[{validator:(a,t,l)=>{""===t&&e.value.ftp?l(new Error("FTP密码不能为空!")):l()},trigger:["blur","change"]}]}}]:[]]))),submit:async(e,a)=>(await a(),await g(e.value))});return w((()=>{P.value&&Object.assign(T.value,{path:P.value})})),x({onConfirm:k}),(e,a)=>(c(),f(_(V),{class:"p-2rem"}))}});export{x as default};
Save File
Cancel