import{_ as e}from"./public.js?v=1753954525509";import{c as a,m as t,o as s,w as l}from"./page_layout.js?v=1753954525509";import{u as r}from"./index225.js?v=1753954525509";import{s as n}from"./file2.js?v=1753954525509";import{_ as o}from"./index.vue_vue_type_script_setup_true_lang14.js?v=1753954525509";import{d6 as u,cG as i,bY as p,ay as c}from"./naive.js?v=1753954525509";import{k as m,r as f,U as v,V as _,Q as d,a2 as h,W as w,X as j,ah as g,j as y}from"./vue.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./theme-chrome.js?v=1753954525509";const b={class:"p-20px"},x={class:"w-160px"},C=m({__name:"rewrite",props:{fileContent:{default:""},filename:{default:""},rlist:{default:()=>[]}},emits:["close"],setup(m,{emit:C}){const k=m,U=C,{filename:R,rlist:Y,fileContent:A}=k,G=r(),H=f(null),I=f(null),N=f([]),P=f(""),Q=f(A),S=e=>{if("0.default"===e||"0.Current"===e)return R;{const{webserver:e}=G;return"/www/server/panel/rewrite/".concat("openlitespeed"===e?"apache":e,"/").concat(I.value,".conf")}},T=async()=>{const{message:e}=await n({path:R,data:Q.value,encoding:"utf-8"});a(e)&&t.success(e.msg),U("close")},V=e=>{var a;P.value=S(e),null==(a=H.value)||a.getContent()};return(()=>{const e=l(Y)?Y:[];N.value=u(e).map((e=>({label:e,value:e}))),e.length&&(I.value=e[0],P.value=S(e[0]))})(),(a,t)=>{const l=i,r=s,n=p,u=c,m=e;return v(),_("div",b,[d(n,{class:"items-center mb-12px"},{default:h((()=>[w("div",x,[d(l,{value:j(I),"onUpdate:value":[t[0]||(t[0]=e=>g(I)?I.value=e:null),V],options:j(N)},null,8,["value","options"])]),w("div",null,[t[4]||(t[4]=w("span",null,"Rewrite rule converter: ",-1)),d(r,{href:"https://www.bt.cn/Tools",target:"_blank"},{default:h((()=>t[3]||(t[3]=[y("Apache to Nginx")]))),_:1,__:[3]})])])),_:1}),d(o,{ref_key:"configRef",ref:H,path:j(P),"onUpdate:path":t[1]||(t[1]=e=>g(P)?P.value=e:null),value:j(Q),"onUpdate:value":t[2]||(t[2]=e=>g(Q)?Q.value=e:null),height:350,"show-tips":!1},null,8,["path","value"]),d(n,{class:"items-center mt-12px"},{default:h((()=>[d(u,{type:"primary",onClick:T},{default:h((()=>t[5]||(t[5]=[y("Save")]))),_:1,__:[5]})])),_:1}),d(m,{class:"mt-24px"},{default:h((()=>t[6]||(t[6]=[w("li",null,"Please select your application.",-1),w("li",null," If the site cannot be accessed after the rewrite rules set, please try to reset to default. ",-1),w("li",null,"You are able to modify rewrite rules, just save it after modification.",-1)]))),_:1,__:[6]})])}}});export{C as default};
