Files
yakpanel-core/YakPanel/static/vite/js/index-CZKfm1ga.js
2026-04-07 02:04:22 +05:30

2 lines
8.4 KiB
JavaScript

import{_ as I}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as Y}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{i as V,t as Q,l as Z,Q as H,m as J,C as K}from"./index-BTglIPU2.js?v=1773287522785";import{k as G,am as ee,r as B,c as te,$ as d,a8 as f,a9 as s,S as o,Z as q,ak as v,a0 as n,_ as u,j as C,R as oe,e as ae,l as j,v as F,aa as T}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{ae as ne,af as se}from"./mail-COTHIXbY.js?v=1773287522785";import{g as ie}from"./data-BVsViUMm.js?v=1773287522785";import{_ as le}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{g as re}from"./index-BsHsIKON.js?v=1773287522785";import{g as de}from"./ssl-Bm8jcneQ.js?v=1773287522785";import{u as ue}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{u as me}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{k as L,ad as pe,B as _e,a9 as ce,a1 as fe,a3 as ve,a4 as be,b as ye,_ as ge,a6 as he}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-C5hb-Th7.js?v=1773287522785";import"./useTableColumns-DDeyYvje.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const xe={key:0,class:"color-desc"},we={key:3,class:"color-desc"},ke=G({__name:"automatic",props:{domain:{}},setup(P,{expose:E}){const N=ee(),b=P,{table:w,columns:k}=me([{key:"type",title:"Type",width:50},{key:"record",title:"Record",width:120,ellipsis:{tooltip:!0}},{key:"value",title:"Value",ellipsis:{tooltip:!0}},{key:"priority",title:"MX priority",render:r=>r.priority!==-1?r.priority:"-",width:90},{key:"status",title:"Status",width:110}]),m=B(),p=te(()=>{var r;return(r=m.value)==null?void 0:r.support.includes("auto")}),D=()=>{N.push("/ssl_domain/domain")},{loading:h,setLoading:x}=ue();return E({getParseStatus:async()=>{const{message:r}=await de({domain:b.domain});if(V(r)&&(m.value=r,p.value))try{x(!0);const{message:i}=await re({domain:b.domain,hash:r.hash});V(i)&&(w.data=[{type:"A",record:i.A.record,value:i.A.record_value,priority:i.A.priority,status:i.A.status?"Added":"Waiting to add"},{type:"MX",record:i.MX.record,value:i.MX.record_value,priority:i.MX.priority,status:i.MX.status?"Added":"Waiting to add"},...i.TXT.map(_=>({type:"TXT",record:_.record,value:_.record_value,priority:_.priority,status:_.status?"Added":"Waiting to add"}))])}finally{x(!1)}},parseStatus:m,isSupportAuto:p}),(r,i)=>{const _=_e,y=L,M=pe,R=ce,a=le;return d(),f(y,null,{default:s(()=>[o(m)?v("",!0):(d(),q("span",xe," *The program will use the APl to automatically add the required DNS records forthe mail server and complete the installation of the SSL certifcate. ")),o(m)?(d(),f(y,{key:1},{default:s(()=>[o(p)?(d(),f(M,{key:1,type:"success"},{default:s(()=>i[2]||(i[2]=[C(" Your domain has been connccted to the domain managementccnter, and you can use this fcature to complcte onc-click deployment. ")])),_:1,__:[2]})):(d(),f(M,{key:0,type:"error"},{default:s(()=>[n(y,{class:"items-center flex-nowrap!"},{default:s(()=>[i[1]||(i[1]=u("span",null,"Your domain has not yet been integrated with the Domain Name Management Center.",-1)),n(_,{type:"primary",size:"small",ghost:"",onClick:D},{default:s(()=>i[0]||(i[0]=[C("Add Now")])),_:1,__:[0]})]),_:1,__:[1]})]),_:1})),o(h)?(d(),f(y,{key:2,class:"items-center!"},{default:s(()=>[i[3]||(i[3]=u("span",{class:"color-desc"},"Checking for records to be added",-1)),n(R,{size:"small"})]),_:1,__:[3]})):v("",!0),!o(h)&&o(p)?(d(),q("span",we,"The records that will be automatically added")):v("",!0),!o(h)&&o(p)?(d(),f(a,{key:4,data:o(w).data,columns:o(k)},null,8,["data","columns"])):v("",!0)]),_:1})):v("",!0)]),_:1})}}}),De={class:"p-20px"},Me={class:"flex h-15px items-center mr-16px"},$e={class:"w-320px"},Se={class:"w-100px ml-20px"},Ae={class:"w-320px"},Be={class:"text-error"},He=G({__name:"index",props:{row:{},isEdit:{type:Boolean}},emits:["refresh"],setup(P,{expose:E,emit:N}){const b=P,w=N,k=Q(),m=B(null),p=B(""),D=()=>{var a;if(e.domain.trim()===""){p.value="";return}p.value!==e.domain&&e.dns_record===2&&((a=m.value)==null||a.getParseStatus(),p.value=e.domain)},{t:h}=oe(),x=B(null),e=ae({domain:"",a_record:"",dns_record:2,quota:5,quota_unit:"GB",mailboxes:50,email:"",ips:""}),r=[{label:"GB",value:"GB"},{label:"MB",value:"MB"}],i={domain:{trigger:["blur","input"],validator:()=>e.domain.trim()===""?new Error(h("Mail.Domain.index_27")):!0}},_=()=>{H({source:351})},y=()=>{var a,t;return{domain:e.domain,a_record:e.a_record,ips:b.isEdit&&!e.ips?"del":e.ips,quota:e.quota+" "+e.quota_unit,mailboxes:e.mailboxes,email:e.email,automatic:e.dns_record===2?1:null,hash:e.dns_record===2?(t=(a=m.value)==null?void 0:a.parseStatus)==null?void 0:t.hash:null}},M=async()=>{var t,g;if(await((t=x.value)==null?void 0:t.validate()),!((g=m.value)!=null&&g.isSupportAuto)&&e.dns_record===2&&!b.isEdit)return J.error("This domain does not support automatic resolution, please choose manual resolution"),!1;const{isEdit:a}=b;a?await ne(y()):await se(y()),w("refresh")};return(()=>{const{isEdit:a,row:t}=b;if(a&&t){const g=t.ip_address.ipv4.join(""),$=t.ip_address.ipv6.join("");e.domain=t.domain,e.a_record=t.a_record,e.ips=g.length>0?g:$;const S=K(t.quota);e.quota=ie(S.split(" ")[0]),e.quota_unit=S.split(" ")[1],e.mailboxes=t.mailboxes,e.email=t.email,e.dns_record=1}})(),E({onConfirm:M}),(a,t)=>{const g=Z,$=be,S=ve,c=fe,A=ye,U=L,X=ge,z=he,O=Y,W=I;return d(),q("div",De,[n(O,{ref_key:"formRef",ref:x,model:o(e),rules:i,"label-width":"150px"},{default:s(()=>[a.isEdit?v("",!0):(d(),f(c,{key:0,label:"DNS record"},{default:s(()=>[n(S,{value:o(e).dns_record,"onUpdate:value":[t[0]||(t[0]=l=>o(e).dns_record=l),D]},{default:s(()=>[n($,{value:2},{default:s(()=>[u("div",Me,[t[8]||(t[8]=u("div",null,"Automatic",-1)),n(g,{name:"ssl-stars",size:22})])]),_:1}),n($,{value:1},{default:s(()=>t[9]||(t[9]=[C("Manual")])),_:1,__:[9]})]),_:1},8,["value"])]),_:1})),n(c,{label:a.$t("Mail.Domain.index_3"),path:"domain"},{default:s(()=>[u("div",$e,[n(A,{value:o(e).domain,"onUpdate:value":t[1]||(t[1]=l=>o(e).domain=l),disabled:a.isEdit,placeholder:a.$t("Mail.Domain.index_18"),onBlur:D},null,8,["value","disabled","placeholder"])])]),_:1},8,["label"]),j(n(c,{label:a.$t("Mail.Domain.index_19")},{default:s(()=>[n(U,null,{default:s(()=>[n(A,{class:"w-320px!",value:o(e).a_record,"onUpdate:value":t[2]||(t[2]=l=>o(e).a_record=l),disabled:a.isEdit,placeholder:a.$t("Mail.Domain.index_20")},null,8,["value","disabled","placeholder"]),t[10]||(t[10]=u("span",{class:"text-font2"}," *Resolve the domain to the mail server's lP address for server communication ormail client connections. ",-1))]),_:1,__:[10]})]),_:1},8,["label"]),[[F,o(e).dns_record===1]]),j(n(c,{label:" "},{default:s(()=>[n(ke,{ref_key:"automaticRef",ref:m,domain:o(e).domain},null,8,["domain"])]),_:1},512),[[F,o(e).dns_record===2]]),a.isEdit?(d(),f(c,{key:1,label:"IP"},{default:s(()=>[n(U,{class:"items-center"},{default:s(()=>[n(A,{class:"w-320px!",value:o(e).ips,"onUpdate:value":t[3]||(t[3]=l=>o(e).ips=l),disabled:o(k).isFree,placeholder:a.$t("Mail.Domain.index_65")},null,8,["value","disabled","placeholder"]),o(k).isFree?(d(),q("span",{key:0,class:"cursor-pointer color-#ffb800",onClick:_}," PRO ")):v("",!0)]),_:1})]),_:1})):v("",!0),n(c,{label:a.$t("Mail.Domain.index_21")},{default:s(()=>[n(X,{value:o(e).quota,"onUpdate:value":t[4]||(t[4]=l=>o(e).quota=l),class:"w-200px",min:0,"show-button":!1},null,8,["value"]),u("div",Se,[n(z,{value:o(e).quota_unit,"onUpdate:value":t[5]||(t[5]=l=>o(e).quota_unit=l),options:r},null,8,["value"])])]),_:1},8,["label"]),n(c,{label:a.$t("Mail.Domain.index_22")},{default:s(()=>[n(X,{value:o(e).mailboxes,"onUpdate:value":t[6]||(t[6]=l=>o(e).mailboxes=l),class:"w-320px",min:0,"show-button":!1},null,8,["value"])]),_:1},8,["label"]),n(c,{label:a.$t("Mail.Domain.index_7")},{default:s(()=>[u("div",Ae,[n(A,{value:o(e).email,"onUpdate:value":t[7]||(t[7]=l=>o(e).email=l),placeholder:a.$t("Mail.Domain.index_23")},null,8,["value","placeholder"])])]),_:1},8,["label"])]),_:1},8,["model"]),n(W,null,{default:s(()=>[u("li",Be,T(a.$t("Mail.Domain.index_24")),1),u("li",null,T(a.$t("Mail.Domain.index_25")),1),u("li",null,T(a.$t("Mail.Domain.index_26")),1)]),_:1})])}}});export{He as default};