← Back
Editing: index-legacy468.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)}function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,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 r};var e,r={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new A(n||[]);return a(i,"_invoke",{value:S(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var v="suspendedStart",y="suspendedYield",m="executing",d="completed",g={};function b(){}function w(){}function x(){}var j={};f(j,u,(function(){return this}));var _=Object.getPrototypeOf,O=_&&_(_(I([])));O&&O!==n&&i.call(O,u)&&(j=O);var k=x.prototype=b.prototype=Object.create(j);function E(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function L(e,r){function n(o,a,c,u){var l=h(e[o],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function S(t,r,n){var o=v;return function(i,a){if(o===m)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=h(t,r,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function q(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(q,this),this.reset(!0)}function I(r){if(r||""===r){var n=r[u];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(i.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return w.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(k),t},r.awrap=function(t){return{__await:t}},E(L.prototype),f(L.prototype,l,(function(){return this})),r.AsyncIterator=L,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new L(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),f(k,s,"Generator"),f(k,u,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=I,A.prototype={constructor:A,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(C),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},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 r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))}}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}System.register(["./index-legacy94.js?v=1765440387","./base-lib-legacy.js?v=1765440387","./index-legacy92.js?v=1765440387","./utils-lib-legacy.js?v=1765440387","./useStore-legacy3.js?v=1765440387","./column-legacy.js?v=1765440387","./site-legacy.js?v=1765440387","./validator-legacy.js?v=1765440387"],(function(t,e){"use strict";var n,i,u,l,s,f,p,h,v,y,m,d,g,b,w,x,j,_,O,k,E,L,S,P,q,C,A,I,T,D,N;return{setters:[function(t){n=t._},function(t){i=t.r,u=t.k,l=t.c,s=t.q,f=t.v,p=t.y,h=t.C,v=t.B,y=t.z,m=t.x,d=t.e,g=t.A,b=t.D},function(t){w=t._},function(t){x=t.o,j=t.L,_=t.b,O=t.q,k=t.K,E=t.ff,L=t.a7,S=t.j2,P=t.A,q=t._},function(t){C=t.u},function(t){A=t.u},function(t){I=t.fQ,T=t.fR,D=t.fS},function(t){N=t.f}],execute:function(){var G=_(),V=C().siteInfo,F=i(),M=i(!1),B=t("p",i([])),U=u({pyVersion:"",path:"",search:""}),z=i(!1),Y=function(){z.value=!0,M.value=!0},H=function(){var t=a(o().mark((function t(e){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,I({project_name:V.value.name,force:z.value?1:0,search:e.search});case 3:if(r=t.sent,z.value=!1,!1!==r.data.status){t.next=8;break}return G.error(r.data.msg),t.abrupt("return",{data:[],total:0});case 8:return U.pyVersion=r.data.python_version,U.path=r.data.requirement_path,B.value=(o=r.data.pip_source,Object.entries(o).map((function(t){var e=c(t,2),r=e[0];return{label:r,key:e[1],value:r}}))),n=r.data.pip_list,""!==e.search&&(n=n.filter((function(t){return t.name.includes(e.search)}))),t.abrupt("return",{data:n,total:n.length});case 16:return t.prev=16,t.t0=t.catch(0),t.abrupt("return",{data:[],total:0});case 20:case"end":return t.stop()}var o}),t,null,[[0,16]])})));return function(e){return t.apply(this,arguments)}}(),K=function(t){F.value=t||null,x({area:75,isAsync:!0,title:"安装第三方库",btn:"安装",component:function(){return j((function(){return e.import("./install-package-legacy.js?v=1765440387")}),void 0,e.meta.url)},compData:{row:t,path:U.path,project_name:V.value.name,pipSource:B.value,refreshEvent:function(){}}})},Q=function(){var t=a(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,O({title:"卸载第三方库",icon:"warning-filled",content:"是否卸载第三方库【".concat(e.name,"】?")});case 2:return t.next=4,k({loading:"正在卸载,请稍后...",request:T({project_name:V.value.name,package_name:e.name,active:"uninstall"}),message:!0});case 4:t.sent.status&&(M.value=!0);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),R=function(){var t=a(o().mark((function t(e){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,k({loading:"正在修改,请稍后...",request:D({project_name:V.value.name,requirement_path:e}),message:!0});case 2:t.sent.status&&(M.value=!0);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),$=function(){N({type:"file",path:U.path,change:function(t){R(t)}})},J=t("b",i()),W=t("i",u({type:"common",name:"",version:"",file:"",pip:""})),X=(t("r",u({name:[{validator:function(t,e,r){"common"===W.type?e?r():r(new Error("请输入名称")):r()}}],file:[{validator:function(t,e,r){"file"===W.type?e?r():r(new Error("请选择记录文件")):r()}}]})),t("a",(function(){N({type:"file",path:W.file,change:function(t){W.file=t}})})),t("g",a(o().mark((function t(){var e,r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:W.name=(null===(e=F.value)||void 0===e?void 0:e.name)||"",W.file=U.path||"",W.pip=(null===(r=B.value[0])||void 0===r?void 0:r.label)||"";case 3:case"end":return t.stop()}}),t)})))),t("o",function(){var t=a(o().mark((function t(n){var i,a,c;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,J.value.validate();case 3:return i="file"===W.type,a=r(r({},a={project_name:V.value.name,pip_source:W.pip}),{},i?{requirement_path:W.file}:{package_name:W.name,package_version:W.version,active:"install"}),x({title:"正在安装,请耐心等候...",area:52,component:function(){return j((function(){return e.import("./log-legacy2.js?v=1765440387")}),void 0,e.meta.url)},compData:{type:"createPythonProject",logPath:"/www/server/python_project//vhost/logs/pip_".concat(a.project_name,".log"),endMsg:"安装结束",failMsg:"环境准备失败",successMsg:"安装结束",isClear:!0,completeEvent:function(t,e){M.value=!0,e()}}}),n(),t.next=10,T(a);case 10:c=t.sent,G.request(c),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(0);case 17:return t.prev=17,t.finish(17);case 19:case"end":return t.stop()}}),t,null,[[0,14,17,19]])})));return function(e){return t.apply(this,arguments)}}()),{class:"grid grid-cols-1 gap-y-[1rem]"}),Z={class:"flex flex-col leading-[2rem]"},tt={class:"flex items-center"},et={class:"flex items-center"},rt={class:"h-[45rem] mt-[2rem]"},nt=l({__name:"index",setup:function(t){var e=C().siteInfo,r=E({request:H,columns:[{label:"名称",prop:"name"},{label:"版本",prop:"version"},{label:"依赖记录文件中的版本",prop:"requirement"},A([{onClick:K,title:"安装",render:function(t){var e="--"===t.version;return(e=e&&!t.requirement.includes("git")&&!t.requirement.includes("file"))?d("span",{class:"text-primary cursor-pointer hover:text-[#1d9534]",onClick:function(){return K(t)}},[v("安装")]):""}},{onClick:Q,isHide:function(t){return"--"===t.version},title:"卸载"}])],extension:[L(M),S()]}),o=r.BtTable,i=r.BtSearch;return function(t,r){var a=w,c=b,u=n;return s(),f("div",null,[p("div",X,[h(' <div class="mr-[1rem]"></div>\n\t\t\t<bt-select\n\t\t\t\tv-model="envData.pyVersion"\n\t\t\t\t:options="versionOptions"\n\t\t\t\tclass="w-[14rem]"\n\t\t\t\t:change="eventSelect"></bt-select> '),h(' <el-descriptions>\n\t\t\t\t<el-descriptions-item label="Python版本">{{ envData.pyVersion }}</el-descriptions-item>\n\t\t\t</el-descriptions> '),p("div",null,[r[3]||(r[3]=v(" Python版本 ")),p("span",null,y(m(U).pyVersion),1)]),p("div",Z,[r[5]||(r[5]=p("span",null,"命令行使用项目中的环境:",-1)),r[6]||(r[6]=p("span",null,[v("命令行可使用 "),p("code",null,"source py-project-env [项目名称]"),v(" 进入该项目虚拟环境,退出时使用"),p("code",null,"deactivate")],-1)),p("span",tt,[r[4]||(r[4]=v(" 示例:")),p("code",null,"source py-project-env "+y(m(e).name),1),p("i",{class:"svgtofont-el-document-copy cursor-pointer text-[#333] text-[1.5rem] copy ml-[4px]",title:"复制启动命令",onClick:r[0]||(r[0]=function(){return m(P)({value:"source py-project-env ".concat(m(e).name)})})})]),r[7]||(r[7]=p("span",null,"若提示没有py-project-env文件,可尝试关闭系统加固并重启面板,然后进入Python项目页面此,时会自动设置该文件",-1))]),p("div",et,[r[8]||(r[8]=p("span",{class:"mr-[1rem] whitespace-nowrap"},"依赖记录文件",-1)),d(a,{modelValue:m(U).path,"onUpdate:modelValue":r[1]||(r[1]=function(t){return m(U).path=t}),icon:"el-folder-opened",onIconClick:m($),width:"40rem"},null,8,["modelValue","onIconClick"])])]),h(' <div class="mt-[2rem] h-[15rem] border"></div> '),p("div",rt,[d(u,null,{"header-left":g((function(){return[d(c,{type:"primary",onClick:r[2]||(r[2]=function(t){return m(K)()})},{default:g((function(){return r[9]||(r[9]=[v("安装")])})),_:1})]})),"header-right":g((function(){return[d(m(i),{width:"20rem",placeholder:"搜索第三方库"}),d(c,{type:"default",class:"!ml-[1rem]",onClick:m(Y)},{default:g((function(){return r[10]||(r[10]=[v("强制刷新")])})),_:1},8,["onClick"])]})),content:g((function(){return[d(m(o),{"max-height":480})]})),_:1})]),h(' <bt-help :options="helpList" list-style="none" class="ml-[20px] mt-[20px]"></bt-help> ')])}}}),ot=q(nt,[["__scopeId","data-v-f48d81ca"],["__file","/Users/chudong/project/linux-10/src/views/site/views/python-model/env-manage/index.vue"]]),it=Object.freeze(Object.defineProperty({__proto__:null,default:ot},Symbol.toStringTag,{value:"Module"}));t("c",it)}}}))}();
Save File
Cancel