Files
yakpanel-core/YakPanel/static/vite/js/index-W1iG5tgJ.js
2026-04-07 02:04:22 +05:30

2 lines
10 KiB
JavaScript

import{_ as A}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{_ as D}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as J}from"./index.vue_vue_type_script_setup_true_lang-CgKUoL60.js?v=1773287522785";import{k as L,R as O,r as y,e as B,$ as _,Z as I,a0 as n,a9 as l,S as o,a8 as j,ak as b,j as d,aa as s,l as G,_ as h,v as T,F as z}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{S as W,T as K}from"./index.vue_vue_type_script_setup_true_lang-D182bQZ0.js?v=1773287522785";import{_ as M,p as Y,a as Z,s as H,o as Q}from"./index-CstnY5q4.js?v=1773287522785";import{i as X,c as ee}from"./index-BTglIPU2.js?v=1773287522785";import{k as te,a1 as ae,b as ne,_ as oe,a3 as le,ag as pe,a6 as re,a4 as se,aD as ie,aC as me}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./index-K4YGya6V.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./useLoading-CZ2gSAW7.js?v=1773287522785";import"./useTableColumns-DDeyYvje.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";import"./useTableData-BmkIKQ_R.js?v=1773287522785";import"./index-COOnaZWq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-C5hb-Th7.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-HxsqzSKU.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-D2Bk83Ev.js?v=1773287522785";import"./ssl-Bm8jcneQ.js?v=1773287522785";import"./php-D3q5Oj7O.js?v=1773287522785";import"./startOfToday-CAr_5zlJ.js?v=1773287522785";import"./index-BGYvyLDv.js?v=1773287522785";import"./index-CZps0rIN.js?v=1773287522785";import"./index-BRGNrVIs.js?v=1773287522785";import"./index-Cy3Gp9Hk.js?v=1773287522785";import"./theme-monokai-Bqt0uTuQ.js?v=1773287522785";import"./ace-CNnfDSio.js?v=1773287522785";import"./file-B5PwfK2h.js?v=1773287522785";import"./index-BRQskX9P.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-ChFCGdPN.js?v=1773287522785";import"./index-lEMZglLp.js?v=1773287522785";import"./ssl-BX4fpgDY.js?v=1773287522785";import"./cert-YIN9uVgw.js?v=1773287522785";import"./ssl-lets-progress-6I5lHATh.js?v=1773287522785";import"./utils-DELCcnjr.js?v=1773287522785";import"./index-1Hsfnsau.js?v=1773287522785";import"./paypal-js-DVrdQmks.js?v=1773287522785";import"./alarm-DLi1oY_0.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-O0FWUQU9.js?v=1773287522785";import"./alarm-C8du74Vj.js?v=1773287522785";const ue={class:"p-20px"},_e=["textContent"],de=["textContent"],fe=["textContent"],ce=L({__name:"index",props:{getList:{type:Function}},setup(q,{expose:U}){const $=q,{t:f}=O(),w=y(null),P=y(null),k=y(null),e=B({pj_name:"",pj_port:null,python_version:null,pj_manager:"command",pj_path:"",pj_entry_file:"",pj_run_command:"",pj_protocol:"wsgi",pj_app_name:"",env_type:0,pj_env_file:"",pj_env_list:"",pj_user:"www",requirements_path:"",pj_init_command:"",framework:""}),S={pj_name:{required:!0,message:f("Please enter project name"),trigger:["blur","input","change"]},pj_port:{required:!0,type:"number",message:f("Port"),trigger:["blur","input"]},python_version:{required:!0,message:f("Please select python environment"),trigger:"change"},pj_path:{required:!0,message:f("Please enter project path"),trigger:["blur","change"]},pj_run_command:{required:!0,message:f("Please enter startup command"),trigger:["blur","input"]}},N=async t=>{var c,m,u;if(!t)return;const a=t.replace(/\/$/,""),i=(c=a.substring(a.lastIndexOf("/")+1))==null?void 0:c.replace(/\./g,"_");e.pj_name=i;const{message:r}=await W({path:t});X(r)&&(e.framework=r.framework,e.pj_entry_file=r.runfile,e.pj_protocol=r.xsgi,e.pj_app_name=r.call_app,e.requirements_path=r.requirement_path,(m=P.value)==null||m.validate(),(u=k.value)==null||u.validate())};return U({onConfirm:async()=>{var a;await((a=w.value)==null?void 0:a.validate());const t={pjname:e.pj_name,port:e.pj_port||"",stype:e.pj_manager,path:e.pj_path,user:e.pj_user,requirement_path:e.requirements_path,env_file:e.env_type===2?e.pj_env_file:"",env_list:e.env_type===1?JSON.stringify(H(e.pj_env_list)):"[]",framework:e.framework,project_cmd:e.pj_run_command,python_bin:e.python_version,initialize:e.pj_init_command};e.pj_manager!=="command"&&(t.xsgi=e.pj_protocol,t.rfile=e.pj_entry_file,t.call_app=e.pj_app_name),await K(t),$.getList(),Q(e.pj_name,()=>$.getList())}}),(t,a)=>{const i=ne,r=ae,c=oe,m=te,u=pe,C=le,v=J,E=re,g=se,F=me,x=ie,R=D,V=A;return _(),I("div",ue,[n(V,{ref_key:"formRef",ref:w,model:o(e),rules:S,"label-width":"150"},{default:l(()=>[n(m,{class:"flex-nowrap!"},{default:l(()=>[n(r,{label:t.$t("Project Name"),path:"pj_name",ref_key:"formPJNameItemRef",ref:P,"show-require-mark":!0},{default:l(()=>[n(i,{class:"w-250px!",value:o(e).pj_name,"onUpdate:value":a[0]||(a[0]=p=>o(e).pj_name=p),placeholder:t.$t("Python project name")},null,8,["value","placeholder"])]),_:1},8,["label"]),o(e).pj_manager!=="command"?(_(),j(r,{key:0,label:t.$t("Project Port"),path:"pj_port","label-width":"auto"},{default:l(()=>[n(c,{class:"w-100px!",value:o(e).pj_port,"onUpdate:value":a[1]||(a[1]=p=>o(e).pj_port=p),placeholder:t.$t("Port"),"show-button":!1,min:0,max:65535},null,8,["value","placeholder"])]),_:1},8,["label"])):b("",!0)]),_:1}),n(r,{label:t.$t("Python Environment"),path:"python_version","show-require-mark":!0},{default:l(()=>[n(M,{value:o(e).python_version,"onUpdate:value":a[2]||(a[2]=p=>o(e).python_version=p),placeholder:t.$t("Please select python environment")},null,8,["value","placeholder"])]),_:1},8,["label"]),n(r,{label:t.$t("Startup Way"),path:"pj_manager"},{default:l(()=>[n(C,{value:o(e).pj_manager,"onUpdate:value":a[3]||(a[3]=p=>o(e).pj_manager=p)},{default:l(()=>[n(u,{value:"command"},{default:l(()=>[d(s(t.$t("Command Startup")),1)]),_:1}),n(u,{value:"uwsgi"},{default:l(()=>a[15]||(a[15]=[d("uwsgi")])),_:1,__:[15]}),n(u,{value:"gunicorn"},{default:l(()=>a[16]||(a[16]=[d("gunicorn")])),_:1,__:[16]})]),_:1},8,["value"])]),_:1},8,["label"]),n(r,{label:t.$t("Project Path"),path:"pj_path",ref_key:"formPJPathItemRef",ref:k,"show-require-mark":!0},{default:l(()=>[n(m,null,{default:l(()=>[n(v,{class:"w-400px",value:o(e).pj_path,"onUpdate:value":[a[4]||(a[4]=p=>o(e).pj_path=p),N],placeholder:t.$t("Project root path")},null,8,["value","placeholder"]),G(h("span",null,s(t.$t("Current Framework"))+": "+s(o(e).framework),513),[[T,o(e).framework]])]),_:1})]),_:1},8,["label"]),o(e).pj_manager!=="command"?(_(),I(z,{key:0},[n(r,{label:t.$t("Entry file"),path:"pj_entry_file"},{default:l(()=>[n(v,{class:"w-400px",checkedType:["file"],value:o(e).pj_entry_file,"onUpdate:value":a[5]||(a[5]=p=>o(e).pj_entry_file=p),placeholder:t.$t("Entry file")},null,8,["value","placeholder"])]),_:1},8,["label"]),n(m,{class:"flex-nowrap!"},{default:l(()=>[n(r,{label:t.$t("Comm Protocol"),path:"pj_protocol"},{default:l(()=>[n(E,{class:"w-150px",value:o(e).pj_protocol,"onUpdate:value":a[6]||(a[6]=p=>o(e).pj_protocol=p),options:o(Y)},null,8,["value","options"])]),_:1},8,["label"]),n(r,{label:t.$t("Application Name"),path:"pj_app_name","label-width":"auto"},{default:l(()=>[n(i,{class:"w-200px!",value:o(e).pj_app_name,"onUpdate:value":a[7]||(a[7]=p=>o(e).pj_app_name=p),placeholder:t.$t("Application Name")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1})],64)):(_(),j(r,{key:1,label:t.$t("Startup Command"),path:"pj_run_command"},{default:l(()=>[n(i,{class:"w-400px!",value:o(e).pj_run_command,"onUpdate:value":a[8]||(a[8]=p=>o(e).pj_run_command=p),placeholder:t.$t("Please enter startup command")},null,8,["value","placeholder"])]),_:1},8,["label"])),n(r,{label:t.$t("Environment Variables")},{default:l(()=>[n(C,{value:o(e).env_type,"onUpdate:value":a[9]||(a[9]=p=>o(e).env_type=p)},{default:l(()=>[n(g,{value:0},{default:l(()=>[d(s(t.$t("None")),1)]),_:1}),n(g,{value:1},{default:l(()=>[d(s(t.$t("Specify Variable")),1)]),_:1}),n(g,{value:2},{default:l(()=>[d(s(t.$t("Load from file")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),o(e).env_type===1?(_(),j(r,{key:2,label:" "},{default:l(()=>[n(i,{class:"w-400px!",type:"textarea",value:o(e).pj_env_list,"onUpdate:value":a[10]||(a[10]=p=>o(e).pj_env_list=p),placeholder:t.$t("Format: KEY=VALUE, one per line")},null,8,["value","placeholder"])]),_:1})):b("",!0),o(e).env_type===2?(_(),j(r,{key:3,label:" "},{default:l(()=>[n(v,{class:"w-400px",value:o(e).pj_env_file,"onUpdate:value":a[11]||(a[11]=p=>o(e).pj_env_file=p),placeholder:t.$t("Please select environment file")},null,8,["value","placeholder"])]),_:1})):b("",!0),n(r,{label:t.$t("Startup User"),path:"pj_user"},{default:l(()=>[n(Z,{class:"w-400px",value:o(e).pj_user,"onUpdate:value":a[12]||(a[12]=p=>o(e).pj_user=p)},null,8,["value"])]),_:1},8,["label"]),n(r,{label:t.$t("Install Dependencies")},{default:l(()=>[n(v,{value:o(e).requirements_path,"onUpdate:value":a[13]||(a[13]=p=>o(e).requirements_path=p),class:"w-400px",checkedType:["file"],placeholder:t.$t("Install dependency path (Optional)")},null,8,["value","placeholder"])]),_:1},8,["label"]),n(x,null,{default:l(()=>[n(F,{title:t.$t("More settings"),name:"more"},{default:l(()=>[n(r,{label:t.$t("Project Init Command")},{default:l(()=>[n(i,{class:"w-400px!",type:"textarea",value:o(e).pj_init_command,"onUpdate:value":a[14]||(a[14]=p=>o(e).pj_init_command=p),placeholder:t.$t("Enter command or script to initialize project")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["title"])]),_:1}),n(R,{class:"mt-16px"},{default:l(()=>[h("li",{textContent:s(t.$t("Startup Command: Please enter the parameters the project needs to carry, default execute file name"))},null,8,_e),h("li",{textContent:s(t.$t("Comm protocols: WSGI: synchronous communication, processing one request at a time; ASGI: asynchronous processing, handling requests concurrently. Choose the appropriate protocol based on your project needs. For example, traditional Flask uses WSGI, the FastAPI framework uses ASGI, and Django supports both"))},null,8,de),h("li",{textContent:s(t.$t("Project Init Command: Initialization script will execute after creating virtual env and installing dependencies"))},null,8,fe)]),_:1})]),_:1},8,["model"])])}}}),mt=ee(ce,[["__scopeId","data-v-a1205034"]]);export{mt as default};