← Back
Editing: index-legacy356.js
!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return r};var n,r={},a=Object.prototype,o=a.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},i=l.iterator||"@@iterator",s=l.asyncIterator||"@@asyncIterator",c=l.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(n){f=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var a=t&&t.prototype instanceof w?t:w,o=Object.create(a.prototype),l=new T(r||[]);return u(o,"_invoke",{value:P(e,n,l)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var v="suspendedStart",m="suspendedYield",h="executing",y="completed",g={};function w(){}function b(){}function _(){}var x={};f(x,i,(function(){return this}));var V=Object.getPrototypeOf,L=V&&V(V(F([])));L&&L!==a&&o.call(L,i)&&(x=L);var k=_.prototype=w.prototype=Object.create(x);function j(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function S(t,n){function r(a,u,l,i){var s=d(t[a],t,u);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==e(f)&&o.call(f,"__await")?n.resolve(f.__await).then((function(e){r("next",e,l,i)}),(function(e){r("throw",e,l,i)})):n.resolve(f).then((function(e){c.value=e,l(c)}),(function(e){return r("throw",e,l,i)}))}i(s.arg)}var a;u(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,a){r(e,t,n,a)}))}return a=a?a.then(o,o):o()}})}function P(e,t,r){var a=v;return function(o,u){if(a===h)throw Error("Generator is already running");if(a===y){if("throw"===o)throw u;return{value:n,done:!0}}for(r.method=o,r.arg=u;;){var l=r.delegate;if(l){var i=E(l,r);if(i){if(i===g)continue;return i}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===v)throw a=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=h;var s=d(e,t,r);if("normal"===s.type){if(a=r.done?y:m,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(a=y,r.method="throw",r.arg=s.arg)}}}function E(e,t){var r=t.method,a=e.iterator[r];if(a===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=n,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=d(a,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,g;var u=o.arg;return u?u.done?(t[e.resultName]=u.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):u:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function q(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function F(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,u=function e(){for(;++a<t.length;)if(o.call(t,a))return e.value=t[a],e.done=!1,e;return e.value=n,e.done=!0,e};return u.next=u}}throw new TypeError(e(t)+" is not iterable")}return b.prototype=_,u(k,"constructor",{value:_,configurable:!0}),u(_,"constructor",{value:b,configurable:!0}),b.displayName=f(_,c,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,f(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},r.awrap=function(e){return{__await:e}},j(S.prototype),f(S.prototype,s,(function(){return this})),r.AsyncIterator=S,r.async=function(e,t,n,a,o){void 0===o&&(o=Promise);var u=new S(p(e,t,n,a),o);return r.isGeneratorFunction(t)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},j(k),f(k,c,"Generator"),f(k,i,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},r.values=F,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(q),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,a){return l.type="throw",l.arg=e,t.next=r,a&&(t.method="next",t.arg=n),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],l=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var i=o.call(u,"catchLoc"),s=o.call(u,"finallyLoc");if(i&&s){if(this.prev<u.catchLoc)return r(u.catchLoc,!0);if(this.prev<u.finallyLoc)return r(u.finallyLoc)}else if(i){if(this.prev<u.catchLoc)return r(u.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return r(u.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;q(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:F(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),g}},r}function n(e,t,n,r,a,o,u){try{var l=e[o](u),i=l.value}catch(e){return void n(e)}l.done?t(i):Promise.resolve(i).then(r,a)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(a,o){var u=e.apply(t,r);function l(e){n(u,a,o,l,i,"next",e)}function i(e){n(u,a,o,l,i,"throw",e)}l(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy101.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER","./useController-legacy5.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./useController-legacy6.js?v=VERSION_NUMBER","./useMethod-legacy5.js?v=VERSION_NUMBER"],(function(e,n){"use strict";var a,o,u,l,i,s,c,f,p,d,v,m,h,y,g,w,b,_,x,V,L,k,j,S,P,E,O,q,T,F,U,C,N,D,G,I,M,H,A,Q,R,W,Y,z,B,J;return{setters:[function(e){a=e.u,o=e.aq,u=e.bv,l=e.bU,i=e.n,s=e.L,c=e.at,f=e.k,p=e.ag,d=e.c,v=e.b,m=e.e},function(e){h=e.c,y=e.k,g=e.ay,w=e.r,b=e.g,_=e.p,x=e.q,V=e.v,L=e.e,k=e.A,j=e.x,S=e.P,P=e.H,E=e.y,O=e.B,q=e.C,T=e.M,F=e.F,U=e.a_,C=e.ax,N=e.a9,D=e.ai,G=e.aj,I=e.a7,M=e.bx},function(e){H=e._},function(e){A=e.k,Q=e.f},function(e){R=e.addPhpSite,W=e.GetPHPVersion},function(e){Y=e.u},function(e){z=e.l,B=e.v,J=e.h},null,null,null,null,null],execute:function(){var K={class:""},X={class:"items-center flex"},Z={class:"flex items-center mb-[8px]"},$={class:"flex items-center"},ee={class:"flex items-center mb-[4px]"},te=h({__name:"index",props:{compData:{default:{}}},setup:function(e,m){var h=m.expose,te=e,ne=a().panel,re=Y().isRefreshList,ae=v(),oe=y({database:!1,ftp:!1}),ue=g("popupClose"),le=w(!1),ie=w(),se=w(!1),ce=w({menuType:"addDefault",path:"/www/wwwroot",ftp:!1,type:"PHP",type_id:0,ps:"",port:"",version:"",need_index:0,need_404:0,sql:!1,codeing:"utf8mb4",webname:"",add_dns_record:!1,ftp_username:"",ftp_password:"",datauser:"",datapassword:""}),fe=w({ftp:!0,ftpStatus:!0,ftpData:{username:"",password:""},sql:!0,databaseStatus:!0,sqlData:{username:"",password:""},siteStatus:!1,site:{name:!1},dns:[],title:""}),pe="/www/wwwroot/",de=w([]),ve=b((function(){return z.value.filter((function(e){return"all"!==e.value&&Number(e.value)>=0}))})),me=function(){var e;null!==(e=J.value)&&void 0!==e&&e.setClassManage&&J.value.setClassManage()},he=function(){var e=r(t().mark((function e(n){var r,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o({sName:n});case 2:r=e.sent,a=r.data,A({name:a.name,type:"i",pluginInfo:a});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ye=function(){Q({type:"dir",path:ce.value.path,change:function(e){var t,n=u(e,"string","");ce.value.path=n,pe=null===(t=n+"/")||void 0===t?void 0:t.replace(/\/\//g,"/")}})},ge=function(){var e=r(t().mark((function e(){var n,r,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,W();case 3:r=e.sent,de.value=r.data,a="00",null===(n=de.value)||void 0===n||n.forEach((function(e){Number(e.version)>Number(a)&&(a=e.version)})),ce.value.version=a,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),we=function(e){var t,n,r,a;"string"==typeof e&&(ce.value.ps=e.split("\n")[0],ce.value.path=(null===(t=pe)||void 0===t?void 0:t.replace(/\/\//g,"/"))+(null===(n=e.split("\n")[0])||void 0===n||null===(n=n.replace(/:/g,"_"))||void 0===n?void 0:n.trim()),ce.value.ftp_username=null===(r=e.split("\n")[0])||void 0===r?void 0:r.replace(/\W/g,"_"),ce.value.ftp_password=l(16),ce.value.datauser=null===(a=e.split("\n")[0])||void 0===a||null===(a=a.replace(/\W/g,"_"))||void 0===a?void 0:a.substr(0,16),ce.value.datapassword=l(16))},be=function(){var e=r(t().mark((function e(r){var a,o,u,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(a=Object.assign({},ce.value)).ftp?(fe.value.ftpData.username=a.ftp_username,fe.value.ftpData.password=a.ftp_password):(delete a.ftp_username,delete a.ftp_password,fe.value.ftp=!1),a.sql?(fe.value.sqlData.username=a.datauser,fe.value.sqlData.password=a.datapassword):(delete a.datauser,delete a.datapassword,fe.value.sql=!1),-1!==a.webname.split("\n")[0].indexOf(":")?a.port=a.webname.split("\n")[0].split(":")[1]:a.port=80,o=a.webname.split("\n"),u=null==o?void 0:o.map((function(e){return e.split(":")[0]})),o.shift(),a.webname=JSON.stringify({domain:a.webname.split("\n")[0],domainlist:o,count:o.length}),delete a.menuType,e.next=11,ie.value.validate();case 11:return e.prev=11,le.value=!0,e.next=15,R(a);case 15:l=e.sent,ce.value.add_dns_record&&l.status&&(fe.value.dns=u.filter((function(e){return e.length})).map((function(e){return{domain:e,status:!1,msg:""}})),fe.value.title=l.status?"添加网站成功":l.msg),l.status&&ue(),a.ftp||a.sql||fe.value.dns.length?(fe.value.ftpStatus=l.data.ftpStatus,fe.value.databaseStatus=l.data.databaseStatus,fe.value.siteStatus=l.data.siteStatus,fe.value.site.name=!1,i({isAsync:!0,title:"网站添加结果",area:46,component:function(){return s((function(){return n.import("./add-result-legacy.js?v=VERSION_NUMBER")}),void 0,n.meta.url)},compData:fe.value})):ae.msg({customClass:"bt-message-error-html",dangerouslyUseHTMLString:!0,message:l.status?"添加网站成功":l.msg,type:l.status?"success":"error",duration:l.status?3e3:0,showClose:!l.status}),re.value=!0,e.next=25;break;case 22:e.prev=22,e.t0=e.catch(11),c(e.t0);case 25:return e.prev=25,le.value=!1,e.finish(25);case 28:case"end":return e.stop()}}),e,null,[[11,22,25,28]])})));return function(t){return e.apply(this,arguments)}}(),_e=function(){var e=r(t().mark((function e(){var n,r,a,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,te.compData.getStatus();case 2:return r=e.sent,oe.database=r.mysql,oe.ftp=r.ftp,ce.value.type_id=null===(n=ve.value[0])||void 0===n?void 0:n.value,e.next=8,ge();case 8:(a=ne.value.sitePath)&&(ce.value.path=a,pe=null===(o=a+"/")||void 0===o?void 0:o.replace(/\/\//g,"/"));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return _(_e),h({init:_e,onConfirm:be}),function(e,t){var n=f,r=C,a=N,o=H,u=D,l=G,i=p,s=d,c=I,v=M;return x(),V("div",K,[L(c,{model:j(ce),rules:j(B),disabled:j(le),ref_key:"addSiteFormRef",ref:ie},{default:k((function(){return[L(a,{label:"域名",prop:"webname"},{default:k((function(){return[L(r,{ref:"popover",placement:"top-start","popper-class":"green-tips-popover !p-0",title:"",width:"400",visible:j(se),"onUpdate:visible":t[2]||(t[2]=function(e){return S(se)?se.value=e:null}),"trigger-keys":[],trigger:"focus"},{reference:k((function(){return[P(L(n,{onInput:we,modelValue:j(ce).webname,"onUpdate:modelValue":t[0]||(t[0]=function(e){return j(ce).webname=e}),type:"textarea",width:"52rem",rows:7,resize:"none",onFocus:t[1]||(t[1]=function(e){return se.value=!0}),placeholder:"如需填写多个域名,请换行填写,每行一个域名,默认为80端口\nIP地址格式:192.168.1.199\n泛解析添加方法 *.domain.com\n如另加端口格式为 www.domain.com:88"},null,8,["modelValue"]),[[v,void 0,"popover"]])]})),default:k((function(){return[t[16]||(t[16]=E("div",{class:"!p-[12px] bg-[#20a53a] text-white"},[O(" 如需填写多个域名,请换行填写,每行一个域名,默认为80端口 "),E("br"),O(" IP地址格式:192.168.1.199 "),E("br"),O(" 泛解析添加方法 *.domain.com "),E("br"),O(" 如另加端口格式为 www.domain.com:88 ")],-1))]})),_:1},8,["visible"])]})),_:1}),L(a,{label:"备注"},{default:k((function(){return[L(n,{modelValue:j(ce).ps,"onUpdate:modelValue":t[3]||(t[3]=function(e){return j(ce).ps=e}),placeholder:"请输入备注,可为空",width:"52rem"},null,8,["modelValue"])]})),_:1}),L(a,{label:"根目录",prop:"path"},{default:k((function(){return[L(o,{modelValue:j(ce).path,"onUpdate:modelValue":t[4]||(t[4]=function(e){return j(ce).path=e}),placeholder:"请输入根目录",icon:"el-folder-opened",width:"52rem",onIconClick:ye},null,8,["modelValue"])]})),_:1}),L(a,{label:"FTP"},{default:k((function(){return[E("div",X,[L(l,{class:"!w-[15rem]",modelValue:j(ce).ftp,"onUpdate:modelValue":t[5]||(t[5]=function(e){return j(ce).ftp=e}),disabled:!j(oe).ftp},{default:k((function(){return[L(u,{label:"不创建",value:!1}),L(u,{label:"创建",value:!0})]})),_:1},8,["modelValue","disabled"]),j(oe).ftp?q("",!0):(x(),V("span",{key:0,onClick:t[6]||(t[6]=function(e){return he("pureftpd")}),class:"ml-[4px] text-danger cursor-pointer !text-[1.2rem]"},"未安装FTP,点击安装"))])]})),_:1}),j(ce).ftp?(x(),T(a,{key:0,label:"FTP账号"},{default:k((function(){return[E("div",Z,[L(a,{prop:"ftp_username"},{default:k((function(){return[L(n,{placeholder:"创建FTP账号",modelValue:j(ce).ftp_username,"onUpdate:modelValue":t[7]||(t[7]=function(e){return j(ce).ftp_username=e}),width:"24rem"},null,8,["modelValue"])]})),_:1}),L(a,{label:"密码",class:"!mt-0"},{default:k((function(){return[L(n,{placeholder:"FTP密码",modelValue:j(ce).ftp_password,"onUpdate:modelValue":t[8]||(t[8]=function(e){return j(ce).ftp_password=e}),width:"24rem"},null,8,["modelValue"])]})),_:1})]),t[17]||(t[17]=E("span",{class:"text-[#999] text-[1.2rem]"},"创建站点的同时,为站点创建一个对应FTP帐户,并且FTP目录指向站点所在目录。",-1))]})),_:1})):q("",!0),L(a,{label:"数据库"},{default:k((function(){return[E("div",$,[L(l,{class:"!w-[15rem]",modelValue:j(ce).sql,"onUpdate:modelValue":t[9]||(t[9]=function(e){return j(ce).sql=e}),disabled:!j(oe).database},{default:k((function(){return[L(u,{label:"不创建",value:!1}),L(u,{label:"MySQL",value:"MySQL"})]})),_:1},8,["modelValue","disabled"]),j(oe).database?q("",!0):(x(),V("span",{key:0,onClick:t[10]||(t[10]=function(e){return he("mysql")}),class:"ml-[4px] text-danger cursor-pointer !text-[1.2rem]"},"未安装数据库,点击安装")),j(ce).sql?(x(),T(l,{key:1,class:"ml-[8px] !w-[15rem]",modelValue:j(ce).codeing,"onUpdate:modelValue":t[11]||(t[11]=function(e){return j(ce).codeing=e})},{default:k((function(){return[L(u,{label:"utf8mb4",value:"utf8mb4"}),L(u,{label:"utf8",value:"utf8"}),L(u,{label:"gbk",value:"gbk"}),L(u,{label:"big5",value:"big5"})]})),_:1},8,["modelValue"])):q("",!0)])]})),_:1}),j(ce).sql?(x(),T(a,{key:1,label:"数据库账号"},{default:k((function(){return[E("div",ee,[L(a,{prop:"datauser"},{default:k((function(){return[L(n,{placeholder:"创建数据库账号",class:"w-[24rem]",modelValue:j(ce).datauser,"onUpdate:modelValue":t[12]||(t[12]=function(e){return j(ce).datauser=e})},null,8,["modelValue"])]})),_:1}),L(a,{label:"密码",class:"!mt-0"},{default:k((function(){return[L(n,{placeholder:"数据库密码",class:"w-[24rem]",modelValue:j(ce).datapassword,"onUpdate:modelValue":t[13]||(t[13]=function(e){return j(ce).datapassword=e})},null,8,["modelValue"])]})),_:1})]),t[18]||(t[18]=E("span",{class:"text-[#999] text-[1.2rem]"},"创建站点的同时,为站点创建一个对应的数据库帐户,方便不同站点使用不同数据库。",-1))]})),_:1})):q("",!0),L(a,{label:"PHP版本"},{default:k((function(){return[L(l,{class:"!w-[15rem]",modelValue:j(ce).version,"onUpdate:modelValue":t[14]||(t[14]=function(e){return j(ce).version=e})},{default:k((function(){return[(x(!0),V(F,null,U(j(de),(function(e){return x(),T(u,{key:e.value,label:e.name,value:e.version},null,8,["label","value"])})),128))]})),_:1},8,["modelValue"])]})),_:1}),L(a,{label:"网站分类"},{default:k((function(){return[L(i,{modelValue:j(ce).type_id,"onUpdate:modelValue":t[15]||(t[15]=function(e){return j(ce).type_id=e}),options:j(ve),class:"!w-[15rem]"},null,8,["modelValue","options"]),L(s,{class:"ml-[8px]",onClick:me},{default:k((function(){return t[19]||(t[19]=[O("分类设置")])})),_:1})]})),_:1})]})),_:1},8,["model","rules","disabled"])])}}});e("default",m(te,[["__scopeId","data-v-61ad041d"]]))}}}))}();
Save File
Cancel