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-BYcXwl4U.js";import{i as k,c as b}from"./app-a6cKceqE.js";import{_ as x}from"./app-P8cMy8sv.js";import{L as w}from"./app-W_y7sflh.js";import{_ as y}from"./app-uhTxLRnQ.js";import{_ as C}from"./app-B6Y8s8wR.js";import{_ as $}from"./app-DmX24te2.js";import{_ as m}from"./app-BqeukU67.js";import"./app-DCd54JMo.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.js";import"./app-DPDEogA0.js";import"./app-DxjODhok.js";import"./app-CabATHnR.js";import"./app-BhzV4gWo.js";import"./app-CJCAnMrx.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-BG60hdvp.js";import"./app-CNARLpXE.js";import"./app-SxAW7vhf.js";import"./app-D5k1HLu9.js";import"./app-ysQ8KbGS.js";import"./app-BDgR0DSb.js";import"./app-Cc2zXvHs.js";import"./app-aSafd0Me.js";import"./app-BHl80pFw.js";import"./app-Btbk6LWy.js";import"./app-CrkKi1Ag.js";import"./app-u5shTDG_.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BQ5ggxk2.js";import"./app-D3zbrzdO.js";import"./app-CrjU8lgK.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};
