import{o as t,c as k,w as o,b as a,g as s,u as p,h as _,F as f,f as m,t as r,D as v,i as b,a as y}from"./app-BYcXwl4U.js";import{i as g,c as x}from"./app-a6cKceqE.js";import{_ as w}from"./app-BsFusN7_.js";import{L as C}from"./app-W_y7sflh.js";import{_ as d}from"./app-BqeukU67.js";import{N as h}from"./app-CabATHnR.js";import{N}from"./app-DCd54JMo.js";import{_ as T}from"./app-uhTxLRnQ.js";import"./app-CJCAnMrx.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-BG60hdvp.js";import"./app-CNARLpXE.js";import"./app-SxAW7vhf.js";import"./app-D5k1HLu9.js";import"./app-ysQ8KbGS.js";import"./app-BDgR0DSb.js";import"./app-Cc2zXvHs.js";import"./app-DPDEogA0.js";import"./app-aSafd0Me.js";import"./app-BHl80pFw.js";import"./app-Btbk6LWy.js";import"./app-CrkKi1Ag.js";import"./app-u5shTDG_.js";import"./app-BhzV4gWo.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.js";import"./app-DxjODhok.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BQ5ggxk2.js";import"./app-D3zbrzdO.js";function $(){const{utils:i,Tea:n}=g(this);this.renewUserInstance=function(c){i.popup(".renewPopup?userInstanceId="+c,{height:"26em",callback:function(){i.successRefresh("续期成功")}})},this.updateObjectsPopup=function(c){i.popup(".updateObjectsPopup?userInstanceId="+c,{width:"60em",height:"40em",callback:function(){i.successRefresh("保存成功")}})},this.deleteUserInstance=function(c){let u=this;i.confirm("确定要删除此实例吗？",function(){u.$post(".delete").params({userInstanceId:c}).success(function(){i.successRefresh("删除成功")})})}}const j={__name:"@menu",props:["activeTab"],setup(i){return(n,c)=>(t(),k(N,{"active-tab":i.activeTab},{tabs:o(()=>[a(h,{href:".",value:"index",name:"实例列表"}),a(h,{separator:""}),a(h,{href:"/anti-ddos/packages",name:"购买实例","action-cart":""})]),_:1},8,["active-tab"]))}},O=y("a",{href:"/anti-ddos/packages"},"[点此购买]",-1),P={key:1},z={key:0},A={key:1,class:"red"},B={key:0},I={key:1,class:"red"},R={key:0},U={key:0,class:"small red"},V=["onClick"],D={key:0},E={key:1},F={key:1,class:"disabled"},L={key:0},M=["href"],S={key:1,class:"disabled"},q=["onClick"],we={__name:"index",setup(i){const n=x(new $);return(c,u)=>(t(),s(f,null,[a(j,{"active-tab":"index"}),p(n).userInstances.length==0?(t(),k(T,{key:0,"disable-spacing":""},{default:o(()=>[m("暂时还没有实例，"),O,m(" 。 ")]),_:1})):_("",!0),p(n).userInstances.length>0?(t(),s("div",P,[a(C,{items:p(n).userInstances},{default:o(()=>[a(d,{header:"高防产品",frozen:"",class:"name-column"},{body:o(({data:e})=>[e.package.id>0?(t(),s("span",z,r(e.package.summary),1)):(t(),s("span",A,"已删除"))]),_:1}),a(d,{header:"高防IP",frozen:"",class:"ip-column"},{body:o(({data:e})=>[e.ipAddresses!=null&&e.ipAddresses.length>0?(t(),s("div",B,[(t(!0),s(f,null,v(e.ipAddresses,l=>(t(),s("div",null,r(l),1))),256))])):(t(),s("span",I,"无有效IP"))]),_:1}),a(d,{header:"有效期",class:"value-column"},{body:o(({data:e})=>[m(r(e.periodCount)+r(e.periodUnitName),1)]),_:1}),a(d,{header:"开始日期",class:"date-column"},{body:o(({data:e})=>[m(r(e.dayFrom),1)]),_:1}),a(d,{header:"结束日期",class:"date-column"},{body:o(({data:e})=>[m(r(e.dayTo)+" ",1),e.isExpired?(t(),s("div",R,[e.isExpired?(t(),s("span",U,"已过期")):_("",!0)])):_("",!0)]),_:1}),a(d,{header:"防护对象",class:"name-column"},{body:o(({data:e})=>[e.isAvailable?(t(),s("a",{key:0,href:"",onClick:b(l=>p(n).updateObjectsPopup(e.id),["prevent"])},[e.countObjects>0?(t(),s("span",D,r(e.countObjects)+"个对象",1)):(t(),s("span",E,"设置"))],8,V)):(t(),s("span",F,r(e.countObjects),1))]),_:1}),a(d,{header:"操作",class:"two op",frozen:"","align-frozen":"right"},{body:o(({data:e})=>[e.instance.userInstanceId==e.id?(t(),s("span",L,[y("a",{href:"/anti-ddos/instances/renew?userInstanceId="+e.id},"续费",8,M)])):(t(),s("span",S,"续费")),m("   "),e.canDelete?(t(),s("a",{key:2,href:"",onClick:b(l=>p(n).deleteUserInstance(e.id),["prevent"])},"删除",8,q)):_("",!0)]),_:1})]),_:1},8,["items"]),a(w,{data:p(n).page},null,8,["data"])])):_("",!0)],64))}};export{we as default};
