import{fO as e,bF as a,fP as t,ao as l,b as s,ap as r,$ as o,j as i}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 m,H as d,v as u,x as c,e as f,B as h,y as _,G as b,C as j,N as v,D as y,z as x,I as C,Q as g}from"./base-lib.js?v=1761009159";import{a as k,b as B,u as V}from"./column.js?v=1761009159";import{u as H}from"./useStore4.js?v=1761009159";import{u as S,i as w,f as F,g as R,a as T,e as U,j as q,h as z,b as D,s as E,c as G,d as I,k as L}from"./useController18.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./ace.js?v=1761009159";import"./index106.js?v=1761009159";import"./site.js?v=1761009159";const N={class:"h-full"},O={class:"p-[20px]"},P=m({__name:"redirect",setup(m){const P=s(),{siteType:Q}=H(),{isRefreshList:$}=S(),A=r([{label:"启用重定向规则",value:"start",event:L},{label:"停用重定向规则",value:"stop",event:L},{label:"删除重定向规则",value:"delete",event:L}]),{BtTable:J,BtRefresh:K,BtBatch:M}=e({request:w,columns:[k(),{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},B({prop:"type",event:F,data:["已停止","运行中"]}),V([{width:70,title:"配置文件",onClick:e=>{if(!e.type)return P.warn("请先启用重定向规则再查看配置文件");R(e)}},{title:"编辑",onClick:e=>{e.errorpage?T(e):U(e)}},{onClick:q,title:"删除"}])],extension:[t(),A,l($)]});return(e,a)=>{const t=n,l=o,s=i,r=d("bt-loading");return u(),c("div",N,[f(t,null,{"header-left":h(()=>[f(_(b),{type:"primary",onClick:a[0]||(a[0]=e=>_(U)())},{default:h(()=>a[6]||(a[6]=[j("添加重定向",-1)])),_:1,__:[6]}),["php","html"].includes(_(Q))?(u(),v(_(b),{key:0,type:"default",onClick:a[1]||(a[1]=e=>_(T)())},{default:h(()=>a[7]||(a[7]=[j("404重定向",-1)])),_:1,__:[7]})):y("",!0)]),"header-right":h(()=>[f(_(K))]),content:h(()=>[f(_(J),{"max-height":460})]),"footer-left":h(()=>[f(_(M))]),_:1}),f(l,{class:"mt-2rem",options:_(z),"list-style":"disc"},null,8,["options"]),f(s,{title:"编辑配置文件",modelValue:_(I),"onUpdate:modelValue":a[5]||(a[5]=e=>g(I)?I.value=e:null),area:54},{default:h(()=>[x("div",O,[a[9]||(a[9]=j(" 提示：Ctrl+F 搜索关键字，Ctrl+S 保存，Ctrl+H 查找替换 ",-1)),C(f(_(p),{class:"!h-[36rem] my-[8px]",ref:"aceEditor",modelValue:_(D),"onUpdate:modelValue":a[2]||(a[2]=e=>g(D)?D.value=e:null),onSave:a[3]||(a[3]=e=>_(E)())},null,8,["modelValue"]),[[r,_(G)]]),f(_(b),{type:"primary",onClick:a[4]||(a[4]=e=>_(E)())},{default:h(()=>a[8]||(a[8]=[j("保存",-1)])),_:1,__:[8]}),a[10]||(a[10]=x("ul",{class:"mt-[8px] leading-8 text-small list-disc ml-[20px]"},[x("li",null,"此处为该重定向的配置文件，若您不了解配置规则,请勿随意修改。")],-1))])]),_:1},8,["modelValue"])])}}});export{P as default};
