import{o as t,g as a,b as c,u as s,c as l,w as r,h as i,F as y,f as d,a as f,t as p,n as P,D as k,i as b}from"./app-DA7OTM4Q.js";import{i as C,c as x}from"./app-BT68AfZ-.js";import{_ as v}from"./app-DjCTC_pp.js";import{T}from"./app-up4gT9D9.js";import{W as O}from"./app-D6fSNcLx.js";import{_ as S}from"./app-6bUvi0wa.js";import{_ as $}from"./app-D21nXKzm.js";import{L,s as m}from"./app-CjSxNKvA.js";import{T as g}from"./app-BkWUIifj.js";import{_ as V}from"./app-BWsCS5pa.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-D29bbm9n.js";import"./app-Dxa5h-uG.js";import"./app-B_5dka6q.js";import"./app-BqY8p2gl.js";import"./app-CQwVTjAx.js";import"./app-z_TsLOhk.js";import"./app-C5ROEzFd.js";import"./app-Bnbo6OlJ.js";import"./app-AbPAjGV5.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";function E(){const{utils:h,Tea:o}=C(this);this.deleteServer=function(u){let _=this;h.confirm("确定要删除此网站吗？",function(){_.$post(".delete").params({serverId:u}).refresh()})},this.updateServerOn=function(u){let _=this;h.confirm("确定要启用此网站吗？",function(){_.$post(".updateOn").params({serverId:u,isOn:!0}).refresh()})},this.updateServerOff=function(u){let _=this;h.confirm("确定要停用此网站吗？",function(){_.$post(".updateOn").params({serverId:u,isOn:!1}).refresh()})}}const I=f("a",{href:"/finance/bills?paidFlag=0"},"有逾期未支付的账单，可能会影响你的CDN服务正常运行，请尽快完成支付。",-1),N={key:3},B=["href"],D={key:0},U={key:0},w={key:1},z={key:0,class:"label-group"},M={key:1,class:"disabled"},F={key:0,class:"label-group"},W={key:1,class:"disabled"},A={key:0,class:"label-group"},R={key:1,class:"disabled"},j={key:0,class:"grey"},q={key:1,class:"green"},G=["href"],H=["onClick"],J=["onClick"],K=f("span",{class:"red"},"启用",-1),Q=[K],X=["onClick"],Ne={__name:"index",setup(h){const o=x(new E);return(u,_)=>(t(),a(y,null,[c(v,{"active-tab":"index"}),s(o).serversIsEnabled?i("",!0):(t(),l(T,{key:0,error:""},{default:r(()=>[d(" 当前账号下的网站不可用，请检查账号状态以及是否有逾期未支付的账单。 ")]),_:1})),s(o).serversIsEnabled&&s(o).countUnpaidBills>0?(t(),l(O,{key:1},{default:r(()=>[I]),_:1})):i("",!0),s(o).servers.length==0?(t(),l(V,{key:2,"disable-spacing":""},{default:r(()=>[d("暂时还没有任何负载均衡服务。")]),_:1})):i("",!0),s(o).servers.length>0?(t(),a("div",N,[c(L,{items:s(o).servers},{default:r(()=>[c(s(m),{header:"网站名称",class:"name-column",frozen:""},{body:r(({data:e})=>[f("a",{href:"/lb/server?serverId="+e.id},p(e.name),9,B),e.userPlan!=null&&e.userPlan.id>0?(t(),a("div",D,[f("span",{style:{"margin-top":"1em"},class:P(["small",{grey:!e.userPlan.isExpired,red:e.userPlan.isExpired}])},[d("套餐："+p(e.userPlan.name)+" / "+p(e.userPlan.dayTo)+" ",1),e.userPlan.isExpired?(t(),a("span",U,"已过期")):i("",!0)],2)])):i("",!0),e.trafficLimitStatus!=null?(t(),a("div",w,[c(S,{modelValue:e.trafficLimitStatus,"onUpdate:modelValue":n=>e.trafficLimitStatus=n},null,8,["modelValue","onUpdate:modelValue"])])):i("",!0)]),_:1}),c(s(m),{header:"CNAME",class:"domain-column"},{body:r(({data:e})=>[d(p(e.cname),1)]),_:1}),s(o).supportTCP?(t(),l(s(m),{key:0,header:"TCP",class:"name-column"},{body:r(({data:e})=>[e.tcpPorts.length>0?(t(),a("div",z,[(t(!0),a(y,null,k(e.tcpPorts,n=>(t(),l(g,{outlined:""},{default:r(()=>[d(p(n),1)]),_:2},1024))),256))])):(t(),a("span",M,"-"))]),_:1})):i("",!0),s(o).supportTCP?(t(),l(s(m),{key:1,header:"TLS",class:"name-column"},{body:r(({data:e})=>[e.tlsPorts.length>0?(t(),a("div",F,[(t(!0),a(y,null,k(e.tlsPorts,n=>(t(),l(g,{outlined:""},{default:r(()=>[d(p(n),1)]),_:2},1024))),256))])):(t(),a("span",W,"-"))]),_:1})):i("",!0),s(o).supportUDP?(t(),l(s(m),{key:2,header:"UDP",class:"name-column"},{body:r(({data:e})=>[e.udpPorts.length>0?(t(),a("div",A,[(t(!0),a(y,null,k(e.udpPorts,n=>(t(),l(g,{outlined:""},{default:r(()=>[d(p(n),1)]),_:2},1024))),256))])):(t(),a("span",R,"-"))]),_:1})):i("",!0),c(s(m),{header:"状态",class:"status-column"},{body:r(({data:e})=>[e.isOn?(t(),a("span",q,"正常")):(t(),a("span",j,"停用中"))]),_:1}),c(s(m),{header:"操作",class:"three op",frozen:"","align-frozen":"right"},{body:r(({data:e})=>[f("a",{href:"/lb/server?serverId="+e.id},"管理",8,G),d("   "),e.isOn?(t(),a("a",{key:0,href:"",onClick:b(n=>s(o).updateServerOff(e.id),["prevent"])},"停用",8,H)):i("",!0),e.isOn?i("",!0):(t(),a("a",{key:1,href:"",onClick:b(n=>s(o).updateServerOn(e.id),["prevent"])},Q,8,J)),d("   "),f("a",{href:"",onClick:b(n=>s(o).deleteServer(e.id),["prevent"])},"删除",8,X)]),_:1})]),_:1},8,["items"]),c($,{data:s(o).page},null,8,["data"])])):i("",!0)],64))}};export{Ne as default};
