← Back
Editing: index-legacy437.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 n};var r,n={},o=Object.prototype,a=o.hasOwnProperty,l=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},i=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function p(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(r){p=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),u=new H(n||[]);return l(a,"_invoke",{value:C(e,r,u)}),a}function m(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var h="suspendedStart",d="suspendedYield",v="executing",y="completed",g={};function _(){}function w(){}function b(){}var x={};p(x,i,(function(){return this}));var k=Object.getPrototypeOf,j=k&&k(k(U([])));j&&j!==o&&a.call(j,i)&&(x=j);var V=b.prototype=_.prototype=Object.create(x);function L(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function P(t,r){function n(o,l,u,i){var c=m(t[o],t,l);if("throw"!==c.type){var s=c.arg,p=s.value;return p&&"object"==e(p)&&a.call(p,"__await")?r.resolve(p.__await).then((function(e){n("next",e,u,i)}),(function(e){n("throw",e,u,i)})):r.resolve(p).then((function(e){s.value=e,u(s)}),(function(e){return n("throw",e,u,i)}))}i(c.arg)}var o;l(this,"_invoke",{value:function(e,t){function a(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(a,a):a()}})}function C(e,t,n){var o=h;return function(a,l){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===a)throw l;return{value:r,done:!0}}for(n.method=a,n.arg=l;;){var u=n.delegate;if(u){var i=E(u,n);if(i){if(i===g)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=m(e,t,n);if("normal"===c.type){if(o=n.done?y:d,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=y,n.method="throw",n.arg=c.arg)}}}function E(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=m(o,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,g;var l=a.arg;return l?l.done?(t[e.resultName]=l.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,g):l:(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 S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function H(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function U(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,l=function e(){for(;++o<t.length;)if(a.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return l.next=l}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=b,l(V,"constructor",{value:b,configurable:!0}),l(b,"constructor",{value:w,configurable:!0}),w.displayName=p(b,s,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,p(e,s,"GeneratorFunction")),e.prototype=Object.create(V),e},n.awrap=function(e){return{__await:e}},L(P.prototype),p(P.prototype,c,(function(){return this})),n.AsyncIterator=P,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var l=new P(f(e,t,r,o),a);return n.isGeneratorFunction(t)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},L(V),p(V,s,"Generator"),p(V,i,(function(){return this})),p(V,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},n.values=U,H.prototype={constructor:H,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},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 n(n,o){return u.type="throw",u.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],u=l.completion;if("root"===l.tryLoc)return n("end");if(l.tryLoc<=this.prev){var i=a.call(l,"catchLoc"),c=a.call(l,"finallyLoc");if(i&&c){if(this.prev<l.catchLoc)return n(l.catchLoc,!0);if(this.prev<l.finallyLoc)return n(l.finallyLoc)}else if(i){if(this.prev<l.catchLoc)return n(l.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return n(l.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var l=o?o.completion:{};return l.type=e,l.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(l)},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 r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:U(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),g}},n}function r(e,t,r,n,o,a,l){try{var u=e[a](l),i=u.value}catch(e){return void r(e)}u.done?t(i):Promise.resolve(i).then(n,o)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var l=e.apply(t,n);function u(e){r(l,o,a,u,i,"next",e)}function i(e){r(l,o,a,u,i,"throw",e)}u(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy116.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./index-legacy101.js?v=VERSION_NUMBER","./index-legacy130.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER","./validator-legacy.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER"],(function(e,r){"use strict";var o,a,l,u,i,c,s,p,f,m,h,d,v,y,g,_,w,b,x,k,j,V,L,P,C,E,O,S,H,U,I,N,G,F,q,T,A,B,D,M,R;return{setters:[function(e){o=e.at,a=e.K,l=e.p,u=e.k,i=e.c,c=e.j,s=e.b},function(e){p=e._},function(e){f=e.c,m=e.r,h=e.k,d=e.w,v=e.p,y=e.aD,g=e.q,_=e.v,w=e.x,b=e.M,x=e.A,k=e.B,j=e.C,V=e.y,L=e.e,P=e.F,C=e.a_,E=e.z,O=e.P,S=e.ai,H=e.aj,U=e.a9,I=e.D,N=e.a$,G=e.a7},function(e){F=e._},function(e){q=e._},function(e){T=e.getComposerVersion,A=e.deleteComposerFile,B=e.execComposer,D=e.getComposerLine},function(e){M=e.u},function(e){R=e.f},null,null,null,null],execute:function(){var r={class:"p-1rem"},Y={class:"flex items-center"},z={key:0,class:"text-danger"},K={key:1,class:"text-danger text-[1.2rem]"},$={class:"mt-[8px] leading-8 text-[1.2rem] list-disc ml-[20px]"},J={key:0},Q={class:"p-2rem h-50rem flex flex-col"},W={class:"mb-1rem"},X={class:"flex-1 overflow-auto"};e("default",f({__name:"index",setup:function(e){var f,Z=M().siteInfo,ee=null===(f=Z.value)||void 0===f?void 0:f.project_type,te=s(),re=m(!1),ne=m(!1),oe=h({path:Z.value.path,user:"phpasync"!==ee?"www":"root",php:["静态","其它"].includes(Z.value.php_version)?"auto":"PHP-"+Z.value.php_version.replace(".",""),otherCommand:"",mirror:"https://mirrors.aliyun.com/composer/",command:"install",composerVersion:"install",version:"2.7.3",help_tips:"",comp_json:"",comp_lock:"",phpVersion:[],commandOptions:[{label:"install",value:"install"},{label:"update",value:"update"},{label:"require",value:"require"},{label:"create-project",value:"create-project"},{label:"自定义",value:""}]}),ae=m("正在执行..."),le=m(!1),ue=m(),ie=m(!1);d((function(){return Z.value}),(function(e){oe.php=["静态","其它"].includes(e.php_version)?"auto":"PHP-"+e.php_version.replace(".","")}),{immediate:!0});var ce=function(){var e=n(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return re.value=!0,e.prev=1,e.next=4,T({path:r||Z.value.path});case 4:(n=e.sent).data.status?(ne.value=!1,oe.phpVersion=n.data.php_versions.filter((function(e){return"00"!==e.version})),oe.phpVersion.unshift({name:"自动选择",version:"auto"}),oe.comp_json=!1,oe.comp_lock=!1,"string"==typeof n.data.comp_json&&(oe.comp_json=n.data.comp_json),"string"==typeof n.data.comp_lock&&(oe.comp_lock=n.data.comp_lock)):(ne.value=!0,te.request(n)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),o(e.t0);case 11:return e.prev=11,re.value=!1,e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[1,8,11,14]])})));return function(t){return e.apply(this,arguments)}}(),se=function(){R({type:"dir",path:oe.path,change:function(e){oe.path=e,ce(oe.path)}})},pe=function(){var e=n(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a({loading:"正在删除,请稍后...",request:A({path:oe.path+"/composer.lock"}),message:!0,success:function(e){e.status&&ce(oe.path)}});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),fe=function(){var e=n(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ue.value=setInterval(n(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{he()}catch(t){clearInterval(ue.value)}case 1:case"end":return e.stop()}}),e)}))),2e3);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),me=function(){var e=n(t().mark((function e(){var r,n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={php_version:null===(r=oe.php)||void 0===r?void 0:r.replace("PHP-",""),composer_args:oe.command,composer_cmd:oe.otherCommand,repo:oe.mirror,path:oe.path,user:oe.user,composer_version:oe.version,siteName:Z.value.name},e.next=3,l({title:"执行composer命令",content:"即将执行设定的composer命令,继续吗?",icon:"warning-filled"});case 3:a({loading:"正在执行,请稍后...",request:B(n),message:!0,success:function(e){e.status&&(le.value=!0,fe())}});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),he=function(){var e=n(t().mark((function e(){var r,n,a=arguments;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]&&a[0],e.prev=1,e.next=4,D({filename:"/tmp/composer_".concat(Z.value.name,".log"),num:100});case 4:n=e.sent,ae.value=n.data.msg,r&&te.success("刷新成功"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),o(e.t0);case 12:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(){return e.apply(this,arguments)}}(),de=function(){ie.value=!0,he()},ve=function(){clearInterval(ue.value),le.value=!1,ie.value=!1,ae.value=""};return v((function(){ce()})),y((function(){clearInterval(ue.value)})),function(e,t){var n=q,o=S,a=H,l=U,s=u,f=F,m=i,h=I,d=N,v=G,y=p,T=c;return g(),_("div",null,[w(ne)?(g(),b(n,{key:0},{content:x((function(){return t[11]||(t[11]=[k(" 没有找到可用的composer版本 ")])})),_:1})):j("",!0),V("div",r,[L(v,{model:w(oe)},{default:x((function(){return[L(l,{label:"Composer版本"},{default:x((function(){return[V("div",Y,[L(a,{modelValue:w(oe).version,"onUpdate:modelValue":t[0]||(t[0]=function(e){return w(oe).version=e}),class:"!w-[24rem]"},{default:x((function(){return[L(o,{label:"2.7.3",value:"2.7.3"}),L(o,{label:"1.10.27",value:"1.10.27"})]})),_:1},8,["modelValue"])])]})),_:1}),L(l,{label:"PHP版本"},{default:x((function(){return["phpasync"!==w(ee)?(g(),b(a,{key:0,class:"!w-[24rem]",modelValue:w(oe).php,"onUpdate:modelValue":t[1]||(t[1]=function(e){return w(oe).php=e})},{default:x((function(){return[(g(!0),_(P,null,C(w(oe).phpVersion,(function(e,t){return g(),b(o,{key:t,label:e.name,value:e.version},null,8,["label","value"])})),128))]})),_:1},8,["modelValue"])):(g(),b(s,{key:1,modelValue:w(oe).php,"onUpdate:modelValue":t[2]||(t[2]=function(e){return w(oe).php=e}),disabled:"",width:"24rem"},null,8,["modelValue"]))]})),_:1}),L(l,{label:"执行参数"},{default:x((function(){return[L(a,{class:"!w-[24rem]","empty-values":[null,void 0],modelValue:w(oe).command,"onUpdate:modelValue":t[3]||(t[3]=function(e){return w(oe).command=e})},{default:x((function(){return[(g(!0),_(P,null,C(w(oe).commandOptions,(function(e,t){return g(),b(o,{key:t,label:e.label,value:e.value},null,8,["label","value"])})),128))]})),_:1},8,["modelValue"])]})),_:1}),L(l,{label:"补充命令"},{default:x((function(){return[L(s,{modelValue:w(oe).otherCommand,"onUpdate:modelValue":t[4]||(t[4]=function(e){return w(oe).otherCommand=e}),placeholder:"请输入补充命令",width:"24rem"},null,8,["modelValue"])]})),_:1}),L(l,{label:"镜像源"},{default:x((function(){return[L(a,{modelValue:w(oe).mirror,"onUpdate:modelValue":t[5]||(t[5]=function(e){return w(oe).mirror=e}),filterable:"","allow-create":"","default-first-option":"",class:"!w-[24rem]"},{default:x((function(){return[L(o,{label:"阿里云(mirrors.aliyun.com)",value:"https://mirrors.aliyun.com/composer/"}),L(o,{label:"官方源(packagist.org)",value:"repos.packagist"}),L(o,{label:"中国全量镜像(packagist.phpcomposer.com)",value:"https://packagist.phpcomposer.com"}),L(o,{label:"Packagist Mirror(packagist.mirrors.sjtug.sjtu.edu.cn)",value:"https://packagist.mirrors.sjtug.sjtu.edu.cn"}),L(o,{label:"腾讯源(mirrors.tencent.com)",value:"https://mirrors.tencent.com/composer/"}),L(o,{label:"华为云(mirrors.huaweicloud.com)",value:"https://mirrors.huaweicloud.com/repository/php/"})]})),_:1},8,["modelValue"])]})),_:1}),"phpasync"!==w(ee)?(g(),b(l,{key:0,label:"执行用户",prop:"command"},{default:x((function(){return[L(a,{modelValue:w(oe).user,"onUpdate:modelValue":t[6]||(t[6]=function(e){return w(oe).user=e}),class:"!w-24rem"},{default:x((function(){return[L(o,{label:"www(推荐)",value:"www"}),L(o,{label:"root(不推荐)",value:"root"})]})),_:1},8,["modelValue"])]})),_:1})):j("",!0),L(l,{label:"执行目录",prop:"composerVersion"},{default:x((function(){return[L(f,{modelValue:w(oe).path,"onUpdate:modelValue":t[7]||(t[7]=function(e){return w(oe).path=e}),icon:"el-folder-opened",onIconClick:se,width:"32rem"},null,8,["modelValue"])]})),_:1}),L(l,{label:" ",prop:"composerVersion"},{default:x((function(){return[V("div",null,[w(oe).comp_lock?(g(),_("span",z,[k(E(w(oe).comp_lock)+" ",1),L(m,{onClick:pe},{default:x((function(){return t[12]||(t[12]=[k("[点击删除]")])})),_:1})])):j("",!0),w(oe).comp_json?(g(),_("span",K,E(w(oe).comp_json),1)):j("",!0)])]})),_:1}),L(l,{label:" "},{default:x((function(){return[L(h,{type:"primary",disabled:!!("boolean"!=typeof w(oe).comp_json&&w(oe).comp_json||"boolean"!=typeof w(oe).comp_lock&&w(oe).comp_lock),onClick:me},{default:x((function(){return t[13]||(t[13]=[k("执行")])})),_:1},8,["disabled"]),L(d,{direction:"vertical",class:"!h-1rem !mx-2rem"}),L(h,{onClick:de},{default:x((function(){return t[14]||(t[14]=[k("查看日志")])})),_:1})]})),_:1})]})),_:1},8,["model"]),V("ul",$,[t[15]||(t[15]=V("li",null,"Composer是PHP主流依赖包管理器,若您的项目使用Composer管理依赖包,可在此处对依赖进行升级或安装",-1)),t[16]||(t[16]=V("li",null,"Composer版本:当前安装的Composer版本,可点击右侧的【升级Composer】将Composer升级到最新稳定版",-1)),t[17]||(t[17]=V("li",null,"PHP版本:用于执行composer的PHP版本,无特殊要求,默认即可,如安装出错,可尝试选择其它PHP版本",-1)),t[18]||(t[18]=V("li",null,"执行参数:按需选择执行参数,可配合补充命令使用",-1)),t[19]||(t[19]=V("li",null,"补充命令:若此处为空,则按composer.json中的配置执行,此处支持填写完整composer命令",-1)),t[20]||(t[20]=V("li",null,"镜像源:提供【阿里源】和【官方源】,建议国内服务器使用【阿里源】,海外服务器使用【官方源】",-1)),"phpasync"!==w(ee)?(g(),_("li",J,"执行用户:默认为www用户,除非您的网站以root权限运行,否则不建议使用root用户执行composer")):j("",!0),t[21]||(t[21]=V("li",null,"执行目录:默认为当前网站根目录",-1))])]),L(T,{title:"请执行完毕确认结果无误后关闭此窗口",onCancel:ve,modelValue:w(le),"onUpdate:modelValue":t[8]||(t[8]=function(e){return O(le)?le.value=e:null}),area:[50,42]},{default:x((function(){return[L(y,{class:"h-full",title:"全屏查看composer执行日志",content:w(ae),isHtml:!0,isRefreshBtn:!1,isAuto:!0},null,8,["content"])]})),_:1},8,["modelValue"]),L(T,{title:"composer执行日志",onCancel:ve,modelValue:w(ie),"onUpdate:modelValue":t[10]||(t[10]=function(e){return O(ie)?ie.value=e:null}),area:60},{default:x((function(){return[V("div",Q,[V("div",W,[L(h,{type:"primary",onClick:t[9]||(t[9]=function(e){return he(!0)})},{default:x((function(){return t[22]||(t[22]=[k("刷新日志")])})),_:1})]),V("div",X,[L(y,{class:"h-full",title:"全屏查看composer执行日志",content:w(ae),isHtml:!0,isRefreshBtn:!1},null,8,["content"])])])]})),_:1},8,["modelValue"])])}}}))}}}))}();
Save File
Cancel