import{_ as e}from"./public.js?v=1763625242172";import{u as t,c as s,m as a,o as i,x as r}from"./page_layout.js?v=1763625242172";import{u as l}from"./index238.js?v=1763625242172";import{s as o}from"./file.js?v=1763625242172";import{k as p,a0 as u,r as n,R as m,S as _,X as c,a3 as d,U as v,V as j,aj as f,j as x}from"./vue.js?v=1763625242172";import{u as g}from"./index235.js?v=1763625242172";import{d as h}from"./php.js?v=1763625242172";import y from"./index100.js?v=1763625242172";import{em as w,dV as b,d9 as C,aC as k}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"./site.js?v=1763625242172";import"./index107.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang10.js?v=1763625242172";import"./index98.js?v=1763625242172";import"./index.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 U={class:"p-20px"},R={class:"w-160px"},S=p({__name:"rewrite",props:{fileContent:{default:""},filename:{default:""},rlist:{default:()=>[]}},emits:["close"],setup(p,{emit:S}){const V=p,A=S,{data:H}=g(),{filename:I,rlist:N,fileContent:P}=V,X=l(),{multiService:Y}=u(t()),q=n(null),z=n(null),B=n([]),D=n(""),E=n(P),F=n(),G=e=>{if("0.default"===e||"0.Current"===e)return I;{const e=Y.value?F.value:X.webserver;return"/www/server/panel/rewrite/".concat("openlitespeed"===e?"apache":e,"/").concat(z.value,".conf")}},J=async()=>{const{message:e}=await o({path:I,data:E.value,encoding:"utf-8"});s(e)&&a.success(e.msg),A("close")},K=e=>{var t;D.value=G(e),null==(t=q.value)||t.getContent()};return(async()=>{await(async()=>{const{message:e}=await h({site_id:H.id});s(e)&&(F.value=e.result)})();const e=r(N)?N:[];B.value=w(e).map((e=>({label:e,value:e}))),e.length&&(z.value=e[0],D.value=G(e[0]))})(),(t,s)=>{const a=b,r=i,l=C,o=k,p=e;return m(),_("div",U,[c(l,{class:"items-center mb-12px"},{default:d((()=>[v("div",R,[c(a,{value:j(z),"onUpdate:value":[s[0]||(s[0]=e=>f(z)?z.value=e:null),K],options:j(B)},null,8,["value","options"])]),v("div",null,[s[4]||(s[4]=v("span",null,"Rewrite rule converter: ",-1)),c(r,{href:"https://winginx.com/en/htaccess",target:"_blank"},{default:d((()=>s[3]||(s[3]=[x("Apache to Nginx")]))),_:1,__:[3]})])])),_:1}),c(y,{ref_key:"configRef",ref:q,path:j(D),"onUpdate:path":s[1]||(s[1]=e=>f(D)?D.value=e:null),value:j(E),"onUpdate:value":s[2]||(s[2]=e=>f(E)?E.value=e:null),height:350,"show-tips":!1},null,8,["path","value"]),c(l,{class:"items-center mt-12px"},{default:d((()=>[c(o,{type:"primary",onClick:J},{default:d((()=>s[5]||(s[5]=[x("Save")]))),_:1,__:[5]})])),_:1}),c(p,{class:"mt-24px"},{default:d((()=>s[6]||(s[6]=[v("li",null,"Please select your application.",-1),v("li",null," If the site cannot be accessed after the rewrite rules set, please try to reset to default. ",-1),v("li",null,"You are able to modify rewrite rules, just save it after modification.",-1)]))),_:1,__:[6]})])}}});export{S as default};
