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-SC54XQDl.js";import{i as C,c as x}from"./app-Ba7ZqSpq.js";import{_ as v}from"./app-C3PbGMub.js";import{T}from"./app-C28obFWS.js";import{W as O}from"./app-B9xxzP2y.js";import{_ as S}from"./app-DQPrVsq2.js";import{_ as $}from"./app-DZcB_Zcx.js";import{L,s as m}from"./app-Crd12MWL.js";import{T as g}from"./app-DoVkxbmA.js";import{_ as V}from"./app-D9UgVOV0.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-CkINxBL9.js";import"./app-PPG0ZS4d.js";import"./app--Lj8zATS.js";import"./app-Ch8j4za4.js";import"./app-C2mBgI5Z.js";import"./app-DHsI_tns.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-DgoEZtNT.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";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};
