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

2 lines
11 KiB
JavaScript

import{t as Y,z as M,p as Q,h as j,i as I,v as V,aJ as tt,l as et,x as nt}from"./index-BTglIPU2.js?v=1773287522785";import{_ as q}from"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import{_ as E}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{U as ot,V as at,W as st,X as lt,Y as it,Z as rt,c as pt}from"./index.vue_vue_type_script_setup_true_lang-D182bQZ0.js?v=1773287522785";import{u as B}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{u as F}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as N}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{g as W}from"./index-CstnY5q4.js?v=1773287522785";import{_ as z}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{k as R,R as U,n as mt,r as D,e as L,a0 as t,j as _,$ as S,Z as A,S as e,a9 as l,X as ut,c as ct,aa as w,_ as dt,w as _t,a8 as ft,am as ht,u as vt}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as O,b as X,a3 as Z,ag as G,k as yt,B as H,o as bt}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{_ as J}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as gt}from"./index.vue_vue_type_script_setup_true_lang-CgKUoL60.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./data-BVsViUMm.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"./index-COOnaZWq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-C5hb-Th7.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-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";import"./index-K4YGya6V.js?v=1773287522785";const wt={class:"p-20px"},kt=R({__name:"index",props:{data:{}},setup(b,{expose:i}){const{t:f}=U(),p=b,{onRefresh:k,tableData:g}=p.data;mt(()=>{n.data=g});const c=D(null),a=L({name:"",path:"",remark:""}),v={name:{required:!0,message:f("Virtual environment name cannot be empty"),trigger:["blur","input"]},path:{required:!0,message:f("Please select the environment source to create virtual environment"),trigger:"change"}},{keys:d,table:n,columns:s}=B([{type:"selection",width:40,multiple:!1},{key:"name",title:f("Site.TableRow.index_2")},{key:"type",title:f("Home.index_54"),render:m=>t("span",null,[W(m),_(" ")])},{key:"version",title:f("Python version")}]),h=m=>({style:"cursor: pointer;",onClick:()=>{var u;d.value=[m.bin_path],a.path=m.bin_path,(u=c.value)==null||u.validate()}});return i({onConfirm:async()=>{var u;await((u=c.value)==null?void 0:u.validate());const m={venv_name:a.name,python_bin:a.path,ps:a.remark};await ot(m),k()}}),(m,u)=>{const y=X,o=O,r=E,C=z;return S(),A("div",wt,[t(C,{ref_key:"formRef",ref:c,model:e(a),rules:v},{default:l(()=>[t(o,{label:m.$t("Site.TableRow.index_2"),path:"name"},{default:l(()=>[t(y,{class:"w-250px!",value:e(a).name,"onUpdate:value":u[0]||(u[0]=x=>e(a).name=x),placeholder:m.$t("Virtual environment name")},null,8,["value","placeholder"])]),_:1},8,["label"]),t(o,{label:m.$t("Environment source"),path:"path"},{default:l(()=>[t(r,{"checked-row-keys":e(d),"onUpdate:checkedRowKeys":u[1]||(u[1]=x=>ut(d)?d.value=x:null),"row-key":"bin_path",loading:e(n).loading,data:e(n).data,"max-height":220,columns:e(s),"row-props":h},null,8,["checked-row-keys","loading","data","columns"])]),_:1},8,["label"]),t(o,{label:m.$t("Security.Firewall.Port.index_26")},{default:l(()=>[t(y,{class:"w-250px!",value:e(a).remark,"onUpdate:value":u[2]||(u[2]=x=>e(a).remark=x),placeholder:m.$t("Security.Firewall.Port.index_26")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])])}}}),xt={class:"p-20px"},$t=R({__name:"index",props:{data:{}},setup(b,{expose:i}){const{t:f}=U(),p=b,{onRefresh:k}=p.data,g=ct(()=>a.type===1?f("Adding virtual environment requires specifying the virtual environment directory"):f("Adding system environment requires specifying the Python interpreter file")),c=D(null),a=L({type:1,path:""}),v={path:{required:!0,message:f("Security.Conf.Index_28"),trigger:["blur","input"]}};return i({onConfirm:async()=>{var s;await((s=c.value)==null?void 0:s.validate());const n={add_type:a.type===1?"venv":"system",path:a.path};await at(n),k()}}),(n,s)=>{const h=G,$=Z,m=O,u=gt,y=z,o=J;return S(),A("div",xt,[t(y,{ref_key:"formRef",ref:c,model:e(a),rules:v},{default:l(()=>[t(m,{label:n.$t("Environment type")},{default:l(()=>[t($,{value:e(a).type,"onUpdate:value":[s[0]||(s[0]=r=>e(a).type=r),s[1]||(s[1]=r=>e(a).path="")]},{default:l(()=>[t(h,{value:1},{default:l(()=>[_(w(n.$t("Virtual environment")),1)]),_:1}),t(h,{value:2},{default:l(()=>[_(w(n.$t("System environment")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),t(m,{label:n.$t("Location"),path:"path"},{default:l(()=>[t(u,{class:"w-400px",checkedType:e(a).type===1?["dir"]:["file"],value:e(a).path,"onUpdate:value":s[2]||(s[2]=r=>e(a).path=r),placeholder:e(g)},null,8,["checkedType","value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"]),t(o,null,{default:l(()=>[dt("li",null,w(e(g)),1)]),_:1})])}}}),Ct=R({__name:"index",setup(b){const{t:i}=U(),f=Y(),p=L({type:1}),k=()=>{j({title:i("Update version list"),content:i("Will fetch version list from mirror source, continue?"),onConfirm:()=>{d(!0)}})},{table:g,columns:c}=B([{key:"version",title:i("Site.TableRow.index_3")},{key:"is",title:i("Installation status"),render:n=>n.is_install?t("span",{class:"text-warning cursor-pointer",onClick:()=>M()},[_(" "),i("Soft.index_40"),_(" ")]):t("span",{class:n.installed?"text-primary":"text-error"},[_(" "),n.installed?i("WP.TableRow.index_14"):i("Docker.App.Install.index_8"),_(" ")])},F({options:n=>[{label:i("Public.Btn.Install"),show:!n.installed&&!n.is_install,onClick:()=>{const s=D("");Q({title:"Install version[".concat(n.version,"]"),footer:!0,width:500,content:()=>t("div",{class:"p-20px"},[t(yt,{class:"flex-nowrap! items-center!"},{default:()=>[t("span",null,[i("Custom parameters")]),t(X,{class:"w-300px!",value:s.value,"onUpdate:value":h=>s.value=h,placeholder:"Can be empty, example: --enable-optimizations"},null)]}),t(J,{class:"mt-16px"},{default:()=>[t("li",null,[i("When filling in, please do not add line breaks or other special symbols, which may cause the parameters to be invalid")]),t("li",null,[i("Multiple parameters should be separated by spaces")]),t("li",null,[i('The "--prefix" parameter has been used')]),t("li",null,[i("To verify whether the parameters are valid, you can check the installation log and search for the corresponding name")])]})]),onConfirm:async()=>{await st({version:n.version,extended:s.value}),M(),d()}})}},{label:i("Public.Btn.Uninstall"),show:n.installed&&!n.is_install,type:"error",onClick:()=>{j({title:i("Uninstall sdk"),content:i("Uninstall [{0}] will cause relevant projects to fail to run, are you sure you want to uninstall?",[n.version]),onConfirm:async()=>{await lt({version:n.version}),d()}})}}]})]);_t(()=>f.taskCount,()=>{d()});const{loading:a,setLoading:v}=N(),d=async(n=!1)=>{try{v(!0);const{message:s}=await it({force:n});I(s)&&(g.data=p.type===1?s.sdk.streamline:s.sdk.all)}finally{v(!1)}};return d(),(n,s)=>{const h=G,$=Z,m=H,u=E,y=q;return S(),ft(y,{class:"p-16px"},{toolsLeft:l(()=>[t($,{value:e(p).type,"onUpdate:value":[s[0]||(s[0]=o=>e(p).type=o),d]},{default:l(()=>[t(h,{value:1},{default:l(()=>[_(w(n.$t("Common version")),1)]),_:1}),t(h,{value:2},{default:l(()=>[_(w(n.$t("All version")),1)]),_:1})]),_:1},8,["value"])]),toolsRight:l(()=>[t(m,{onClick:k},{default:l(()=>[_(w(n.$t("Update version list")),1)]),_:1})]),table:l(()=>[t(u,{"max-height":400,loading:e(a),data:e(g).data,columns:e(c)},null,8,["loading","data","columns"])]),_:1})}}}),Pt={class:"p-20px"};function Rt(b){return typeof b=="function"||Object.prototype.toString.call(b)==="[object Object]"&&!vt(b)}const we=R({__name:"index",emits:["close"],setup(b,{expose:i,emit:f}){const{t:p}=U(),k=f,g=ht(),c=V(p("Create virtual environment"),{onRefresh:()=>y()}),a=V(p("Adding environment"),{onRefresh:()=>y()}),v=V(p("Python version management")),d=()=>{c.data.tableData=h.data.filter(o=>o.can_create),c.show=!0},n=()=>{a.show=!0},s=()=>{v.show=!0},{table:h,columns:$}=B([{key:"name",title:p("Site.TableRow.index_2"),width:"30%",ellipsis:{tooltip:{width:"trigger"}},render:o=>{let r;return t("span",null,[o.name,_(" "),t(bt,{bordered:!1},Rt(r=W(o))?r:{default:()=>[r]})])}},{key:"version",title:p("Python version")},{key:"path",title:p("Parser location"),render:o=>t(et,{name:"base-dir",class:"cursor-pointer",size:"16",onClick:()=>{tt("Path",o.bin_path),g.push("/files"),k("close")}},null)},{key:"remark",title:p("Using project"),ellipsis:{tooltip:{width:"trigger"}},render:o=>t("span",null,[o.project_name.join(",")||"-"])},{key:"remark",title:p("Security.Firewall.Port.form_11"),render:o=>{var r;return t("span",null,[o.ps,o.type==="venv"?" [From ".concat((r=o.system_data)==null?void 0:r.name,"]"):""])}},F({width:100,options:o=>[{label:p("Public.Btn.Del"),show:o.can_remove,onClick:()=>{j({title:p("Delete environment {0}",[o.name]),content:p("Deleting the environment will cause relevant projects to fail to run, are you sure you want to delete?"),onConfirm:async()=>{await rt({path_data:o.bin_path}),y()}})}}]})]),{loading:m,setLoading:u}=N(),y=async()=>{try{u(!0);const{message:o}=await pt({sort_not_use:0});I(o)&&(h.data=o.env_list)}finally{u(!1)}};return y(),i({init:y}),(o,r)=>{const C=H,x=E,K=q,T=nt;return S(),A("div",Pt,[t(K,null,{toolsLeft:l(()=>[t(C,{type:"primary",onClick:d},{default:l(()=>[_(w(o.$t("Create virtual environment")),1)]),_:1}),t(C,{onClick:n},{default:l(()=>[_(w(o.$t("Add environment")),1)]),_:1}),t(C,{onClick:s},{default:l(()=>[_(w(o.$t("Version management")),1)]),_:1})]),table:l(()=>[t(x,{"max-height":250,loading:e(m),data:e(h).data,columns:e($)},null,8,["loading","data","columns"])]),_:1}),t(T,{show:e(c).show,"onUpdate:show":r[0]||(r[0]=P=>e(c).show=P),title:e(c).title,data:e(c).data,width:650,footer:!0,component:kt},null,8,["show","title","data"]),t(T,{show:e(a).show,"onUpdate:show":r[1]||(r[1]=P=>e(a).show=P),title:e(a).title,data:e(a).data,width:600,footer:!0,component:$t},null,8,["show","title","data"]),t(T,{show:e(v).show,"onUpdate:show":r[2]||(r[2]=P=>e(v).show=P),title:e(v).title,data:e(v).data,width:500,component:Ct},null,8,["show","title","data"])])}}});export{we as default};