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-SC54XQDl.js";import{i as g,c as x}from"./app-Ba7ZqSpq.js";import{_ as w}from"./app-DZcB_Zcx.js";import{L as C}from"./app-Crd12MWL.js";import{_ as d}from"./app-CWnUJ4gg.js";import{N as h}from"./app-B2C_dtYI.js";import{N}from"./app-CL60OiIv.js";import{_ as T}from"./app-D9UgVOV0.js";import"./app-DHsI_tns.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-PPG0ZS4d.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-DnXuoh8P.js";import"./app-CCkWSX4Q.js";import"./app-C8HFiBxn.js";import"./app-BjSCO7rC.js";import"./app-g-bJrEAS.js";import"./app-DZaelcLs.js";import"./app-D_RBJHM6.js";import"./app-CmrRgGIA.js";import"./app-DyP4Nide.js";import"./app-COidJXl1.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";import"./app-Dhl-Bw0H.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app--Lj8zATS.js";import"./app-C2mBgI5Z.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};
