System.register(["./index-legacy.js?v=1763625242172","./public-legacy.js?v=1763625242172","./page_layout-legacy.js?v=1763625242172","./mail-legacy.js?v=1763625242172","./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1763625242172","./vue-legacy.js?v=1763625242172","./naive-legacy.js?v=1763625242172","./index-legacy104.js?v=1763625242172","./common-legacy.js?v=1763625242172","./__commonjsHelpers__-legacy.js?v=1763625242172"],(function(e,t){"use strict";var a,l,s,n,i,o,c,r,d,u,m,_,p,g,h,y,x,f,v,w,b,S,j,k,M,P,R,C,$,B,U,z,E,H,N,O;return{setters:[e=>{a=e._,l=e.a},e=>{s=e._,n=e.k,i=e.c,o=e.e,c=e.a,r=e.d,d=e.h},e=>{u=e.c,m=e.m},e=>{_=e.ak,p=e.al,g=e.am,h=e.an,y=e.ao},e=>{x=e._},e=>{f=e.k,v=e.P,w=e.r,b=e.e,S=e.R,j=e.S,k=e.X,M=e.a3,P=e.U,R=e.V,C=e.a4,$=e.N,B=e.am,U=e.a2,z=e.j},e=>{E=e.au,H=e.dP,N=e.aC},e=>{O=e._},null,null],execute:function(){const t={class:"p-20px"},V={class:"w-260px"},q=f({__name:"hostname",emits:["refresh"],setup(e,{expose:a,emit:l}){const n=l,{t:i}=v(),o=w(null),c=b({hostname:""}),r={hostname:{trigger:["input","blur"],validator:()=>""!==c.hostname.trim()||new Error(i("Mail.Setting.index_50"))}};return a({onConfirm:async()=>{await(o.value?.validate()),await _($(c)),n("refresh")}}),(e,a)=>{const l=E,n=H,i=x,d=s;return S(),j("div",t,[k(i,{ref_key:"formRef",ref:o,model:R(c),rules:r},{default:M((()=>[k(n,{label:e.$t("Mail.Setting.index_48"),path:"hostname"},{default:M((()=>[P("div",V,[k(l,{value:R(c).hostname,"onUpdate:value":a[0]||(a[0]=e=>R(c).hostname=e)},null,8,["value"])])])),_:1},8,["label"])])),_:1},8,["model"]),k(d,{class:"mt-8px"},{default:M((()=>[P("li",null,C(e.$t("Mail.Setting.index_49")),1)])),_:1})])}}}),A=f({__name:"log",emits:["close","close-env"],setup(e,{emit:t}){const a=t,{t:l}=v(),s=w(l("Mail.Setting.index_47")),i=async()=>{const{message:e}=await p();u(e)&&(s.value=e.result||l("Mail.Setting.index_47"))},{loop:o}=n((async()=>{await i()}),1),c=B();return(async()=>{(async()=>{await g(),a("close"),a("close-env"),c.push("/mail/domain")})(),await i(),o()})(),(e,t)=>{const a=O;return S(),U(a,{log:R(s)},null,8,["log"])}}}),D={class:"flex flex-col h-full overflow-hidden"},L={class:"flex-1 p-20px overflow-auto"};e("default",f({__name:"index",emits:["close"],setup(e,{emit:t}){const n=t,{t:_}=v(),p=["Redis-install","Redis-Passwd","SElinux"],{table:g,columns:x}=i([{key:"env",title:_("Mail.Setting.index_39"),width:150},{key:"details",title:_("Mail.Setting.index_40"),ellipsis:{tooltip:!0},render:e=>{let t="";const{env:a,status:l,details:s}=e,n=p.includes(a);return t=s&&n?l?"Ready":s:l?"Ready":""!=s?s:"Abnormity",k("span",{class:l?"text-primary":"text-error"},[t])}},{key:"action",title:_("Public.Table.Operation"),width:120,render:e=>{const{env:t,status:a,details:l}=e;return p.includes(t)||!l||a?_("Mail.Setting.index_41"):k("a",{class:"bt-link",href:"javascript:;",onClick:()=>{"HostName"===e.env?w(e):b(e)}},[_("Public.Btn.Repair")])}}]),f=o(_("Mail.Setting.index_42"),{onRefresh:()=>{U()}}),w=e=>{f.data.row=e,f.show=!0},b=e=>{c({title:_("Mail.Setting.index_43"),content:_("Mail.Setting.index_44"),onConfirm:async()=>{const{env:t}=e;let a="";switch(t){case"Postfix-Version":case"Postfix-install":case"Sqlite-support":a="repair_postfix";break;case"Rspamd-install":a="install_rspamd";break;case"Dovecot-install":a="repair_dovecot"}await h(t,a),U()}})},{loading:$,setLoading:B}=r(),U=async()=>{try{B(!0);const{message:e}=await y();u(e)&&(g.data=Object.entries(e).map((([e,t])=>({env:e,details:t.msg,status:t.status}))))}finally{B(!1)}},E=()=>{n("close")},H=o(_("Mail.Setting.index_45"),{onCloseEnv:()=>{E()}}),O=async()=>{g.data.every((e=>e.status))?H.show=!0:m.error(_("Mail.Setting.index_46"))};return U(),(e,t)=>{const n=d,i=s,o=a,c=N,r=l;return S(),j("div",D,[P("div",L,[k(n,{"max-height":364,"single-line":!1,loading:R($),data:R(g).data,columns:R(x)},null,8,["loading","data","columns"]),k(i,{class:"mt-20px"},{default:M((()=>[P("li",null,C(e.$t("Mail.Setting.index_38")),1)])),_:1}),k(o,{show:R(f).show,"onUpdate:show":t[0]||(t[0]=e=>R(f).show=e),title:R(f).title,data:R(f).data,width:500,footer:!0,component:q},null,8,["show","title","data"]),k(o,{show:R(H).show,"onUpdate:show":t[1]||(t[1]=e=>R(H).show=e),title:R(H).title,data:R(H).data,"hide-close":!0,width:700,height:490,component:A},null,8,["show","title","data"])]),k(r,null,{default:M((()=>[k(c,{class:"cancel-btn",color:"#cbcbcb",size:"small",onClick:E},{default:M((()=>[z(C(e.$t("Public.Btn.Cancel")),1)])),_:1}),k(c,{type:"primary",size:"small",onClick:U},{default:M((()=>[z(C(e.$t("Public.Btn.Refresh")),1)])),_:1}),k(c,{type:"primary",size:"small",onClick:O},{default:M((()=>[z(C(e.$t("Public.Btn.Submit")),1)])),_:1})])),_:1})])}}}))}}}));
