← Back
Editing: create-package-legacy.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={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",s=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 o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),l=new A(r||[]);return a(i,"_invoke",{value:j(e,n,l)}),i}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 h="suspendedStart",m="suspendedYield",y="executing",v="completed",g={};function _(){}function b(){}function w(){}var x={};f(x,u,(function(){return this}));var V=Object.getPrototypeOf,E=V&&V(V(F([])));E&&E!==o&&i.call(E,u)&&(x=E);var L=w.prototype=_.prototype=Object.create(x);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function q(t,n){function r(o,a,l,u){var c=d(t[o],t,a);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==e(f)&&i.call(f,"__await")?n.resolve(f.__await).then((function(e){r("next",e,l,u)}),(function(e){r("throw",e,l,u)})):n.resolve(f).then((function(e){s.value=e,l(s)}),(function(e){return r("throw",e,l,u)}))}u(c.arg)}var o;a(this,"_invoke",{value:function(e,t){function i(){return new n((function(n,o){r(e,t,n,o)}))}return o=o?o.then(i,i):i()}})}function j(e,t,r){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:n,done:!0}}for(r.method=i,r.arg=a;;){var l=r.delegate;if(l){var u=k(l,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var c=d(e,t,r);if("normal"===c.type){if(o=r.done?v:m,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=v,r.method="throw",r.arg=c.arg)}}}function k(e,t){var r=t.method,o=e.iterator[r];if(o===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=n,k(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,g;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function S(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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function F(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(i.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=n,e.done=!0,e};return a.next=a}}throw new TypeError(e(t)+" is not iterable")}return b.prototype=w,a(L,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:b,configurable:!0}),b.displayName=f(w,s,"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,w):(e.__proto__=w,f(e,s,"GeneratorFunction")),e.prototype=Object.create(L),e},r.awrap=function(e){return{__await:e}},P(q.prototype),f(q.prototype,c,(function(){return this})),r.AsyncIterator=q,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var a=new q(p(e,t,n,o),i);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(L),f(L,s,"Generator"),f(L,u,(function(){return this})),f(L,"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,A.prototype={constructor:A,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(O),!e)for(var t in this)"t"===t.charAt(0)&&i.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,o){return l.type="throw",l.arg=e,t.next=r,o&&(t.method="next",t.arg=n),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],l=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},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),O(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 o=r.arg;O(n)}return o}}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,o,i,a){try{var l=e[i](a),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,o)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function l(e){n(a,o,i,l,u,"next",e)}function u(e){n(a,o,i,l,u,"throw",e)}l(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index.vue_vue_type_script_setup_true_lang-legacy6.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./useStore-legacy5.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy106.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER"],(function(e,n){"use strict";var o,i,a,l,u,c,s,f,p,d,h,m,y,v,g,_,b,w,x,V,E,L,P,q,j,k,S,O,A,F,I,N;return{setters:[function(e){o=e.by,i=e.J,a=e.j,l=e.a6,u=e.V,c=e.b},function(e){s=e.c,f=e.r,p=e.h,d=e.o,h=e.B,m=e.C,y=e.p,v=e.k,g=e.l,_=e.e,b=e.x,w=e.q,x=e.I,V=e.aY,E=e.y,L=e.D,P=e.a7,q=e.A,j=e.aO,k=e.Q,S=e.a4},function(e){O=e._},function(e){A=e.getPhpEnvInfo,F=e.createPhpApp},function(e){I=e.f},function(e){N=e.u},null,null,null],execute:function(){var n={class:"p-2rem max-h-[60rem] overflow-y-auto"},U={class:"inline-block max-w-[48rem] truncate"},G=["onClick"],T={class:"flex items-center"};e("default",s({__name:"create-package",props:{compData:{default:{}}},setup:function(e,s){var C=s.expose,B=e,D=c(),H=N().siteInfo,M=f(!1),z=f(),K=p({name:"",version:"",path:"",phpVersion:[],function:"",mysqlVersion:[],databaseName:"",databaseId:"",dir:"",log:"",init:!1,initFile:[],initData:""}),R=f([]),Y=f([]),J=f([]),Q=[{content:"如果您的应用有多个需要支持php或mysql版本,请添加"},{content:"打包时会将当前使用PHP版本的所有扩展记录,应用部署时会自动安装"},{content:"如果您有需要自动填充数据库的数据库配置文件,请到配置文件中将数据库的信息修改成如下值再进行打包<br >\n\t\t数据库名:BT_APP_PACKAGE_DB_NAME<br >\n\t\t数据库账户:BT_APP_PACKAGE_DB_USER<br >\n\t\t数据库密码:BT_APP_PACKAGE_DB_PASS",isHtml:!0}],W=p({name:[o({message:"请输入名称"})],version:[o({message:"请输入版本"})],phpVersion:[o({message:"请选择php版本",trigger:"change"})]}),X=function(){I({type:"file",change:function(e){e.endsWith(".php")?K.initFile.some((function(t){return t.file===e}))?D.error("文件已存在"):K.initFile.push({file:e,body:""}):D.error("请选择.php格式的数据配置文件")}})},Z=function(){var e=r(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i({loading:M,request:A({site_name:H.value.name}),success:function(e){var t;e.status&&(t=e.data,R.value=t.php.versions.map((function(e){return{value:e,label:"PHP-".concat(e)}})),K.phpVersion=""!==t.php.last_php_versions?t.php.last_php_versions:"00"===t.php.used?[]:[t.php.used],Y.value=t.mysql.versions.map((function(e){return{value:e,label:"Mysql-".concat(e)}})),K.mysqlVersion=""!==t.mysql.last_mysql_versions?t.mysql.last_mysql_versions:[t.mysql.used],J.value=t.db.all.map((function(e){return{value:e.id,label:"".concat(e.name)}})),K.databaseId=t.mysql.last_db_id||t.db.used.id,K.databaseName=t.mysql.last_db_name||t.db.used.name,K.init=!!(t.mysql.last_db_config_files.length>0&&t.mysql.last_db_id)||!!(t.db_config_file.length>0&&t.db.used.name),K.initFile=t.mysql.last_db_config_files.length>0?t.mysql.last_db_config_files:t.db_config_file,K.function=t.last_php_functions)}});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$=function(){var e,t={site_name:H.value.name,app_name:K.name,app_version:K.version,php_versions:K.phpVersion.join(","),init_sql:K.init?1:0,success_url:K.path,db_config_files:JSON.stringify(K.initFile.map((function(e){return e.file})))};K.init&&(t.db_id=K.databaseId,t.db_name=(null===(e=J.value.find((function(e){return e.value===K.databaseId})))||void 0===e?void 0:e.label)||"");return""!==K.function&&(t.php_functions=K.function),K.mysqlVersion.length>0&&(t.mysql_versions=K.mysqlVersion.join(",")),""!==K.dir&&(t.exclude_dir=K.dir),""!==K.log&&(t.update_log=K.log),t};return d((function(){return Z()})),C({onConfirm:function(e){z.value.validate(function(){var n=r(t().mark((function n(r){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}return t.abrupt("return");case 2:o=$(),i({loading:"正在创建,请稍后...",request:F(o),message:!0,success:function(t){t.status&&(B.compData.refreshEvent(),e())}});case 4:case"end":return t.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())}}),function(e,t){var r=a,o=P,i=l,c=O,s=q,f=j,p=k,d=S,A=u,F=h("bt-loading");return m((v(),g("div",n,[_(d,{ref_key:"packFormRef",ref:z,model:y(K),rules:y(W),"label-width":"120px"},{default:b((function(){return[_(o,{label:"名称",prop:"name"},{default:b((function(){return[_(r,{modelValue:y(K).name,"onUpdate:modelValue":t[0]||(t[0]=function(e){return y(K).name=e}),width:"35rem"},null,8,["modelValue"])]})),_:1}),_(o,{label:"版本",prop:"version"},{default:b((function(){return[_(r,{modelValue:y(K).version,"onUpdate:modelValue":t[1]||(t[1]=function(e){return y(K).version=e}),width:"35rem",placeholder:"版本"},null,8,["modelValue"])]})),_:1}),_(o,{label:"PHP",prop:"phpVersion"},{default:b((function(){return[_(i,{modelValue:y(K).phpVersion,"onUpdate:modelValue":t[2]||(t[2]=function(e){return y(K).phpVersion=e}),multiple:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",class:"w-[35rem]",placeholder:"请选择PHP版本",options:y(R)},null,8,["modelValue","options"])]})),_:1}),_(o,{label:"需要解禁的函数"},{default:b((function(){return[_(r,{modelValue:y(K).function,"onUpdate:modelValue":t[3]||(t[3]=function(e){return y(K).function=e}),type:"textarea",width:"35rem",resize:"none",rows:2,placeholder:"多个请用 , 逗号隔开"},null,8,["modelValue"])]})),_:1}),_(o,{label:"部署成功后访问的URL",prop:"path"},{default:b((function(){return[_(r,{modelValue:y(K).path,"onUpdate:modelValue":t[4]||(t[4]=function(e){return y(K).path=e}),width:"35rem",placeholder:"例如:/index.php"},null,8,["modelValue"])]})),_:1}),_(o,{label:"Mysql",prop:"mysqlVersion"},{default:b((function(){return[_(i,{modelValue:y(K).mysqlVersion,"onUpdate:modelValue":t[5]||(t[5]=function(e){return y(K).mysqlVersion=e}),multiple:"",clearable:"",class:"w-[35rem]",placeholder:"请选择Mysql版本",options:y(Y)},null,8,["modelValue","options"])]})),_:1}),_(o,{label:"数据库配置文件"},{default:b((function(){return[w("div",null,[(v(!0),g(x,null,V(y(K).initFile,(function(e){return v(),g("div",{key:e.file,class:"flex items-center"},[w("div",U,[_(c,{text:e.file},null,8,["text"])]),w("span",{class:"ml-[1rem] text-danger cursor-pointer",onClick:function(t){return function(e){K.initFile=K.initFile.filter((function(t){return t.file!==e}))}(e.file)}},"删除",8,G)])})),128)),w("div",T,[_(s,{onClick:X},{default:b((function(){return t[10]||(t[10]=[E("添加配置文件")])})),_:1}),_(f,{class:"item",effect:"dark",content:"如果自动识别有误,请从服务器选择.php格式的数据配置文件,部署时会自动填充新的数据库账号信息",placement:"top"},{default:b((function(){return t[11]||(t[11]=[w("span",{class:"svgtofont-el-warning-filled text-warning text-[1.6rem] ml-[1rem]"},null,-1)])})),_:1})])])]})),_:1}),_(o,{label:" "},{default:b((function(){return[_(p,{modelValue:y(K).init,"onUpdate:modelValue":t[6]||(t[6]=function(e){return y(K).init=e})},{default:b((function(){return t[12]||(t[12]=[E("将当前网站关联的数据库当作初始化数据")])})),_:1},8,["modelValue"])]})),_:1}),m(_(o,{label:"关联数据库",prop:"databaseId"},{default:b((function(){return[_(i,{modelValue:y(K).databaseId,"onUpdate:modelValue":t[7]||(t[7]=function(e){return y(K).databaseId=e}),class:"w-[35rem]",placeholder:"请选择关联数据库",options:y(J)},null,8,["modelValue","options"])]})),_:1},512),[[L,y(K).init]]),_(o,{label:"需要排除的目录"},{default:b((function(){return[_(r,{modelValue:y(K).dir,"onUpdate:modelValue":t[8]||(t[8]=function(e){return y(K).dir=e}),type:"textarea",width:"35rem",resize:"none",rows:2,placeholder:"一行一个,只支持绝对路径"},null,8,["modelValue"])]})),_:1}),_(o,{label:"更新日志"},{default:b((function(){return[_(r,{modelValue:y(K).log,"onUpdate:modelValue":t[9]||(t[9]=function(e){return y(K).log=e}),type:"textarea",width:"35rem",resize:"none",rows:2},null,8,["modelValue"])]})),_:1})]})),_:1},8,["model","rules"]),_(A,{options:Q,class:"pl-[5rem]"})])),[[F,y(M)]])}}}))}}}))}();
Save File
Cancel