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