import{b as S,o as h}from"./ssl-Bm8jcneQ.js?v=1773287522785";import{a3 as i,i as k,l as x}from"./index-BTglIPU2.js?v=1773287522785";import{_ as y}from"./index-S15tYq5l.js?v=1773287522785";import{r as o,a0 as n,j as A,F as L}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{o as C,a5 as N,k as b,ab as w,a9 as D}from"./naive-ui--dJnpVcV.js?v=1773287522785";const X=o("manage"),V=o(!1),u=o([]),v=o([]),r=o(),d=o(""),g=o(""),_=o(!1),z=o(""),E=o(!1),H=[{label:"A",value:"A"},{label:"AAAA",value:"AAAA"},{label:"MX",value:"MX"},{label:"TXT",value:"TXT"},{label:"NS",value:"NS"},{label:"CAA",value:"CAA"},{label:"CNAME",value:"CNAME"}],P=async()=>{try{_.value=!0;const{message:a}=await S({p:1,limit:9999});if(k(a)){const s=a.data.find(l=>l.name==="YakPanelDns");s&&(a.data.splice(a.data.indexOf(s),1),a.data.unshift(s)),a.data.length>0?(u.value=a.data.map(l=>({label:l.name,value:l.id,alias:l.alias})),r.value||(r.value=u.value[0].value),d.value||(d.value=u.value[0].label),u.value.some(l=>l.value===r.value)||(r.value=u.value[0].value,d.value=u.value[0].label)):(u.value=[],r.value=void 0,d.value="")}}finally{_.value=!1}},$=async()=>{try{_.value=!0;const{message:a}=await h({p:1,limit:9999,id:r.value});k(a)&&(a.data.length>0?(v.value=a.data.map(s=>({label:s.name,value:s.name,ssl_info:s.ssl_info.end_time,dns_resolve:s.dns_resolve})),g.value||(g.value=v.value[0].value)):(v.value=[],g.value=""))}finally{_.value=!1}},I=a=>({key:"provider",title:i.global.t("SSL.Domain.index_28"),render:l=>{const t=l.task&&l.task.some(e=>e.task_status!==100);return n(b,null,{default:()=>[n("span",null,[l.name||l.provider]),t?n(N,{trigger:"hover"},{trigger:()=>n(D,{size:"small"},null),default:()=>n(L,null,[l.task.map(e=>n("div",{class:"flex flex-nowrap! p-10px cursor-pointer justify-between items-center",title:i.global.t("SSL.Domain.index_33"),key:e.id,onClick:()=>{a(e.task_log)}},[n("span",{class:"whitespace-nowrap mr-10px"},[e.task_name]),n(b,{class:"items-center flex-nowrap!"},{default:()=>[n(w,{class:"w-120px!",type:"line",status:"success",percentage:e.task_status,"indicator-placement":"inside",processing:e.task_status!==100},null),n(x,{name:"base-left-logs",size:18},null)]})]))])}):""]})}}),q=a=>({key:"ps",title:i.global.t("SSL.Domain.index_29"),render:l=>{var c,p,f;const t=l.user_for;if(!t)return"--";const e=(m="site")=>{a(l,m)};return Object.keys(t).map(m=>t[m]).every(m=>m.length===0)?n("span",{class:"bt-link",onClick:()=>e()},[i.global.t("SSL.Domain.index_30")]):n(y,{options:[{label:i.global.t("Layout.Sider.site_1"),onClick:()=>e("site"),show:((c=t.sites)==null?void 0:c.length)>0},{label:i.global.t("SSL.Domain.index_31"),onClick:()=>e("mail"),show:((p=t.mails)==null?void 0:p.length)>0},{label:i.global.t("SSL.Domain.index_32"),onClick:()=>e("panel"),show:((f=t.panel)==null?void 0:f.length)>0}]},null)}}),B=a=>{const{key:s="end_time"}=a;return{key:s,title:a.title,width:a.width,render:t=>{const e=s.split(".").reduce((c,p)=>c&&c[p],t);return e===-1||e===void 0?"--":n(C,{type:Number(e)>30?"success":Number(e)>0?"warning":"error",class:"px-10px"},{default:()=>[Number(e)?Number(e):i.global.t("Config.Safe.index_166"),A(" "),i.global.t("Crontab.arrange.index_41")]})}}};export{d as a,u as b,E as c,v as d,g as e,z as f,V as g,r as h,$ as i,P as j,q as k,_ as l,X as m,I as r,H as t,B as u};
