← Back
Editing: index367.js
import{c as e,r as l,g as a,p as t,a4 as s,q as o,M as d,A as n,e as r,y as m,x as i,H as p,I as u,v as c,z as _,C as f,J as b,B as h,a_ as y,F as V,_ as v,a9 as x,ai as g,aj as w,ah as k,af as j,ag as U,T as C,D as F}from"./base-lib.js?v=VERSION_NUMBER";import{_ as P}from"./index101.js?v=VERSION_NUMBER";import{G as z,bV as T,k as M,c as E,_ as H,H as I}from"./utils-lib.js?v=VERSION_NUMBER";import{p as q,s as A,i as B,$ as D,a as J,o as $,g as G,e as O,b as S,c as K,d as L,f as N,h as Q,u as R,j as W,k as X}from"./index72.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index103.js?v=VERSION_NUMBER";import"./index141.js?v=VERSION_NUMBER";import"./index124.js?v=VERSION_NUMBER";import"./validator.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";import"./column.js?v=VERSION_NUMBER";import"./index.vue_vue_type_style_index_0_scoped_b3c4124c_lang.js?v=VERSION_NUMBER";import"./useController6.js?v=VERSION_NUMBER";import"./site.js?v=VERSION_NUMBER";import"./useStore4.js?v=VERSION_NUMBER";const Y={class:"flex items-center"},Z={key:0,class:"absolute top-[26px] text-[1.2rem] text-[red]"},ee={class:"flex items-center"},le={class:"text-[1.2rem] text-[#999] flex items-center justify-center"},ae=["title"],te={key:0,class:"absolute top-[50%] right-[-1rem] translate-y-[-50%] flex items-center"},se={class:"text-[1.2rem] text-[#999] truncate max-w-[6rem]"},oe={class:"text-[1.2rem] text-[#999]"},de={class:"flex items-center"},ne={class:"truncate text-[1.6rem] max-w-[13rem]"},re={class:"text-[1.2rem] text-[#999] mt-[.5rem]"},me={class:"text-[12px] ml-8px"},ie={class:"mt-[1.6rem]"},pe={class:"mt-[1.6rem]"},ue={class:"flex"},ce={key:2,class:"my-[20px]"},_e={class:"flex items-center"},fe={class:"ml-[1rem] text-[#20a53a] w-[16rem] select-none"},be={class:"pt-[0]"},he=e({__name:"index",setup(e,{expose:he}){const ye=l(!1),{BtForm:Ve,submit:ve}=z({data:q.value,options:e=>a((()=>[{type:"slots",key:"custom",rules:{pjname:[T({message:"请输入项目名称"})],port:[{validator:(e,l,a)=>{"command"!==q.value.stype&&(!/^\d+$/.test(l)||l<0||l>65535)?q.value.listenMsg?a(new Error(" ")):a(new Error("端口号范围为0-65535")):a()},tirgger:["blur","change"]}],path:[T({message:"请选择路径"})],processes:[T({message:"请输入进程数"})],threads:[T({message:"请输入线程数"})],python_bin:[T({message:"请选择Python环境"})],parm:[{validator:(e,l,a)=>{"command"===q.value.stype&&""===l?a(new Error("请输入启动命令")):a()},tirgger:["blur","change"]}]}}])),submit:async(e,l)=>(await l(),await A(e.value))});return t((()=>{B()})),s(D),he({onConfirm:ve}),(e,l)=>{const a=M,t=x,s=g,z=w,T=E,A=k,B=j,D=H,he=I,xe=P,ge=U,we=C,ke=F;return o(),d(i(Ve),{"label-width":"100px",class:"p-2rem"},{custom:n((()=>[r(t,{label:"项目名称",prop:"pjname"},{default:n((()=>[m("div",Y,[r(a,{disabled:i(J),width:"22rem",modelValue:i(q).pjname,"onUpdate:modelValue":l[0]||(l[0]=e=>i(q).pjname=e),placeholder:"请输入Python项目名称"},null,8,["disabled","modelValue"]),p(r(t,{label:"项目端口",prop:"port","label-width":"7rem"},{default:n((()=>[r(a,{width:"18rem",type:"number",modelValue:i(q).port,"onUpdate:modelValue":l[1]||(l[1]=e=>i(q).port=e),placeholder:"项目的真实端口"},null,8,["modelValue"]),i(q).listenMsg&&"command"!==i(q).stype?(o(),c("div",Z,_(i(q).listenMsg),1)):f("",!0)])),_:1},512),[[u,"command"!==i(q).stype]])])])),_:1}),r(t,{label:"Python环境",prop:"python_bin"},{default:n((()=>[m("div",ee,[m("div",{class:b(["flex items-center",i(J)?"":"custom-refresh-select"])},[r(z,{modelValue:i(q).python_bin,"onUpdate:modelValue":l[3]||(l[3]=e=>i(q).python_bin=e),filterable:"",class:"!w-[24rem]","popper-class":"env-select",disabled:i(J)},{empty:n((()=>[m("div",le,[l[24]||(l[24]=h("暂无Python环境,")),m("span",{class:"bt-link",onClick:l[2]||(l[2]=e=>i($)(i(G)))},"点击添加")])])),default:n((()=>[(o(!0),c(V,null,y(i(O),(e=>(o(),d(s,{key:e.bin_path,value:e.bin_path,label:e.name},{default:n((()=>[m("div",{class:"relative pt-[1rem]",title:e.name},[e.project_name.length?(o(),c("div",te,[m("span",se,_(e.project_name[0]),1),m("span",oe,_("等".concat(e.project_name.length,"个项目正在使用")),1)])):f("",!0),m("div",de,[m("div",ne,_(e.name),1),m("span",{class:b(["text-[1.2rem] ml-[8px] px-[.5rem] rounded-[.5rem] border","tag-".concat(e.type)])},_(i(X)(e.type)),3)]),m("div",re,_(e.version),1)],8,ae)])),_:2},1032,["value","label"])))),128))])),_:1},8,["modelValue","disabled"])],2),m("span",me,[l[26]||(l[26]=h(" * 如需添加Python环境,请点击")),r(T,{onClick:l[4]||(l[4]=e=>i($)(i(G)))},{default:n((()=>l[25]||(l[25]=[h("环境管理")]))),_:1})])])])),_:1}),r(t,{label:"启动方式"},{default:n((()=>[r(B,{modelValue:i(q).stype,"onUpdate:modelValue":l[5]||(l[5]=e=>i(q).stype=e)},{default:n((()=>[r(A,{label:"command"},{default:n((()=>l[27]||(l[27]=[h("命令行启动")]))),_:1}),r(A,{label:"uwsgi"},{default:n((()=>l[28]||(l[28]=[h("uwsgi")]))),_:1}),r(A,{label:"gunicorn"},{default:n((()=>l[29]||(l[29]=[h("gunicorn")]))),_:1})])),_:1},8,["modelValue"])])),_:1}),r(t,{label:"项目路径",prop:"path"},{default:n((()=>[r(a,{width:"42rem","icon-type":!i(J)&&"folder",disabled:i(J),placeholder:"项目的根路径",onFolder:i(S),onChange:i(K),modelValue:i(q).path,"onUpdate:modelValue":l[6]||(l[6]=e=>i(q).path=e)},v({_:2},[i(J)?void 0:{name:"append",fn:n((()=>[r(he,{onClick:i(S)},{default:n((()=>[r(D,{icon:"el-folder-opened",class:"cursor-pointer"})])),_:1},8,["onClick"])])),key:"0"}]),1032,["icon-type","disabled","onFolder","onChange","modelValue"])])),_:1}),p(m("div",{class:"mt-[1rem] ml-[12rem]"},"当前框架:"+_(i(q).framework),513),[[u,i(q).framework]]),p(m("div",ie,[r(t,{label:"启动命令",prop:"parm"},{default:n((()=>[r(a,{modelValue:i(q).parm,"onUpdate:modelValue":l[7]||(l[7]=e=>i(q).parm=e),placeholder:"请输入启动命令",width:"42rem"},null,8,["modelValue"])])),_:1})],512),[[u,"command"===i(q).stype]]),p(m("div",pe,[r(t,{label:"入口文件"},{default:n((()=>[r(xe,{placeholder:"项目的入口文件",modelValue:i(q).rfile,"onUpdate:modelValue":l[8]||(l[8]=e=>i(q).rfile=e),icon:"el-folder-opened",onIconClick:l[9]||(l[9]=e=>i(L)(i(q))),onChange:l[10]||(l[10]=e=>i(N)(i(q))),width:"42rem"},null,8,["modelValue"])])),_:1}),r(t,{label:"通讯协议"},{default:n((()=>[m("div",ue,[r(z,{modelValue:i(q).xsgi,"onUpdate:modelValue":l[11]||(l[11]=e=>i(q).xsgi=e),class:"!w-[15rem]"},{default:n((()=>[r(s,{label:"wsgi",value:"wsgi"}),r(s,{label:"asgi",value:"asgi"})])),_:1},8,["modelValue"]),r(t,{label:"应用名称"},{default:n((()=>[r(a,{modelValue:i(q).app,"onUpdate:modelValue":l[12]||(l[12]=e=>i(q).app=e),placeholder:"请输入应用名称",width:"22rem"},null,8,["modelValue"])])),_:1})])])),_:1})],512),[[u,"command"!==i(q).stype]]),r(t,{label:"环境变量",class:"mt-[1.6rem]"},{default:n((()=>[r(B,{modelValue:i(q).envType,"onUpdate:modelValue":l[13]||(l[13]=e=>i(q).envType=e)},{default:n((()=>[r(ge,{label:0},{default:n((()=>l[30]||(l[30]=[h("无")]))),_:1}),r(ge,{label:1},{default:n((()=>l[31]||(l[31]=[h("指定变量")]))),_:1}),r(ge,{label:2},{default:n((()=>l[32]||(l[32]=[h("从文件加载")]))),_:1})])),_:1},8,["modelValue"])])),_:1}),p(r(t,{label:" "},{default:n((()=>[p(r(a,{width:"40rem",type:"textarea",rows:4,resize:"none",modelValue:i(q).env,"onUpdate:modelValue":l[14]||(l[14]=e=>i(q).env=e),placeholder:"环境变量,1行1个,例如: JAVA_HOME=/usr/local/btjdk/jdk8"},null,8,["modelValue"]),[[u,1===i(q).envType]]),p(r(xe,{modelValue:i(q).envPath,"onUpdate:modelValue":l[15]||(l[15]=e=>i(q).envPath=e),placeholder:"请选择环境变量文件",icon:"el-folder-opened",onIconClick:i(Q),width:"42rem"},null,8,["modelValue","onIconClick"]),[[u,2===i(q).envType]])])),_:1},512),[[u,0!==i(q).envType]]),r(t,{label:"启动用户"},{default:n((()=>[r(z,{modelValue:i(q).user,"onUpdate:modelValue":l[16]||(l[16]=e=>i(q).user=e),class:"!w-[16rem]"},{default:n((()=>[(o(!0),c(V,null,y(i(R),(e=>(o(),d(s,{key:e,label:e,value:e},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),i(J)?(o(),d(t,{key:0,label:"开机启动"},{default:n((()=>[r(we,{modelValue:i(q).auto_run,"onUpdate:modelValue":l[17]||(l[17]=e=>i(q).auto_run=e)},{default:n((()=>l[33]||(l[33]=[h(" 是否设置开机自动启动(默认自带守护进程每120秒检测一次) ")]))),_:1},8,["modelValue"])])),_:1})):f("",!0),i(J)?f("",!0):(o(),d(t,{key:1,label:"安装依赖包"},{default:n((()=>[r(a,{width:"42rem","icon-type":"folder",placeholder:"安装依赖包路径(非必填)",onFolder:i(W),modelValue:i(q).requirement_path,"onUpdate:modelValue":l[18]||(l[18]=e=>i(q).requirement_path=e)},{append:n((()=>[r(he,{onClick:i(W)},{default:n((()=>[r(D,{icon:"el-folder-opened",class:"cursor-pointer"})])),_:1},8,["onClick"])])),_:1},8,["onFolder","modelValue"])])),_:1})),i(J)?(o(),c("div",ce,["command"!=i(q).stype?(o(),d(t,{key:0,label:"进程数",prop:"processes"},{default:n((()=>[m("div",_e,[r(a,{width:"16rem",modelValue:i(q).processes,"onUpdate:modelValue":l[19]||(l[19]=e=>i(q).processes=e)},null,8,["modelValue"]),r(t,{label:"线程数",prop:"threads"},{default:n((()=>[r(a,{width:"16rem",modelValue:i(q).threads,"onUpdate:modelValue":l[20]||(l[20]=e=>i(q).threads=e)},null,8,["modelValue"])])),_:1})])])),_:1})):f("",!0),i(J)&&"uwsgi"===i(q).stype?(o(),d(t,{key:1,label:"通信方式"},{default:n((()=>[r(z,{modelValue:i(q).is_http,"onUpdate:modelValue":l[21]||(l[21]=e=>i(q).is_http=e),class:"w-[16rem]"},{default:n((()=>[r(s,{label:"http",value:!0}),r(s,{label:"socket",value:!1})])),_:1},8,["modelValue"])])),_:1})):f("",!0)])):f("",!0),i(J)?f("",!0):(o(),c(V,{key:3},[m("div",{class:"more flex items-center cursor-pointer pl-[10rem] my-[2rem] px-[2rem]",onClick:l[22]||(l[22]=e=>ye.value=!i(ye))},[m("i",{class:b(i(ye)?"svgtofont-el-arrow-down":"svgtofont-el-arrow-right")},null,2),m("div",fe,_("更多设置,".concat(i(ye)?"点击收回":"点击查看")),1)]),p(m("div",be,[r(t,{label:"项目初始化命令",prop:"initialize"},{default:n((()=>[r(a,{rows:3,modelValue:i(q).initialize,"onUpdate:modelValue":l[23]||(l[23]=e=>i(q).initialize=e),type:"textarea",name:"initialize",width:"42rem",placeholder:"此处填写用于初始化项目的命令或脚本,常见的有项目数据库初始化操作等。例如:django常使用python manage.py makemigrations 和 python manage.py migrate 初始化数据库"},null,8,["modelValue"])])),_:1})],512),[[u,i(ye)]]),l[34]||(l[34]=m("ul",{class:"mt-[20px] leading-8 text-[1.2rem] list-disc ml-48px"},[m("li",null,"执行命令:请输入项目需要携带的参数,默认请输入执行文件名"),m("li",null,[h(" 通讯协议:wsgi:同步通讯,一次处理一个请求, asgi:异步处理,并发处理请求 "),m("br"),h(" 根据项目情况具体选择,例如: 传统Flask就是wsgi, Fastap框架就是asgi, Django两者都可以支持 ")]),m("li",null,"项目初始化命令:初始化脚本会在创建虚拟环境,安装依赖库之后执行")],-1))],64)),i(J)?(o(),d(t,{key:4,label:" "},{default:n((()=>[r(ke,{type:"primary",onClick:i(ve)},{default:n((()=>l[35]||(l[35]=[h("保存配置")]))),_:1},8,["onClick"])])),_:1})):f("",!0)])),_:1})}}});export{he as default};
Save File
Cancel