import{aa as e,l as a,bK as t,aD as s,aB as o,a4 as l,$ as n,ac as i,aq as r,A as u,a7 as c,z as d,x as p,ao as m,a3 as h,q as v,a1 as f,a2 as _,v as y}from"./utils-lib.js?v=20260328163632";import{B as g}from"./index91.js?v=20260328163632";import{u as k}from"./index92.js?v=20260328163632";import{h as b,i as x,j,u as w,a as C,b as R,f as O,k as P,e as E,l as V}from"./useMethod4.js?v=20260328163632";import{u as A}from"./store4.js?v=20260328163632";import{g as S,A as z,D}from"./site.js?v=20260328163632";import{r as q,O as B,k as I,w as L,o as K,J as T,V as F,W as U,a3 as W,Y as M,F as J,N,X,Z as Y}from"./base-lib.js?v=20260328163632";import{au as Z}from"./naive-ui.js?v=20260328163632";const{siteInfo:$,isRefreshList:G,setSiteInfo:H}=A();q({});const Q=q(""),ee=q(""),ae=q(!1),te=q([]),se=e=>e.id,oe=q([]),le=()=>{u({title:a("Python环境管理"),area:800,component:()=>c((()=>import("./index171.js?v=20260328163632")),[],import.meta.url),showFooter:!1})},ne=e=>{u({title:a("终端"),area:[1e3,560],customClass:"bt-py-terminal",showFooter:!1,component:()=>c((()=>import("./index172.js?v=20260328163632")),[],import.meta.url),compData:e})},ie=(e,t="")=>{H(e,t),u({title:a("Python项目管理")+"[".concat(e.name,"] -- ")+a("添加时间")+"[".concat(e.addtime,"]"),area:[840,720],component:()=>c((()=>import("./index173.js?v=20260328163632")),[],import.meta.url)})},re=q({columns:[e(),{title:a("项目名称"),key:"name",isCustom:!1,minWidth:120,render:e=>B("span",{class:"bt-link",onClick:()=>ie(e)},[e.name])},b(),{title:a("服务状态"),key:"run",width:80,render:e=>{const s=!!e.pid;return B(t,{modelValue:s,data:[a("已停止"),a("运行中")],onClick:()=>x(e)},null)}},j(),s({key:"path",minWidth:140}),...w(),C({...m()}),o({table:"sites",minWidth:110,width:"auto",request:E}),R({onClick:e=>{ie(e,"ssl")}}),l([{onClick:e=>ne({env:e.shell_envs,path:e.path}),title:a("终端")},{onClick:e=>ie(e),title:a("设置")},{onClick:async e=>{await d({title:a("删除Python项目【{0}】",[e.name]),content:a("风险操作，此操作不可逆，删除{0}项目后您将无法管理该项目，是否继续操作？",[e.name]),type:"input",input:{content:a("删除项目")}}),p({loading:a("正在删除项目，请稍等..."),request:S({id:e.id}),message:!0,success:e=>{e.status&&ye()}})},title:a("删除")}],{width:90})],data:[]}),ue=q({page:1,pageSize:20,itemCount:0,pageSlot:5}),[ce,de]=n(re),[pe]=h(ue),{BtOperation:me}=k({options:[{active:!0,label:a("添加Python项目"),onClick:()=>{$.value=null,u({title:a("添加Python项目"),area:680,component:()=>c((()=>import("./index170.js?v=20260328163632")),[],import.meta.url),showFooter:!0})}},{label:a("Python环境管理"),onClick:le},...O()]}),{BtBatch:he}=i({tableRef:de,checkedRowKeys:te,options:[{label:a("启动项目"),value:"start",event:P},{label:a("停用项目"),value:"stop",event:P},{label:a("重启项目"),value:"restart",event:P},{label:a("删除项目"),value:"delete",event:P}]}),{BtColumn:ve}=r({tableRef:de,column:re.value.columns}),fe=e=>{re.value.columns.forEach((a=>{void 0!==a.sortOrder&&(e&&a.key===e.columnKey?a.sortOrder=e.order:a.sortOrder=!1)}));const{order:a,columnKey:t}=e;ee.value=a?"".concat(t," ").concat("descend"===a?"desc":"asc"):"",ye()},_e=()=>{ue.value.page=1,ye()},ye=(e={search_type:"python",search:Q.value,p:ue.value.page,limit:ue.value.pageSize,order:ee.value})=>{p({loading:ae,request:z(e),success:e=>{var a;const{data:t,page:s}=e.data;if(re.value.data=Array.isArray(t)?t:[],ue.value.itemCount=(null==s?void 0:s.total)||0,(null==(a=$.value)?void 0:a.id)&&(null==t?void 0:t.length)){const e=null==t?void 0:t.find((e=>e.id===$.value.id));e&&H({...$.value,...e})}}})},ge=()=>{ke(),ye()},ke=()=>{Q.value="",re.value.data=[],te.value=[],oe.value=[],Object.assign(ue.value,{page:1,itemCount:0})},be=()=>p({request:D(),success:e=>{oe.value=e.data}}),xe={class:"text-14px text-[var(--text-color-2)]"},je=I({__name:"index",setup(e){const{isRefreshList:t}=A();return L((()=>t.value),(e=>{e&&(ye(),t.value=!1)})),K(ge),T(ke),(e,t)=>{const s=Z;return F(),U(J,null,[B(M(_),null,{"header-left":W((()=>[B(M(me),{class:"!gap-10px"})])),"header-right":W((()=>[B(s,{class:"!gap-10px"},{default:W((()=>[B(M(v),{modelValue:M(Q),"onUpdate:modelValue":t[0]||(t[0]=e=>N(Q)?Q.value=e:null),placeholder:M(a)("请输入项目名称或备注"),class:"!w-[220px]",onSearch:M(_e)},null,8,["modelValue","placeholder","onSearch"]),B(M(g),{onRefresh:M(ye)},null,8,["onRefresh"]),B(M(ve))])),_:1})])),content:W((()=>[B(M(ce),{"checked-row-keys":M(te),"onUpdate:checkedRowKeys":t[1]||(t[1]=e=>N(te)?te.value=e:null),"row-key":M(se),loading:M(ae),"scroll-x":1e3,"onUpdate:sorter":M(fe)},null,8,["checked-row-keys","row-key","loading","onUpdate:sorter"])])),"footer-left":W((()=>[B(M(he))])),"footer-right":W((()=>[B(M(pe),{"show-size-picker":"","page-sizes":M(f)([10,20,50,100]),onRefresh:M(ye)},{suffix:W((()=>[X("span",xe,Y(M(a)("共 {0} 条",[M(ue).itemCount])),1)])),_:1},8,["page-sizes","onRefresh"])])),_:1}),B(M(y),{class:"!mt-20px",options:M(V)},null,8,["options"])],64)}}}),we=Object.freeze(Object.defineProperty({__proto__:null,default:je},Symbol.toStringTag,{value:"Module"}));export{ne as a,be as g,we as i,le as o,oe as p};
