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