import{_ as e}from"./index.js?v=1763625242172";import{_ as t}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{_ as a}from"./public.js?v=1763625242172";import{u as s,c as i,m as r,x as l,o as n}from"./page_layout.js?v=1763625242172";import{d as o}from"./php.js?v=1763625242172";import{s as p}from"./file.js?v=1763625242172";import{bd as u,be as m}from"./site.js?v=1763625242172";import{u as _}from"./index238.js?v=1763625242172";import{u as d}from"./index235.js?v=1763625242172";import{k as c,P as v,a0 as f,r as j,e as x,o as g,R as h,S as w,X as y,a3 as C,U as S,V as b,aj as k,a4 as $,j as U,N as R}from"./vue.js?v=1763625242172";import P from"./index100.js?v=1763625242172";import{em as N,dV as T,d9 as V,aC as q,au as E,dP as H}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./index245.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang5.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang12.js?v=1763625242172";import"./index99.js?v=1763625242172";import"./index107.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang10.js?v=1763625242172";import"./index98.js?v=1763625242172";import"./index132.js?v=1763625242172";import"./refersh.js?v=1763625242172";import"./form.vue_vue_type_script_setup_true_lang2.js?v=1763625242172";import"./index104.js?v=1763625242172";import"./logs.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import"./ssl.js?v=1763625242172";import"./cert.js?v=1763625242172";import"./ssl-lets-progress.js?v=1763625242172";import"./utils3.js?v=1763625242172";import"./index217.js?v=1763625242172";import"./paypal-js.js?v=1763625242172";import"./upload.js?v=1763625242172";import"./soft.js?v=1763625242172";import"./git-ps.js?v=1763625242172";import"./theme-monokai.js?v=1763625242172";const X={class:"w-160px"},z={class:"w-380px px-20px pt-24px pb-8px"},A={class:"w-180px"},B=c({__name:"index",setup(c,{expose:B}){const{t:D}=v(),{data:F}=d(),G=_(),{multiService:I}=f(s()),J=j(null),K=j(null),L=j([]),M=j(""),O=j();let Q="";const W=e=>{var t;M.value=Y(e),null==(t=J.value)||t.getContent()},Y=e=>{const t=I.value?O.value:G.webserver;if("0.Current"===e)return"apache"===t||"openlitespeed"===t?"".concat(Q,"/.htaccess"):"/www/server/panel/vhost/rewrite/".concat(F.name,".conf");return"/www/server/panel/rewrite/".concat("openlitespeed"===t?"apache":t,"/").concat(K.value,".conf")},Z=async()=>{const e=Y("0.Current"),{message:t}=await p({path:e,data:se.data,encoding:"utf-8"});i(t)&&r.success(t.msg);const a=L.value[0].value;K.value=a,W(a)},ee=j(!1),te=()=>{ee.value=!0},ae=j(null),se=x({name:"",data:"",site_id:F.id}),ie={name:{required:!0,trigger:["blur","change"],message:D("Site.RulesError.index_21")}},re=async({hide:e})=>{var t;await(null==(t=ae.value)?void 0:t.validate()),await u(R(se)),se.name="",le(),e()},le=async()=>{var e;const{message:t}=await m({siteName:F.name});if(i(t)){Q=t.sitePath;const e=l(t.rewrite)?t.rewrite:[];L.value=N(e).map((e=>({label:e,value:e}))),e.length&&(K.value=e[0],M.value=Y(e[0]))}null==(e=J.value)||e.getContent()},ne=async()=>{(async()=>{const{message:e}=await o({site_id:F.id});i(e)&&(O.value=e.result)})(),le()};return g((()=>{ne()})),B({init:ne}),(s,i)=>{const r=T,l=n,o=V,p=q,u=a,m=E,_=H,d=t,c=e;return h(),w("div",null,[y(o,{class:"items-center mb-12px"},{default:C((()=>[S("div",X,[y(r,{value:b(K),"onUpdate:value":[i[0]||(i[0]=e=>k(K)?K.value=e:null),W],options:b(L)},null,8,["value","options"])]),S("div",null,[S("span",null,$(s.$t("Site.Config.index_56"))+": ",1),y(l,{href:"https://winginx.com/en/htaccess",target:"_blank"},{default:C((()=>[U($(s.$t("Site.Cert.index_42")),1)])),_:1})])])),_:1}),y(P,{ref_key:"configRef",ref:J,path:b(M),"onUpdate:path":i[1]||(i[1]=e=>k(M)?M.value=e:null),value:b(se).data,"onUpdate:value":i[2]||(i[2]=e=>b(se).data=e),height:400,"show-tips":!1},null,8,["path","value"]),y(o,{class:"items-center mt-12px"},{default:C((()=>[y(p,{type:"primary",onClick:Z},{default:C((()=>[U($(s.$t("Site.Cert.index_60")),1)])),_:1}),y(p,{onClick:te},{default:C((()=>[U($(s.$t("Site.Cert.index_39")),1)])),_:1})])),_:1}),y(u,{class:"mt-24px"},{default:C((()=>[S("li",null,$(s.$t("Site.Config.index_57")),1),S("li",null,$(s.$t("Site.Config.index_52")),1),S("li",null,$(s.$t("Site.Config.index_58")),1)])),_:1}),y(c,{show:b(ee),"onUpdate:show":i[4]||(i[4]=e=>k(ee)?ee.value=e:null),title:"Save as rewrite template",footer:!0,onConfirm:re},{default:C((()=>[S("div",z,[y(d,{ref_key:"formRef",ref:ae,model:b(se),rules:ie},{default:C((()=>[y(_,{label:"Template name",path:"name"},{default:C((()=>[S("div",A,[y(m,{value:b(se).name,"onUpdate:value":i[3]||(i[3]=e=>b(se).name=e),placeholder:"Template name"},null,8,["value"])])])),_:1})])),_:1},8,["model"])])])),_:1},8,["show"])])}}});export{B as default};
