← Back
Editing: index-legacy72.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}var e=["type_id"];function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function r(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(e,n,r){return(n=function(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,n||"default");if("object"!=t(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function o(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return n};var e,n={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function p(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(e){p=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var a=e&&e.prototype instanceof b?e:b,o=Object.create(a.prototype),u=new q(r||[]);return i(o,"_invoke",{value:L(t,n,u)}),o}function v(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=f;var h="suspendedStart",y="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function x(){}var _={};p(_,c,(function(){return this}));var j=Object.getPrototypeOf,k=j&&j(j(N([])));k&&k!==r&&a.call(k,c)&&(_=k);var P=x.prototype=b.prototype=Object.create(_);function O(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function S(e,n){function r(o,i,u,c){var s=v(e[o],e,i);if("throw"!==s.type){var l=s.arg,p=l.value;return p&&"object"==t(p)&&a.call(p,"__await")?n.resolve(p.__await).then((function(t){r("next",t,u,c)}),(function(t){r("throw",t,u,c)})):n.resolve(p).then((function(t){l.value=t,u(l)}),(function(t){return r("throw",t,u,c)}))}c(s.arg)}var o;i(this,"_invoke",{value:function(t,e){function a(){return new n((function(n,a){r(t,e,n,a)}))}return o=o?o.then(a,a):a()}})}function L(t,n,r){var a=h;return function(o,i){if(a===d)throw Error("Generator is already running");if(a===m){if("throw"===o)throw i;return{value:e,done:!0}}for(r.method=o,r.arg=i;;){var u=r.delegate;if(u){var c=E(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===h)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=d;var s=v(t,n,r);if("normal"===s.type){if(a=r.done?m:y,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(a=m,r.method="throw",r.arg=s.arg)}}}function E(t,n){var r=n.method,a=t.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=v(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function q(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function N(n){if(n||""===n){var r=n[c];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var o=-1,i=function t(){for(;++o<n.length;)if(a.call(n,o))return t.value=n[o],t.done=!1,t;return t.value=e,t.done=!0,t};return i.next=i}}throw new TypeError(t(n)+" is not iterable")}return w.prototype=x,i(P,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:w,configurable:!0}),w.displayName=p(x,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,p(t,l,"GeneratorFunction")),t.prototype=Object.create(P),t},n.awrap=function(t){return{__await:t}},O(S.prototype),p(S.prototype,s,(function(){return this})),n.AsyncIterator=S,n.async=function(t,e,r,a,o){void 0===o&&(o=Promise);var i=new S(f(t,e,r,a),o);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(P),p(P,l,"Generator"),p(P,c,(function(){return this})),p(P,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},n.values=N,q.prototype={constructor:q,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,a){return u.type="throw",u.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;T(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},n}function i(t,e,n,r,a,o,i){try{var u=t[o](i),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,a)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function u(t){i(o,r,a,u,c,"next",t)}function c(t){i(o,r,a,u,c,"throw",t)}u(void 0)}))}}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./index-legacy103.js?v=VERSION_NUMBER","./index-legacy141.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./validator-legacy.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","./useController-legacy6.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER"],(function(t,n){"use strict";var a,i,c,s,l,p,f,v,h,y,d,m,g,b,w,x,_,j,k,P,O,S,L,E,C,T,q,N,I,M,B,D,G,F,A,J,R,z,U,V,Y,H,K,W,$,Q,X,Z,tt,et,nt,rt,at,ot,it,ut,ct,st,lt,pt,ft,vt,ht;return{setters:[function(t){a=t.at,i=t.n,c=t.L,s=t.K,l=t.b,p=t.u,f=t.aM,v=t.a6,h=t.q,y=t.w,d=t.a8,m=t.c},function(t){g=t._},function(t){b=t.u},function(t){w=t.j,x=t.as,_=t.r,j=t.g,k=t.c,P=t.s,O=t.e,S=t.B,L=t.w,E=t.p,C=t.n,T=t.q,q=t.v,N=t.A,I=t.x,M=t.y,B=t.J},function(t){D=t.f,G=t.i,F=t.o,A=t.h},null,function(t){J=t.c,R=t.a,z=t.d,U=t.g,V=t.u},function(t){Y=t.b,H=t.g,K=t.c,W=t.d,$=t.f,Q=t.h,X=t.s,Z=t.i,tt=t.u,et=t.a,nt=t.j},function(t){rt=t.u,at=t.S},function(t){ot=t.getPyVersion,it=t.getPythonEnvironment,ut=t.changeProjectConf,ct=t.createPythonProject,st=t.getPythonAppInfo,lt=t.getPythonProjectInfo,pt=t.pythonRecreateProject,ft=t.advanceCheckPort,vt=t.batchStatus,ht=t.batchDelSite}],execute:function(){var yt=w("SITE-PYTHON-STORE",(function(){var t=function(){var t=u(o().mark((function t(){var e;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,ot();case 3:return e=t.sent,t.abrupt("return",{data:e.data,status:e.status});case 7:t.prev=7,t.t0=t.catch(0),a(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return{checkPythonVersion:t}})),dt=l(),mt=rt(),gt=mt.activeType,bt=mt.isRefreshList,wt=mt.siteInfo,xt=(mt.rowData,at()),_t=(xt.getClassList,xt.getProjectConfig),jt=(xt.addGeneralProject,xt.getRootUser),kt=xt.setSiteInfo,Pt=yt().checkPythonVersion,Ot=x("_python_mask",!1),St=function(){wt.value=null,i({title:"添加Python项目",area:[68],component:function(){return c((function(){return n.import("./index-legacy367.js?v=VERSION_NUMBER")}),void 0,n.meta.url)},showFooter:!0})},Lt=t("o",(function(t){i({isAsync:!0,title:"Python环境管理",area:105,component:function(){return c((function(){return n.import("./index-legacy368.js?v=VERSION_NUMBER")}),void 0,n.meta.url)},onCancel:function(){"function"==typeof t&&t()}})})),Et=function(t){i({title:"终端",area:[90,50],isAsync:!0,showFooter:!1,component:function(){return c((function(){return n.import("./index-legacy369.js?v=VERSION_NUMBER")}),void 0,n.meta.url)},compData:{hostInfo:{pj_name:t.name},row:t,cmd:t.shell_active}})},Ct=function(){var t=u(o().mark((function t(e){var r,a=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=a.length>1&&void 0!==a[1]?a[1]:"",t.prev=1,!["running","failure"].includes(e.project_config.prep_status)){t.next=7;break}if("failure"!==e.project_config.prep_status){t.next=6;break}return t.next=6,pt({name:e.name});case 6:return t.abrupt("return",i({isAsync:!0,title:"正在创建Python项目,请耐心等候...",area:52,component:function(){return c((function(){return n.import("./index-legacy370.js?v=VERSION_NUMBER")}),void 0,n.meta.url)},compData:{type:"createPythonProject",logPath:"/www/server/python_project/vhost/logs/".concat(e.name,".log"),endMsg:"尝试启动项目",failMsg:"环境准备失败",successMsg:"创建成功",isClear:!0,completeEvent:function(){var t=u(o().mark((function t(e,n){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e||dt.error("环境准备失败"),bt.value=!0,n();case 3:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()}}));case 7:kt(e,r),i({title:"Python项目管理["+e.name+"] -- 添加时间["+e.addtime+"]",area:[84,76],component:function(){return c((function(){return n.import("./index-legacy371.js?v=VERSION_NUMBER")}),void 0,n.meta.url)}}),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1);case 14:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return t.apply(this,arguments)}}(),Tt=function(){var t=u(o().mark((function t(){var e;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Pt();case 3:e=t.sent,Ot.value=!1,e.data.cpy_installed.length||e.data.pypy_installed.length||(Ot.value=!0),Mt.value=e.data.cpy_installed.concat(e.data.pypy_installed),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),a(t.t0);case 12:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(){return t.apply(this,arguments)}}(),qt=function(){var t=u(o().mark((function t(e){var n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.port){t.next=2;break}return t.abrupt("return",!1);case 2:return t.prev=2,t.next=5,ft({port:e.port},"python");case 5:return(n=t.sent).status||(dt.request(n),e.port=""),t.abrupt("return",n.status);case 10:t.prev=10,t.t0=t.catch(2);case 13:case"end":return t.stop()}}),t,null,[[2,10]])})));return function(e){return t.apply(this,arguments)}}(),Nt=function(t){var e=t.split("\n").filter((function(t){return""!==t})),n=[];return e.forEach((function(t){var e=t.split("=");n.push({k:e[0],v:e[1]})})),n},It=t("g",u(o().mark((function t(){var e;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,s({request:it({sort_not_use:1})});case 3:(e=t.sent).status||(dt.error(e.msg),Bt.value=[]),Bt.value=e.data.env_list,t.next=12;break;case 8:return t.prev=8,t.t0=t.catch(0),t.abrupt("return",{data:[],total:0});case 12:case"end":return t.stop()}}),t,null,[[0,8]])})))),Mt=(t("k",(function(t){switch(t){case"venv":return"虚拟环境";case"conda":return"Conda环境";case"system":return"系统级环境"}})),_([])),Bt=t("e",_([])),Dt=t("u",_([])),Gt=t("a",j((function(){var t;return null===(t=wt.value)||void 0===t?void 0:t.id})));_([]);var Ft=t("p",_({envType:0,rfile:"",pjname:"",port:"",path:"",framework:"",stype:"command",xsgi:"wsgi",requirement_path:"",auto_run:!1,venv_path:"",version:"",parm:"",env:"",envPath:"",app:"",processes:"",threads:"",user:"www",is_http:!0,listenMsg:"",initialize:"",python_bin:""})),At=(t("i",u(o().mark((function t(){var e,n,a,i,u,c,s,l,p,f,v;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,It();case 3:return t.next=5,jt();case 5:if(e=t.sent,Dt.value=e.data,!Gt.value){t.next=17;break}return t.next=10,_t({data:JSON.stringify({name:wt.value.name})});case 10:n=t.sent,a=n.data,i=a.project_config,u=a.listen,c=a.pyenv_data,s=i.call_app,l=i.env_file,p=i.env_list,f=i.stype,v=i.project_cmd,l&&(Ft.value.envPath=l,Ft.value.envType=2),(null==p?void 0:p.length)>0&&(o=p,Ft.value.env=o.map((function(t){return t.k+"="+t.v})).join("\n"),Ft.value.envType=1,Ft.value.envType=1),Object.assign(Ft.value,r(r({},i),{},{app:s,parm:"command"===f?v:"",python_bin:c.bin_path})),!u.includes(Number(Ft.value.port))&&u.length>0&&(Ft.value.listenMsg="当前监听端口".concat(u.join(",")));case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(0);case 22:case"end":return t.stop()}var o}),t,null,[[0,19]])})))),t("$",(function(){Object.assign(Ft.value,{envType:0,rfile:"",pjname:"",port:"",path:"",framework:"",stype:"command",xsgi:"wsgi",requirement_path:"",auto_run:!1,venv_path:"",version:"",parm:"",env:"",envPath:"",app:"",processes:"",threads:"",user:"www",is_http:!0,listenMsg:"",initialize:"",python_bin:""})})),t("s",function(){var t=u(o().mark((function t(e){var n,a,i,u,c,l,p,f,v,h,y,d,m,g,b,w,x,_,j,k,P,O,S,L;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,Gt.value||"command"===e.stype){t.next=8;break}return t.next=4,qt(e);case 4:if(t.sent){t.next=8;break}return dt.error("端口被占用,请更换端口"),t.abrupt("return",!1);case 8:return n=e.pjname,a=e.port,i=e.path,e.version,u=e.parm,c=e.framework,l=e.requirement_path,p=e.envPath,f=e.stype,v=e.rfile,h=e.app,y=e.initialize,d=e.processes,m=e.threads,g=e.is_http,b=e.user,w=e.auto_run,x=e.envType,_=e.env,j=e.xsgi,k="command"!==f,1===x&&(_=Nt(_)),P={pjname:n,port:a,stype:f,path:i,user:b,requirement_path:l,env_file:2===x?p:"",env_list:JSON.stringify(1===x?_:[]),framework:c,project_cmd:k?void 0:u,xsgi:k?j:void 0,rfile:k?v:void 0,call_app:k?h:void 0,python_bin:Ft.value.python_bin},Gt.value?P=r(r({},P),{},{processes:d,threads:m,is_http:g,auto_run:w}):P.initialize=y,O={data:JSON.stringify(Gt.value?{name:wt.value.name,data:P}:P)},S=Gt.value?ut:ct,t.next=17,s({loading:"正在提交,请稍后...",request:S(O),message:!0});case 17:return L=t.sent,bt.value=!0,t.abrupt("return",L.status);case 22:t.prev=22,t.t0=t.catch(0);case 25:case"end":return t.stop()}}),t,null,[[0,22]])})));return function(e){return t.apply(this,arguments)}}()),t("b",(function(){D({type:"dir",path:Ft.value.path,change:function(t){if(t){var e;Ft.value.path=t;var n=null===(e=t.substring(t.lastIndexOf("/")+1))||void 0===e?void 0:e.replace(/\./g,"_").replace(/\/\//g,"/");Ft.value.pjname=n,Jt()}}})})),t("j",(function(){D({type:"file",path:Ft.value.requirement_path,change:function(t){t&&(Ft.value.requirement_path=t)}})})),t("d",(function(){D({type:"file",path:Ft.value.rfile,change:function(t){Ft.value.rfile=t,At()}})})),t("h",(function(){D({type:"file",path:Ft.value.envPath,change:function(t){Ft.value.envPath=t}})})),t("f",u(o().mark((function t(){var e,n,r,i,u;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,st({runfile:Ft.value.rfile});case 3:if((e=t.sent).status){t.next=7;break}return dt.request(e),t.abrupt("return");case 7:n=e.data,r=n.framework,i=n.xsgi,u=n.call_app,r&&(Ft.value.framework=e.data.framework),i&&(Ft.value.xsgi=e.data.xsgi),u&&(Ft.value.app=e.data.call_app),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(0),a(t.t0);case 16:case"end":return t.stop()}}),t,null,[[0,13]])}))))),Jt=t("c",u(o().mark((function t(){var e,n,r,i,u,c,s,l;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e=Ft.value.path,t.next=4,lt({path:e});case 4:if((n=t.sent).status){t.next=8;break}return dt.request(n),t.abrupt("return");case 8:r=n.data,i=r.framework,u=r.requirement_path,c=r.runfile,s=r.xsgi,l=r.call_app,i&&(Ft.value.framework=n.data.framework),Ft.value.requirement_path=u?n.data.requirement_path:"",c&&(Ft.value.rfile=n.data.runfile),s&&(Ft.value.xsgi=n.data.xsgi),l&&(Ft.value.app=n.data.call_app),t.next=19;break;case 16:t.prev=16,t.t0=t.catch(0),a(t.t0);case 19:case"end":return t.stop()}}),t,null,[[0,16]])})))),Rt=function(){var t=u(o().mark((function t(e,n,a,i,c,s){var l,p,f,v,h,y;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l=i.label,p=i.value,f=s.enable,v=s.exclude,h=new Map([["start","批量启动选中项目后,项目将正常访问"],["stop","批量停用选中的项目后,项目将会停止运行"],["restart","批量重启选中的项目后,项目将会重新启动"],["delete","批量删除选中的项目后,项目将无法恢复"]]),y=function(){var t=u(o().mark((function t(e){var n,r,i,u,c;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=new Map([["start",vt],["stop",vt],["restart",vt],["delete",ht]]),r=n.get(p),t.t0=p,t.next="start"===t.t0||"stop"===t.t0||"restart"===t.t0?5:"delete"===t.t0?11:16;break;case 5:if(!r){t.next=11;break}return i=a.value.map((function(t){return{project_name:t.name}})),u=A(!1,v,f,{params:{site_list:JSON.stringify(i),status:p,project_type:gt.value.toUpperCase()}}),t.next=10,r(u,gt.value);case 10:case 15:return t.abrupt("return",t.sent);case 11:if(!r){t.next=16;break}return c=A(a.value,v,f,{params:{project_type:gt.value.toUpperCase()}}),t.next=15,r(c);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),t.next=6,e({title:"批量".concat(l),content:"".concat(h.get(p),",是否继续操作?"),column:[{label:"项目名称",prop:"name"},J()],onConfirm:function(){var t=u(o().mark((function t(){var e,n,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y();case 2:e=t.sent,bt.value=!0,c&&c(),n=G(e.data),a=(a=n.data).map((function(t){return r(r({},t),{},{name:t.name||t.project_name})})),F(a,{title:"".concat(l,"网站")});case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()});case 6:case"end":return t.stop()}}),t)})));return function(e,n,r,a,o,i){return t.apply(this,arguments)}}(),zt={class:"flex items-center ml-[12px]"},Ut=k({__name:"index",setup:function(t){p();var a=at(),i=a.getSiteList,s=a.setSiteInfo,l=P(at()),w=l.activeType,x=l.isRefreshList,_=l.siteInfo,j=l.searchWidth,k=f({options:[{type:"button",label:"添加项目",active:!0,onClick:St},{type:"button",label:"Python环境管理",onClick:Lt}]}).BtOperation,D=b({key:"type_id",name:"Python分类",options:function(){return[{label:"全部分类",value:"all"}]},event:Q,ignore:["0"],field:"type_name"}),G=d([{label:"启动项目",value:"start",event:Rt},{label:"停用项目",value:"stop",event:Rt},{label:"重启项目",value:"restart",event:Rt},tt(),et({classList:nt}),{label:"删除项目",value:"delete",event:Rt}]),F=v({request:function(t){var n=t.type_id,a=function(t,e){if(null==t)return{};var n,r,a=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}(t,e);return i({data:JSON.stringify(r(r({},a),{},{type_id:h(n)||"all"===n?"":n}))})},columns:[R({type:"page",key:"id"}),Y({onClick:Ct}),H({onClick:function(t,e){if("setting"!==e){var n=t.run?"stop":"start";X(t,"restart"===e?e:n)}else Ct(t,"state")}}),{label:"PID",isCustom:!1,render:function(t){var e,n;return h(t.pids)||0===(null===(e=t.pids)||void 0===e?void 0:e.length)?"--":(null===(n=t.pids)||void 0===n?void 0:n.join(","))||"--"}},{label:"监听端口",isCustom:!1,render:function(t){var e,n;return h(t.listen)||0===(null===(e=t.listen)||void 0===e?void 0:e.length)?"--":(null===(n=t.listen)||void 0===n?void 0:n.join(","))||"--"}},{label:"CPU",isCustom:!1,render:function(t){return h(t.cpu)?"--":t.cpu.toFixed(2)+"%"}},{label:"内存",isCustom:!1,render:function(t){return h(t.mem)?"--":y(t.mem)}},z(),K(),U({table:"sites",width:200}),W({onClick:function(t){return Ct(t,"ssl")}}),V([{title:"终端",onClick:Et},{title:"设置",onClick:function(t){return Ct(t)}},{title:"模块",onClick:function(t){return Ct(t,"envManager")}},{title:"删除",onClick:function(t){Z(t,w.value)}}])],extension:[D,G],empty:function(){return O("span",null,[S("您的列表为空,您可以"),O("span",{class:"bt-link",onClick:St},[S("添加一个项目")])])}}),A=F.BtTable,J=F.BtPage,rt=F.BtRefresh,ot=F.BtSearch,it=F.BtColumn,ut=F.BtBatch,ct=F.BtTableCategory,st=F.refresh,lt=F.config;return L(x,function(){var t=u(o().mark((function t(e){var n,r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=5;break}return t.next=3,st();case 3:null!==(n=_.value)&&void 0!==n&&n.name&&(r=lt.data.find((function(t){return t.name===_.value.name})))&&s(r),x.value=!1;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),E((function(){Tt(),C((function(){c((function(){return n.import("./index-legacy367.js?v=VERSION_NUMBER")}),void 0,n.meta.url),c((function(){return n.import("./index-legacy371.js?v=VERSION_NUMBER")}),void 0,n.meta.url)}))})),function(t,e){var n=m,r=g;return T(),q("div",null,[O(r,null,{"header-left":N((function(){return[O(I(k)),M("div",zt,[O(n,{href:"https://www.bt.cn/bbs/thread-144409-1-1.html"},{default:N((function(){return e[1]||(e[1]=[S(" Python项目教程 ")])})),_:1}),e[2]||(e[2]=M("i",{class:"svgtofont-el-link text-primary text-[1.6rem] ml-[4px]"},null,-1))]),M("div",{class:"flex items-center ml-1rem <xl:hidden",onClick:e[0]||(e[0]=function(){return I($)&&I($).apply(void 0,arguments)})},e[3]||(e[3]=[M("i",{class:"svgtofont-desired text-[1.6rem]"},null,-1),M("span",{class:"bt-link"},"需求反馈",-1)]))]})),"header-right":N((function(){return[O(I(ct),{class:"!w-[140px] mr-[10px]"}),O(I(ot),{class:B(["mr-[10px]","!w-[".concat(I(j),"px]")]),placeholder:"请输入项目名称或备注"},null,8,["class"]),O(I(rt),{class:"mr-[10px]"}),O(I(it))]})),content:N((function(){return[O(I(A))]})),"footer-left":N((function(){return[O(I(ut))]})),"footer-right":N((function(){return[O(I(J))]})),_:1})])}}}),Vt=Object.freeze(Object.defineProperty({__proto__:null,default:Ut},Symbol.toStringTag,{value:"Module"}));t("l",Vt)}}}))}();
Save File
Cancel