import{o,c as _,w as i,j as $,n as C,aa as y,r as T,g as p,u as t,h as n,b as s,f as d,t as w,a as h,i as R}from"./app-SC54XQDl.js";import{i as P,c as H}from"./app-Ba7ZqSpq.js";import{_ as N}from"./app-Cft_lrsr.js";import{_ as L}from"./app-rIYFLdeU.js";import{_ as B}from"./app-BY_oRVaR.js";import"./app-DoVkxbmA.js";import{_ as S}from"./app-C33Py4oT.js";import{s as m,L as O}from"./app-Crd12MWL.js";import{N as v}from"./app-B2C_dtYI.js";import{N as E}from"./app-CL60OiIv.js";import"./app-qhR41k1m.js";import"./app-CS3AUTAk.js";import"./app-CCkWSX4Q.js";import"./app-Dhl-Bw0H.js";import"./app-BjSCO7rC.js";import"./app-B9xxzP2y.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app-PPG0ZS4d.js";import"./app--Lj8zATS.js";import"./app-Ch8j4za4.js";import"./app-C2mBgI5Z.js";import"./app-DHsI_tns.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-DgoEZtNT.js";import"./app-Dw0jKdCD.js";import"./app-DnXuoh8P.js";import"./app-C8HFiBxn.js";import"./app-g-bJrEAS.js";import"./app-DZaelcLs.js";import"./app-D_RBJHM6.js";import"./app-CmrRgGIA.js";import"./app-DyP4Nide.js";import"./app-COidJXl1.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";function G(){const{utils:c}=P(this);this.createRewriteRule=function(){c.popup("/servers/server/settings/rewrite/createPopup?webId="+this.webId,{height:c.POPUP_HEIGHT_LG,callback:function(){c.success("保存成功",function(){c.reload()})}})}}const b={__name:"HTTPRewriteLabelsLabel",props:["v-class"],setup(c){return(r,f)=>(o(),_(S,{class:C(r.vClass)},{default:i(()=>[$(r.$slots,"default")]),_:3},8,["class"]))}},V={key:0,class:"comment"},W={key:1},j={class:"label-group mt-1"},U={key:0},z={key:1},A=["onClick"],D=["onClick"],K={key:2,class:"comment flex items-center"},M=h("i",{class:"icon bars grey"},null,-1),q={__name:"HTTPRewriteRuleList",props:["v-web-id","v-rewrite-rules"],setup(c){const r=y("$utils"),f=y("$Tea"),l=c,{rewriteRules:u}=function(){let a=l.vRewriteRules;return a==null&&(a=[]),{rewriteRules:T(a)}}(),k=function(a){r.popup("/servers/server/settings/rewrite/updatePopup?webId="+l.vWebId+"&rewriteRuleId="+a,{height:r.POPUP_HEIGHT_LG,callback:function(){window.location.reload()}})},I=function(a){r.confirm("确定要删除此重写规则吗？",function(){f.action("/servers/server/settings/rewrite/delete").params({webId:l.vWebId,rewriteRuleId:a}).post().refresh()})},x=function(a){f.action("/servers/server/settings/rewrite/sort").post().params({webId:l.vWebId,rewriteRuleIds:a}).success(function(){r.success("保存成功")})};return(a,Q)=>(o(),p("div",null,[t(u).length==0?(o(),p("p",V,"暂时还没有重写规则。")):n("",!0),t(u).length>0?(o(),p("div",W,[s(O,{items:t(u),onSort:x},{default:i(()=>[s(t(m),{rowReorder:"",headerStyle:"width: 3em"}),s(t(m),{header:"匹配规则"},{body:i(({data:e})=>[d(w(e.pattern)+" ",1),h("div",j,[e.isBreak?(o(),_(b,{key:0},{default:i(()=>[d("BREAK")]),_:1})):n("",!0),e.mode=="redirect"&&e.redirectStatus!=307?(o(),_(b,{key:1},{default:i(()=>[d(w(e.redirectStatus),1)]),_:2},1024)):n("",!0),e.proxyHost.length>0?(o(),_(b,{key:2},{default:i(()=>[d("Host: "+w(e.proxyHost),1)]),_:2},1024)):n("",!0)])]),_:1}),s(t(m),{header:"转发目标"},{body:i(({data:e})=>[d(w(e.replace),1)]),_:1}),s(t(m),{header:"转发方式"},{body:i(({data:e})=>[e.mode=="proxy"?(o(),p("span",U,"隐式")):n("",!0),e.mode=="redirect"?(o(),p("span",z,"显示")):n("",!0)]),_:1}),s(t(m),{header:"状态",headerClass:"two wide"},{body:i(({data:e})=>[s(B,{"v-is-on":e.isOn},null,8,["v-is-on"])]),_:1}),s(t(m),{header:"操作",headerClass:"two op"},{body:i(({data:e})=>[h("a",{href:"",onClick:R(g=>k(e.id),["prevent"])},"修改",8,A),d("   "),h("a",{href:"",onClick:R(g=>I(e.id),["prevent"])},"删除",8,D)]),_:1})]),_:1},8,["items"])])):n("",!0),t(u).length>0?(o(),p("p",K,[d("拖动左侧的"),M,d("图标可以对重写规则进行排序。 ")])):n("",!0)]))}},F={key:0},J={key:1},Se={__name:"index",setup(c){const r=H(new G);return(f,l)=>(o(),_(N,{ctx:t(r)},{default:i(()=>[t(r).featureIsOn?(o(),p("div",F,[s(E,{secondary:""},{tabs:i(()=>[s(v,{href:".?serverId="+t(r).serverId,name:"重写规则列表",active:""},null,8,["href"]),s(v,{separator:""}),s(v,{onClick:l[0]||(l[0]=R(u=>t(r).createRewriteRule(),["prevent"])),name:"创建重写规则","action-create":""})]),_:1}),s(q,{"v-web-id":t(r).webId,"v-rewrite-rules":t(r).rewriteRules},null,8,["v-web-id","v-rewrite-rules"])])):n("",!0),t(r).featureIsOn?n("",!0):(o(),p("div",J,[s(L)]))]),_:1},8,["ctx"]))}};export{Se as default};
