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-BYcXwl4U.js";import{i as C,c as x}from"./app-a6cKceqE.js";import{_ as v}from"./app-CFMgPhMX.js";import{T}from"./app-CO4sV-Ic.js";import{W as O}from"./app-D7QVa3_6.js";import{_ as S}from"./app-CA_jYvKY.js";import{_ as $}from"./app-BsFusN7_.js";import{L,s as m}from"./app-W_y7sflh.js";import{T as g}from"./app-D2Wz0BUQ.js";import{_ as V}from"./app-uhTxLRnQ.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-yt37eDzA.js";import"./app-BG60hdvp.js";import"./app-BQ5ggxk2.js";import"./app-SxAW7vhf.js";import"./app-D3zbrzdO.js";import"./app-CJCAnMrx.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-CNARLpXE.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";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};
