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-DnroACXc.js";import{i as k,c as b}from"./app-DckefXYL.js";import{_ as x}from"./app-D0f9X7Bs.js";import{L as w}from"./app-DM6WPmnv.js";import{_ as y}from"./app-DezwSKU9.js";import{_ as C}from"./app-Z_-2XiXN.js";import{_ as $}from"./app-Dum_NU1V.js";import{_ as m}from"./app-KcnMuQGX.js";import"./app-C9iVkiu5.js";import"./app-DrIi-dNq.js";import"./app-zueB50zj.js";import"./app-B0NrURRk.js";import"./app-Co2SIBzr.js";import"./app-CUPmXIij.js";import"./app-Cu6FD8m8.js";import"./app-uFawAv7F.js";import"./app-BJhJ7lM8.js";import"./app-Dd07dUxy.js";import"./app-CYYQ_Zep.js";import"./app-Dpl5YSiv.js";import"./app-CF8nmC-F.js";import"./app-NVAx7Sc3.js";import"./app-CF0qXH5Q.js";import"./app-xECxwo4T.js";import"./app-BtWF1kMA.js";import"./app-CGj1gg44.js";import"./app-B4bUdtyo.js";import"./app-BeuOvIof.js";import"./app-DSjO_8RR.js";import"./app-CZGZgDLc.js";import"./app-R-vSvFIF.js";import"./app-HaDoyrq5.js";import"./app-Cmxxk_WX.js";import"./app-B09rlSqG.js";import"./app-LqsmzyUT.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};
