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-BYcXwl4U.js";import{i as P,c as H}from"./app-a6cKceqE.js";import{_ as N}from"./app-C3oVnfUH.js";import{_ as L}from"./app-B8JChEZz.js";import{_ as B}from"./app-BUc97JYP.js";import"./app-D2Wz0BUQ.js";import{_ as S}from"./app-uVRRKSkZ.js";import{s as m,L as O}from"./app-W_y7sflh.js";import{N as v}from"./app-CabATHnR.js";import{N as E}from"./app-DCd54JMo.js";import"./app-CLawzVMq.js";import"./app-BeFNDz9n.js";import"./app-BDgR0DSb.js";import"./app-DxjODhok.js";import"./app-DPDEogA0.js";import"./app-D7QVa3_6.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BG60hdvp.js";import"./app-BQ5ggxk2.js";import"./app-SxAW7vhf.js";import"./app-D3zbrzdO.js";import"./app-CJCAnMrx.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-CNARLpXE.js";import"./app-D5k1HLu9.js";import"./app-ysQ8KbGS.js";import"./app-Cc2zXvHs.js";import"./app-aSafd0Me.js";import"./app-BHl80pFw.js";import"./app-Btbk6LWy.js";import"./app-CrkKi1Ag.js";import"./app-u5shTDG_.js";import"./app-BhzV4gWo.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.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};
