import{_ as e}from"./public.js?v=1764233927359";import{u as t,o as s,d as a,m as i,x as r}from"./page_layout.js?v=1764233927359";import{u as p}from"./index238.js?v=1764233927359";import{s as l}from"./file.js?v=1764233927359";import{k as o,a0 as u,r as n,R as m,V as _,W as c,a3 as d,S as v,U as j,ak as f,j as x}from"./vue.js?v=1764233927359";import{u as g}from"./index235.js?v=1764233927359";import{d as y}from"./php.js?v=1764233927359";import h from"./index100.js?v=1764233927359";import{dV as w,da as b,aC as k,em as C}from"./naive.js?v=1764233927359";import"./common.js?v=1764233927359";import"./__commonjsHelpers__.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"./site.js?v=1764233927359";import"./index107.js?v=1764233927359";import"./index.vue_vue_type_script_setup_true_lang.js?v=1764233927359";import"./index.vue_vue_type_script_setup_true_lang10.js?v=1764233927359";import"./index98.js?v=1764233927359";import"./index.js?v=1764233927359";import"./index132.js?v=1764233927359";import"./refersh.js?v=1764233927359";import"./form.vue_vue_type_script_setup_true_lang2.js?v=1764233927359";import"./index104.js?v=1764233927359";import"./index84.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"./index130.js?v=1764233927359";import"./soft.js?v=1764233927359";import"./soft2.js?v=1764233927359";import"./useOperate.js?v=1764233927359";import"./useModal2.js?v=1764233927359";import"./index.vue_vue_type_script_setup_true_lang15.js?v=1764233927359";import"./logs.vue_vue_type_script_setup_true_lang.js?v=1764233927359";import"./ssl.js?v=1764233927359";import"./cert.js?v=1764233927359";import"./ssl-lets-progress.js?v=1764233927359";import"./utils3.js?v=1764233927359";import"./index217.js?v=1764233927359";import"./paypal-js.js?v=1764233927359";import"./upload.js?v=1764233927359";import"./git-ps.js?v=1764233927359";import"./theme-monokai.js?v=1764233927359";const U={class:"p-20px"},R={class:"w-160px"},S=o({__name:"rewrite",props:{fileContent:{default:""},filename:{default:""},rlist:{default:()=>[]}},emits:["close"],setup(o,{emit:S}){const V=o,A=S,{data:H}=g(),{filename:I,rlist:M,fileContent:N}=V,O=p(),{multiService:P}=u(t()),W=n(null),Y=n(null),q=n([]),z=n(""),B=n(N),D=n(),E=e=>{if("0.default"===e||"0.Current"===e)return I;{const e=P.value?D.value:O.webserver;return"/www/server/panel/rewrite/".concat("openlitespeed"===e?"apache":e,"/").concat(Y.value,".conf")}},F=async()=>{const{message:e}=await l({path:I,data:B.value,encoding:"utf-8"});a(e)&&i.success(e.msg),A("close")},G=e=>{var t;z.value=E(e),null==(t=W.value)||t.getContent()};return(async()=>{await(async()=>{const{message:e}=await y({site_id:H.id});a(e)&&(D.value=e.result)})();const e=r(M)?M:[];q.value=C(e).map(e=>({label:e,value:e})),e.length&&(Y.value=e[0],z.value=E(e[0]))})(),(t,a)=>{const i=w,r=s,p=b,l=k,o=e;return _(),m("div",U,[c(p,{class:"items-center mb-12px"},{default:d(()=>[v("div",R,[c(i,{value:j(Y),"onUpdate:value":[a[0]||(a[0]=e=>f(Y)?Y.value=e:null),G],options:j(q)},null,8,["value","options"])]),v("div",null,[a[4]||(a[4]=v("span",null,"Rewrite rule converter: ",-1)),c(r,{href:"https://winginx.com/en/htaccess",target:"_blank"},{default:d(()=>a[3]||(a[3]=[x("Apache to Nginx",-1)])),_:1,__:[3]})])]),_:1}),c(h,{ref_key:"configRef",ref:W,path:j(z),"onUpdate:path":a[1]||(a[1]=e=>f(z)?z.value=e:null),value:j(B),"onUpdate:value":a[2]||(a[2]=e=>f(B)?B.value=e:null),height:350,"show-tips":!1},null,8,["path","value"]),c(p,{class:"items-center mt-12px"},{default:d(()=>[c(l,{type:"primary",onClick:F},{default:d(()=>a[5]||(a[5]=[x("Save",-1)])),_:1,__:[5]})]),_:1}),c(o,{class:"mt-24px"},{default:d(()=>a[6]||(a[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};
