import{o as a,g as p,b as r,w as s,u as i,c as f,h as d,d as h,e as g,a as n,f as c,F as v,i as l,t as _}from"./app-DA7OTM4Q.js";import{i as k,c as b}from"./app-BT68AfZ-.js";import{_ as x}from"./app-CiJlaEBR.js";import{L as w}from"./app-CjSxNKvA.js";import{_ as y}from"./app-BWsCS5pa.js";import{_ as C}from"./app-j31z0Ghb.js";import{_ as $}from"./app-C6hnOMuv.js";import{_ as m}from"./app-Dapk2SAF.js";import"./app-scFtFqL8.js";import"./app-DREBJ-ou.js";import"./app-CWBL8eTX.js";import"./app-CnGe5nlE.js";import"./app-OC5wWJiS.js";import"./app-BX4pd6U-.js";import"./app-Bhreb6Cm.js";import"./app-z_TsLOhk.js";import"./app-C5ROEzFd.js";import"./app-Bnbo6OlJ.js";import"./app-Dxa5h-uG.js";import"./app-AbPAjGV5.js";import"./app-BqY8p2gl.js";import"./app-C-GI59rl.js";import"./app-DSiZNBrr.js";import"./app-BotiHebp.js";import"./app-DUjqI3OV.js";import"./app-45ZaIHUI.js";import"./app-KNE_24OY.js";import"./app-SLkqftrw.js";import"./app-BxVwOz69.js";import"./app-WOreqTiW.js";import"./app-up4gT9D9.js";import"./app-D29bbm9n.js";import"./app-B_5dka6q.js";import"./app-CQwVTjAx.js";import"./app-Zes_jb7S.js";function S(){const{utils:o}=k(this);this.createGroup=function(){o.popup("/servers/groups/createPopup",{callback:function(){o.success("保存成功",function(){o.reload()})}})},this.deleteGroup=function(t){let u=this;o.confirm("确定要删除这个分组吗？",function(){u.$post("/servers/groups/group/delete").params({groupId:t}).success(function(){o.success("删除成功",function(){o.reload()})})})},this.sortTable=function(t){this.$post("/servers/groups/sort").params({groupIds:t}).success(function(){o.successToast("保存成功")})}}const I=["href"],T=["href"],B={key:1,class:"disabled"},G=["href"],N=["onClick"],V={key:0,class:"comment flex items-center"},D=n("i",{class:"icon bars"},null,-1),gt={__name:"index",setup(o){const t=b(new S);return(u,F)=>(a(),p(v,null,[r(x,{"active-tab":"group"}),r(C,null,{default:s(()=>[r($,{onClick:l(i(t).createGroup,["prevent"]),"action-create":""},{default:s(()=>[c("创建新分组")]),_:1},8,["onClick"])]),_:1}),i(t).groups.length==0?(a(),f(y,{key:0},{default:s(()=>[c("暂时还没有分组。")]),_:1})):d("",!0),h(n("div",null,[r(w,{items:i(t).groups,onSort:i(t).sortTable},{default:s(()=>[r(m,{"row-reorder":"",style:{width:"3em"}}),r(m,{header:"分组名称"},{body:s(({data:e})=>[n("a",{href:"/servers/groups/group?groupId="+e.id},_(e.name),9,I)]),_:1}),r(m,{header:"网站数量",class:"value-column"},{body:s(({data:e})=>[e.countServers>0?(a(),p("a",{key:0,href:"/servers?groupId="+e.id},_(e.countServers),9,T)):(a(),p("span",B,"0"))]),_:1}),r(m,{header:"操作",class:"two op"},{body:s(({data:e})=>[n("a",{href:"/servers/groups/group?groupId="+e.id},"详情",8,G),c("   "),n("a",{href:"",onClick:l(L=>i(t).deleteGroup(e.id),["prevent"])},"删除",8,N)]),_:1})]),_:1},8,["items","onSort"]),i(t).groups.length>0?(a(),p("p",V,[c("可以拖动左侧的"),D,c("排序。 ")])):d("",!0)],512),[[g,i(t).groups.length>0]])],64))}};export{gt as default};
