import{fO as e,bF as a,fP as t,ao as l,ap as s,$ as r,j as i,b as o}from"./utils-lib.js?v=1761009159";import{_ as n}from"./index105.js?v=1761009159";import{B as p}from"./index115.js?v=1761009159";import{c as d,H as m,v as u,x as c,y as f,F as h,e as x,B as b,G as v,C as y,N as _,D as g,z as j,I as k,Q as C}from"./base-lib.js?v=1761009159";import{a as B,b as V,u as S}from"./column.js?v=1761009159";import{u as E,S as F}from"./useStore4.js?v=1761009159";import{u as T,i as w,e as H,a as R,h as U,c as q,b as z,s as D,d as G,f as I,g as L,j as N,k as O}from"./useController18.js?v=1761009159";const P={class:"h-full"},Q={key:1,class:"bg-light flex items-center justify-center h-full",style:{"min-height":"600px"}},$={class:"bg-lighter px-[48px] py-[16px] text-default flex"},A={class:"p-[20px]"},J=d({__name:"index",setup(d,{expose:J}){const K=o(),{isBindExtranet:M,siteType:W}=E(),{jumpTabEvent:X}=F(),{isRefreshList:Y}=T(),Z=s([{label:"启用重定向规则",value:"start",event:O},{label:"停用重定向规则",value:"stop",event:O},{label:"删除重定向规则",value:"delete",event:O}]),{BtTable:ee,BtRefresh:ae,BtBatch:te,refresh:le}=e({request:w,columns:[B(),{label:"被重定向",render:e=>{var t;return e.errorpage?"404错误页面":"domain"===e.domainorpath?null==(t=a(e.redirectdomain,"array",[]))?void 0:t.join("、"):e.redirectpath}},{label:"重定向类型",prop:"domainorpath",render:e=>e.errorpage?"错误":"domain"===e.domainorpath?"域名":"路径"},{label:"重定向到",render:e=>e.topath?e.topath:e.tourl},V({prop:"type",event:I,data:["已停止","运行中"]}),S([{width:70,title:"配置文件",onClick:e=>{if(!e.type)return K.warn("请先启用重定向规则再查看配置文件");L(e)}},{title:"编辑",onClick:e=>{e.errorpage?R(e):H(e)}},{onClick:N,title:"删除"}])],extension:[t(),Z,l(Y)]});return J({init:le}),(e,a)=>{const t=n,l=r,s=i,o=m("bt-loading");return u(),c("div",P,[f(M)?(u(),c(h,{key:0},[x(t,null,{"header-left":b(()=>[x(f(v),{type:"primary",onClick:a[0]||(a[0]=e=>f(H)())},{default:b(()=>a[7]||(a[7]=[y("添加重定向",-1)])),_:1,__:[7]}),["php","html"].includes(f(W))?(u(),_(f(v),{key:0,type:"default",onClick:a[1]||(a[1]=e=>f(R)())},{default:b(()=>a[8]||(a[8]=[y("404重定向",-1)])),_:1,__:[8]})):g("",!0)]),"header-right":b(()=>[x(f(ae))]),content:b(()=>[x(f(ee),{"max-height":460})]),"footer-left":b(()=>[x(f(te))]),_:1}),x(l,{class:"mt-2rem",options:f(U),"list-style":"disc"},null,8,["options"])],64)):(u(),c("div",Q,[j("div",$,[a[9]||(a[9]=y(" 请开启 ",-1)),j("span",{class:"mx-[.4rem] bt-link",onClick:a[2]||(a[2]=e=>f(X)("mapping"))},"外网映射"),a[10]||(a[10]=y(" 后查看配置信息 ",-1))])])),x(s,{title:"编辑配置文件",modelValue:f(G),"onUpdate:modelValue":a[6]||(a[6]=e=>C(G)?G.value=e:null),area:54},{default:b(()=>[j("div",A,[a[12]||(a[12]=y(" 提示：Ctrl+F 搜索关键字，Ctrl+S 保存，Ctrl+H 查找替换 ",-1)),k(x(f(p),{class:"!h-[36rem] my-[8px]",ref:"aceEditor",modelValue:f(z),"onUpdate:modelValue":a[3]||(a[3]=e=>C(z)?z.value=e:null),onSave:a[4]||(a[4]=e=>f(D)())},null,8,["modelValue"]),[[o,f(q)]]),x(f(v),{type:"primary",onClick:a[5]||(a[5]=e=>f(D)())},{default:b(()=>a[11]||(a[11]=[y("保存",-1)])),_:1,__:[11]}),a[13]||(a[13]=j("ul",{class:"mt-[8px] leading-8 text-small list-disc ml-[20px]"},[j("li",null,"此处为该重定向的配置文件，若您不了解配置规则,请勿随意修改。")],-1))])]),_:1},8,["modelValue"])])}}});export{J as _};
