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-SC54XQDl.js";import{i as k,c as b}from"./app-Ba7ZqSpq.js";import{_ as x}from"./app-CavfYegc.js";import{L as w}from"./app-Crd12MWL.js";import{_ as y}from"./app-D9UgVOV0.js";import{_ as C}from"./app-CBN_lwXA.js";import{_ as $}from"./app-BUqHq_rP.js";import{_ as m}from"./app-CWnUJ4gg.js";import"./app-CL60OiIv.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";import"./app-BjSCO7rC.js";import"./app-Dhl-Bw0H.js";import"./app-B2C_dtYI.js";import"./app-COidJXl1.js";import"./app-DHsI_tns.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-PPG0ZS4d.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-DnXuoh8P.js";import"./app-CCkWSX4Q.js";import"./app-C8HFiBxn.js";import"./app-g-bJrEAS.js";import"./app-DZaelcLs.js";import"./app-D_RBJHM6.js";import"./app-CmrRgGIA.js";import"./app-DyP4Nide.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app--Lj8zATS.js";import"./app-C2mBgI5Z.js";import"./app-CNHjdV6U.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};
