import{u as e,_ as t}from"./index242.js?v=1764830988434";import{_ as a}from"./index.js?v=1764830988434";import{_ as s}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764830988434";import{_ as n}from"./public.js?v=1764830988434";import{dr as i,aK as l,o,d as r,m as u,x as p}from"./page_layout.js?v=1764830988434";import{s as d}from"./file.js?v=1764830988434";import{be as _,bd as m}from"./site.js?v=1764830988434";import c from"./index98.js?v=1764830988434";import{da as v,dV as x,aC as f,dR as g,au as j,em as h}from"./naive.js?v=1764830988434";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 D,ak as M,a4 as P,j as T,N as V}from"./vue.js?v=1764830988434";import"./index246.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang5.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang9.js?v=1764830988434";import"./index97.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang10.js?v=1764830988434";import"./index96.js?v=1764830988434";import"./index264.js?v=1764830988434";import"./new.js?v=1764830988434";import"./index133.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang8.js?v=1764830988434";import"./soft.js?v=1764830988434";import"./index102.js?v=1764830988434";import"./index107.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";import"./theme-monokai.js?v=1764830988434";const q={class:"w-160px"},E={class:"w-380px px-20px pt-24px pb-8px"},H={class:"w-180px"},K=w({__name:"index",setup(w,{expose:K}){const W=i(),{t:z}=C(),{data:A}=e(),B=l(),F=y(null),G=y(null),I=y([]),J=y(""),L=()=>{W.activeMenu="mapping"};let O="";const Q=e=>{var t;J.value=X(e),null==(t=F.value)||t.getContent()},X=e=>{const{webserver:t}=B;if("0.Current"===e)return"apache"===t||"openlitespeed"===t?"".concat(O,"/.htaccess"):"/www/server/panel/vhost/rewrite/node_".concat(A.name,".conf");return"/www/server/panel/rewrite/".concat("openlitespeed"===t?"apache":t,"/node_").concat(G.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=I.value[0].value;G.value=a,Q(a)},Z=y(!1),ee=()=>{Z.value=!0},te=y(null),ae=$({name:"",data:"",site_id:A.id}),se={name:{required:!0,trigger:["blur","change"],message:z("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(A.name)});if(r(t)){O=t.sitePath;const e=p(t.rewrite)?t.rewrite:[];I.value=h(e).map(e=>({label:e,value:e})),e.length&&(G.value=e[0],J.value=X(e[0]))}null==(e=F.value)||e.getContent()},le=async()=>{await W.getConfig(),ie()};return b(()=>{le()}),K({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:D(W).isMapping},{desc:N(()=>[U("span",null,[T(P(e.$t("Node.index_55"))+" ",1),R(l,{onClick:L},{default:N(()=>[T(P(e.$t("Node.index_42")),1)]),_:1}),T(" "+P(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:D(G),"onUpdate:value":[i[0]||(i[0]=e=>M(G)?G.value=e:null),Q],options:D(I)},null,8,["value","options"])]),U("div",null,[U("span",null,P(e.$t("Site.Config.index_56"))+": ",1),R(l,{href:"https://winginx.com/en/htaccess",target:"_blank"},{default:N(()=>[T(P(e.$t("Site.Cert.index_42")),1)]),_:1})])]),_:1}),R(c,{ref_key:"configRef",ref:F,path:D(J),"onUpdate:path":i[1]||(i[1]=e=>M(J)?J.value=e:null),value:D(ae).data,"onUpdate:value":i[2]||(i[2]=e=>D(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(()=>[T(P(e.$t("Site.Cert.index_60")),1)]),_:1}),R(p,{onClick:ee},{default:N(()=>[T(P(e.$t("Site.Cert.index_39")),1)]),_:1})]),_:1}),R(d,{class:"mt-24px"},{default:N(()=>[U("li",null,P(e.$t("Site.Config.index_57")),1),U("li",null,P(e.$t("Site.Config.index_52")),1),U("li",null,P(e.$t("Site.Config.index_58")),1)]),_:1}),R(w,{show:D(Z),"onUpdate:show":i[4]||(i[4]=e=>M(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:D(ae),rules:se},{default:N(()=>[R(m,{label:e.$t("Docker.Template.index_4"),path:"name"},{default:N(()=>[U("div",H,[R(_,{value:D(ae).name,"onUpdate:value":i[3]||(i[3]=e=>D(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{K as default};
