File: /www/server/panel/BTPanel/static/js/index178.js
import{e as c,_ as l,f as b,d3 as v}from"./utils-lib.js?v=1777008528";import{_ as y}from"./index118.js?v=1777008528";import{c as j,r as _,aF as E,o as k,I as w,j as x,k as D,e as i,v as o,x as C,J as A,p as m,z as L}from"./base-lib.js?v=1777008528";import{g as $}from"./index3.js?v=1777008528";import{delJavaGroup as O,getJavaGroupList as P}from"./site.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./index119.js?v=1777008528";import"./index116.js?v=1777008528";const V={class:"p-2rem"},z=j({__name:"index",setup(B){const p=b(),u=_([{name:"test",status:"启动",projects:[]}]),n=_(!1),d=[{prop:"group_name",label:"组名"},{prop:"projects",label:"包含项目",width:250,render:e=>e.projects.map(t=>t.name).join(",")},{prop:"status",label:"项目状态",render:e=>{let t={succeeded:0,failed:0,waiting:0,not_run:0};const a=[];switch(e.now_operation){case"start":a.push("启动操作运行中");break;case"stop":a.push("停止操作运行中");break}return e.projects&&e.projects.length>0&&(e.projects.forEach(r=>{t.hasOwnProperty(r.project_status)&&t[r.project_status]++}),t.succeeded>0&&a.push("正常运行".concat(t.succeeded,"个")),t.failed>0&&a.push("运行异常".concat(t.failed,"个")),t.not_run>0&&a.push("未运行".concat(t.not_run,"个")),t.wait>0&&a.push("".concat(t.wait,"个项目启动中"))),E("span",a.length?a.join(","):"--")}},$([{onClick:e=>{c({isAsync:!0,title:"项目组【".concat(e.group_name,"】管理"),area:84,component:()=>l(()=>import("./group-detail.js?v=1777008528").then(t=>t.g),__vite__mapDeps([]),import.meta.url),compData:{...e,refreshEvent:s}})},title:"管理"},{onClick:async e=>{try{const t=await O({group_id:e.group_id});p.request(t),s()}catch(t){}},title:"删除"}])],f=async()=>{c({isAsync:!0,title:"添加项目组",area:50,btn:"确定",component:()=>l(()=>import("./add-group.js?v=1777008528"),__vite__mapDeps([]),import.meta.url),compData:{refreshEvent:s}})},s=async()=>{try{n.value=!0;const e=await P();e.status?u.value=e.data:p.error(e.msg)}catch(e){}finally{n.value=!1}};return k(async()=>{await s()}),(e,t)=>{const a=L,r=v,g=y,h=w("bt-loading");return x(),D("div",V,[i(g,null,{"header-left":o(()=>[i(a,{type:"primary",onClick:f},{default:o(()=>[...t[0]||(t[0]=[C("添加分组",-1)])]),_:1})]),"header-right":o(()=>[...t[1]||(t[1]=[])]),content:o(()=>[A(i(r,{maxHeight:"300",column:d,data:m(u)},null,8,["data"]),[[h,m(n)]])]),"footer-left":o(()=>[...t[2]||(t[2]=[])]),_:1})])}}});export{z as default};
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = []
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}