import{u as e,_ as t}from"./index233.js?v=1753954525509";import{_ as a}from"./index.js?v=1753954525509";import{_ as s}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{_ as n}from"./public.js?v=1753954525509";import{d5 as i,b0 as l,c as r,m as o,w as u,o as p}from"./page_layout.js?v=1753954525509";import{s as _}from"./file2.js?v=1753954525509";import{bd as d,be as m}from"./site.js?v=1753954525509";import{_ as c}from"./index.vue_vue_type_script_setup_true_lang14.js?v=1753954525509";import{d6 as v,cG as f,bY as x,ay as g,aq as j,cA as h}from"./naive.js?v=1753954525509";import{k as w,P as y,r as C,e as b,o as $,U as k,a1 as S,a2 as N,W as U,j as R,a3 as q,Q as D,X as M,ah as P,N as T}from"./vue.js?v=1753954525509";import"./index237.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang11.js?v=1753954525509";import"./index100.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang9.js?v=1753954525509";import"./index96.js?v=1753954525509";import"./index255.js?v=1753954525509";import"./new.js?v=1753954525509";import"./index127.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang5.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1753954525509";import"./soft.js?v=1753954525509";import"./index101.js?v=1753954525509";import"./index102.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./theme-chrome.js?v=1753954525509";const A={class:"w-160px"},E={class:"w-380px px-20px pt-24px pb-8px"},G={class:"w-180px"},H=w({__name:"index",setup(w,{expose:H}){const Q=i(),{t:W}=y(),{data:X}=e(),Y=l(),z=C(null),B=C(null),F=C([]),I=C(""),J=()=>{Q.activeMenu="mapping"};let K="";const L=e=>{var t;I.value=O(e),null==(t=z.value)||t.getContent()},O=e=>{const{webserver:t}=Y;if("0.Current"===e)return"apache"===t||"openlitespeed"===t?"".concat(K,"/.htaccess"):"/www/server/panel/vhost/rewrite/node_".concat(X.name,".conf");return"/www/server/panel/rewrite/".concat("openlitespeed"===t?"apache":t,"/node_").concat(B.value,".conf")},V=async()=>{const e=O("0.Current"),{message:t}=await _({path:e,data:ae.data,encoding:"utf-8"});r(t)&&o.success(t.msg);const a=F.value[0].value;B.value=a,L(a)},Z=C(!1),ee=()=>{Z.value=!0},te=C(null),ae=b({name:"",data:""}),se={name:{required:!0,trigger:["blur","change"],message:W("Site.RulesError.index_21")}},ne=async({hide:e})=>{var t;await(null==(t=te.value)?void 0:t.validate()),await d(T(ae)),ae.name="",ie(),e()},ie=async()=>{var e;const{message:t}=await m({siteName:"node_".concat(X.name)});if(r(t)){K=t.sitePath;const e=u(t.rewrite)?t.rewrite:[];F.value=v(e).map((e=>({label:e,value:e}))),e.length&&(B.value=e[0],I.value=O(e[0]))}null==(e=z.value)||e.getContent()},le=async()=>{await Q.getConfig(),ie()};return $((()=>{le()})),H({init:le}),(e,i)=>{const l=p,r=f,o=x,u=g,_=n,d=j,m=h,v=s,w=a,y=t;return k(),S(y,{active:M(Q).isMapping},{desc:N((()=>[U("span",null,[R(q(e.$t("Node.index_55"))+" ",1),D(l,{onClick:J},{default:N((()=>[R(q(e.$t("Node.index_42")),1)])),_:1}),R(" "+q(e.$t("Node.index_56")),1)])])),default:N((()=>[U("div",null,[D(o,{class:"items-center mb-12px"},{default:N((()=>[U("div",A,[D(r,{value:M(B),"onUpdate:value":[i[0]||(i[0]=e=>P(B)?B.value=e:null),L],options:M(F)},null,8,["value","options"])]),U("div",null,[U("span",null,q(e.$t("Site.Config.index_56"))+": ",1),D(l,{href:"https://winginx.com/en/htaccess",target:"_blank"},{default:N((()=>[R(q(e.$t("Site.Cert.index_42")),1)])),_:1})])])),_:1}),D(c,{ref_key:"configRef",ref:z,path:M(I),"onUpdate:path":i[1]||(i[1]=e=>P(I)?I.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(o,{class:"items-center mt-12px"},{default:N((()=>[D(u,{type:"primary",onClick:V},{default:N((()=>[R(q(e.$t("Site.Cert.index_60")),1)])),_:1}),D(u,{onClick:ee},{default:N((()=>[R(q(e.$t("Site.Cert.index_39")),1)])),_:1})])),_:1}),D(_,{class:"mt-24px"},{default:N((()=>[U("li",null,q(e.$t("Site.Config.index_57")),1),U("li",null,q(e.$t("Site.Config.index_52")),1),U("li",null,q(e.$t("Site.Config.index_58")),1)])),_:1}),D(w,{show:M(Z),"onUpdate:show":i[4]||(i[4]=e=>P(Z)?Z.value=e:null),title:e.$t("Node.index_54"),footer:!0,onConfirm:ne},{default:N((()=>[U("div",E,[D(v,{ref_key:"formRef",ref:te,model:M(ae),rules:se},{default:N((()=>[D(m,{label:e.$t("Docker.Template.index_4"),path:"name"},{default:N((()=>[U("div",G,[D(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{H as default};
