import{r as m,C as Se,o as n,g as s,a as o,u,F as T,D as O,b as i,w as r,f as p,t as _,h as a,i as $,d as ke,c as B,L as ge,aa as Ve,J as F,ak as Ue,e as Le,n as he,bb as w,a_ as k}from"./app-DA7OTM4Q.js";import{u as Ke}from"./app-BT68AfZ-.js";import"./app-CHxME8Sw.js";import{T as me}from"./app-BkWUIifj.js";import{P as be}from"./app-DEIWLCpe.js";import{a as g,_ as G}from"./app-BHFzVhjx.js";import{T as Re}from"./app-Zes_jb7S.js";import{_ as P}from"./app-DuUYZNNT.js";import{_ as Ce}from"./app-Daq_vi_n.js";import{_ as Oe}from"./app-BMjG4tWp.js";import{_ as Be}from"./app-a9KqBnqw.js";import{a as R,T as C}from"./app-Bll_3-lM.js";import{S as De}from"./app-C0-Qcoum.js";const Ee=["value"],Ae={key:0,class:"label-group"},Me=["title"],je={class:"small grey"},Ge={key:0},We={key:1},ze={key:0},Je={key:1},He={key:2},qe=["title"],Ye={key:1,class:"hover"},Qe={key:2,class:"disabled",style:{"font-weight":"normal"},title:"空字符串"},Xe={key:3,class:"grey small"},Ze=["onClick"],et=o("i",{class:"icon pencil small"},null,-1),tt=[et],lt=["onClick"],ot=o("i",{class:"icon remove"},null,-1),nt=[ot],xo={__name:"HTTPFirewallRulesBox",props:["v-rules","v-type","connector"],setup(re){const W=Ke(),de=re,{rules:b}=function(){let y=de.vRules;return y==null&&(y=[]),{rules:m(y)}}(),ce=function(){window.UPDATING_RULE=null,W.popup("/servers/components/waf/createRulePopup?type="+de.vType,{width:"60em",height:"50em",callback:function(y){b.value.push(y.data.rule)}})},_e=function(y,f){window.UPDATING_RULE=W.clone(f),W.popup("/servers/components/waf/createRulePopup?type="+de.vType,{width:"60em",height:"50em",callback:function(h){b.value[y]=h.data.rule}})},pe=function(y){W.confirm("确定要删除此规则吗？",function(){b.value.$remove(y)})},D=function(y){let f=y;return typeof window.WAF_RULE_OPERATORS!=null&&window.WAF_RULE_OPERATORS.forEach(function(h){h.code==y&&(f=h.name)}),f},A=function(y){let f=y,h="";return typeof window.WAF_RULE_OPERATORS!=null&&window.WAF_RULE_OPERATORS.forEach(function(d){d.code==y&&(f=d.name,h=d.description)}),f+": "+h},U=function(y){let f="none";return typeof window.WAF_RULE_OPERATORS!=null&&window.WAF_RULE_OPERATORS.forEach(function(h){h.code==y&&(f=h.dataType)}),f},x=function(y){let f="";return y!=null&&window.WAF_RULE_CHECKPOINTS.forEach(function(h){(y=="${"+h.prefix+"}"||y.startsWith("${"+h.prefix+"."))&&(f=h.name)}),f},v=function(y){let f="",h="";return y!=null&&window.WAF_RULE_CHECKPOINTS.forEach(function(d){(y=="${"+d.prefix+"}"||y.startsWith("${"+d.prefix+"."))&&(f=d.name,h=d.description)}),f+": "+h},c=function(y){return typeof y=="string"&&y.length==0};return(y,f)=>{const h=Se("tooltip");return n(),s("div",null,[o("input",{type:"hidden",name:"rulesJSON",value:JSON.stringify(u(b))},null,8,Ee),u(b).length>0?(n(),s("div",Ae,[(n(!0),s(T,null,O(u(b),(d,N)=>(n(),s(T,null,[i(me,{outlined:""},{default:r(()=>[p(_(d.name)+" ",1),o("span",{title:v(d.param),class:"hover"},[p(_(x(d.param))+" ",1),o("span",je,_(d.param),1),p(" ")],8,Me),d.param=="${cc}"?(n(),s("span",Ge,_(d.checkpointOptions.period)+"秒内请求数 ",1)):a("",!0),d.param=="${refererBlock}"?(n(),s("span",We,[d.checkpointOptions.allowDomains!=null&&d.checkpointOptions.allowDomains.length>0?(n(),s("span",ze,"允许"+_(d.checkpointOptions.allowDomains),1)):a("",!0),d.checkpointOptions.denyDomains!=null&&d.checkpointOptions.denyDomains.length>0?(n(),s("span",Je,"禁止"+_(d.checkpointOptions.denyDomains),1)):a("",!0)])):(n(),s("span",He,[d.paramFilters!=null&&d.paramFilters.length>0?(n(!0),s(T,{key:0},O(d.paramFilters,L=>(n(),s("span",null," | "+_(L.code),1))),256)):a("",!0),p(),o("span",{class:"hover",title:A(d.operator)+(!d.isComposed&&d.isCaseInsensitive?"\\n[大小写不敏感] ":"")},"<"+_(D(d.operator))+">",9,qe),p("  "),c(d.value)?U(d.operator)!="none"?(n(),s("span",Qe,"[空]")):a("",!0):(n(),s("span",Ye,_(d.value),1))])),d.description!=null&&d.description.length>0?(n(),s("span",Xe,"（"+_(d.description)+"）",1)):a("",!0),p("   "),o("a",{href:"",title:"修改",onClick:$(L=>_e(N,d),["prevent"])},tt,8,Ze),p("  "),o("a",{href:"",title:"删除",onClick:$(L=>pe(N),["prevent"])},nt,8,lt)]),_:2},1024),N!=u(b).length-1?(n(),s(T,{key:0},[re.connector=="and"?ke((n(),B(me,{key:0},{default:r(()=>[p("和")]),_:1})),[[h,`规则之间关系-和：
所有规则都满足才视为匹配`,void 0,{bottom:!0}]]):a("",!0),re.connector=="or"?ke((n(),B(me,{key:1},{default:r(()=>[p("或")]),_:1})),[[h,`规则之间关系-或：
任一规则满足了就视为匹配`,void 0,{bottom:!0}]]):a("",!0)],64)):a("",!0)],64))),256)),i(ge)])):a("",!0),i(be,{size:"small",type:"button",onClick:f[0]||(f[0]=$(d=>ce(),["prevent"]))})])}}},st=["value"],ut={class:"small"},at={key:0,class:"small"},it={key:0},rt={key:1},dt={key:2},pt={key:1},vt={key:0},mt={key:2},ct={key:0},_t={key:3},yt={key:0},ft={key:4},ht={key:5},kt={key:6},bt={key:7},wt={key:8},$t={key:0},Vt={key:9},gt={key:10},Ft={key:11},It={key:12,class:"small grey"},Nt={key:0},Pt={key:1},Tt=["onClick"],xt=o("i",{class:"icon pencil small"},null,-1),St=[xt],Ut=["onClick"],Lt=o("i",{class:"icon remove small"},null,-1),Kt=[Lt],Rt=o("a",{href:"",title:"拖动改变顺序"},[o("i",{class:"icon bars sort-handle"})],-1),Ct={key:0,style:{"margin-bottom":"0.5em"}},Ot=o("td",{class:"title"},"动作类型 *",-1),Bt={key:0,class:"comment"},Dt={key:0},Et=o("td",null,"有效范围",-1),At={key:0,class:"comment"},Mt={key:1,class:"comment"},jt={key:2,class:"comment"},Gt={key:1},Wt=o("td",null,"封禁范围",-1),zt={key:0,class:"comment"},Jt={key:1,class:"comment"},Ht={key:2},qt=o("td",null,"封禁时长",-1),Yt=o("span",null,"秒",-1),Qt={key:3},Xt=o("td",null,"最大封禁时长",-1),Zt=o("span",null,"秒",-1),el=o("p",{class:"comment"},"选填项。如果同时填写了封禁时长和最大封禁时长，则会在两者之间随机选择一个数字作为最终的封禁时长。",-1),tl={key:4},ll=o("td",null,"有效时间",-1),ol=o("span",null,"秒",-1),nl=o("p",{class:"comment"},"验证通过后在这个时间内不再验证；如果为空或者为0表示默认。",-1),sl={key:5},ul=o("td",null,"最多失败次数",-1),al=o("span",null,"次",-1),il={class:"comment"},rl={key:0,class:"red"},dl={key:6},pl=o("td",null,"失败拦截时间",-1),vl=o("span",null,"秒",-1),ml=o("p",{class:"comment"},"在达到最多失败次数（大于0）时，自动拦截的时间；如果为空或者为0表示默认。",-1),cl={key:7},_l=o("td",null,"有效时间",-1),yl=o("span",null,"秒",-1),fl=o("p",{class:"comment"},"验证通过后在这个时间内不再验证；如果为空或者为0表示默认。",-1),hl={key:8},kl=o("td",null,"最多失败次数",-1),bl=o("span",null,"次",-1),wl=o("p",{class:"comment"},"允许用户失败尝试的最多次数，超过这个次数将被自动加入黑名单；如果为空或者为0表示默认。",-1),$l={key:9},Vl=o("td",null,"失败拦截时间",-1),gl=o("span",null,"秒",-1),Fl=o("p",{class:"comment"},"在达到最多失败次数（大于0）时，自动拦截的时间；如果为空或者为0表示默认。",-1),Il={key:10},Nl=o("td",null,"有效时间",-1),Pl=o("span",null,"秒",-1),Tl=o("p",{class:"comment"},"验证通过后在这个时间内不再验证。",-1),xl={key:11},Sl=o("td",null,"有效时间",-1),Ul=o("span",null,"秒",-1),Ll=o("p",{class:"comment"},"验证通过后在这个时间内不再验证。",-1),Kl={key:12},Rl=o("td",null,"IP名单类型 *",-1),Cl={key:13},Ol=o("td",null,"选择IP名单",-1),Bl={key:0,class:"mb-2"},Dl=o("i",{class:"icon remove small"},null,-1),El=[Dl],Al=o("p",{class:"comment"},"如不选择，则自动添加到当前策略的IP名单中。",-1),Ml={key:14},jl=o("td",null,"级别",-1),Gl={key:15},Wl=o("td",null,"超时时间",-1),zl=o("span",null,"秒",-1),Jl=o("p",{class:"comment"},"0表示不超时。",-1),Hl={key:16},ql=o("td",null,"标签 *",-1),Yl={key:17},Ql=o("td",null,"使用默认提示",-1),Xl={key:18},Zl=o("td",{class:"color-border"},"状态码 *",-1),eo={key:19},to=o("td",{class:"color-border"},"网页内容",-1),lo={key:20},oo=o("td",null,"状态码 *",-1),no={key:21},so=o("td",null,"跳转到URL",-1),uo={key:22},ao=o("td",null,"下一个分组 *",-1),io={key:23},ro=o("td",null,"下一个分组 *",-1),po={key:24},vo=o("td",null,"下一个规则集 *",-1),mo=o("i",{class:"icon remove small"},null,-1),co=[mo],_o={key:1},yo=o("p",{class:"comment"},"系统总是会先执行记录日志、标签等不会修改请求的动作，再执行阻止、验证码等可能改变请求的动作。",-1),So={__name:"HTTPFirewallActionsBox",props:["v-actions","v-firewall-policy","v-action-configs","v-group-type"],setup(re){const W=Ve("$utils"),de=Ve("$Tea"),b=re,ce=m(),{id:_e,actions:pe,configs:D,isAdding:A,editingIndex:U,action:x,actionCode:v,actionOptions:c,ipListLevels:y,allowScope:f,blockTimeout:h,blockTimeoutMax:d,blockScope:N,captchaLife:L,captchaMaxFails:M,captchaFailBlockTimeout:Q,get302Life:X,post307Life:Z,recordIPType:z,recordIPLevel:ae,recordIPTimeout:ee,recordIPListId:J,recordIPListName:ve,tagTags:H,pageUseDefault:E,pageStatus:te,pageBody:le,defaultPageBody:we,redirectStatus:oe,redirectURL:q,goGroupName:Y,goGroupId:S,goGroup:K,goSetId:j,goSetName:ie,jsCookieLife:ne,jsCookieMaxFails:se,jsCookieFailBlockTimeout:ue,statusOptions:Fe}=function(){b.vFirewallPolicy.inbound==null&&(b.vFirewallPolicy.inbound={}),b.vFirewallPolicy.inbound.groups==null&&(b.vFirewallPolicy.inbound.groups=[]),b.vFirewallPolicy.outbound==null&&(b.vFirewallPolicy.outbound={}),b.vFirewallPolicy.outbound.groups==null&&(b.vFirewallPolicy.outbound.groups=[]);let l=0,e=[];b.vActionConfigs!=null&&(e=b.vActionConfigs,e.forEach(function(V){V.id=l++}));var t=`<!DOCTYPE html>
<html lang="en">
<head>
	<title>403 Forbidden</title>
	<style>
		address { line-height: 1.8; }
	</style>
</head>
<body>
<h1>403 Forbidden</h1>
<address>Connection: \${remoteAddr} (Client) -&gt; \${serverAddr} (Server)</address>
<address>Request ID: \${requestId}</address>
</body>
</html>`;return{id:m(l),actions:m(b.vActions),configs:m(e),isAdding:m(!1),editingIndex:m(-1),action:m(null),actionCode:m(""),actionOptions:m({}),ipListLevels:m([]),allowScope:m("global"),blockTimeout:m(""),blockTimeoutMax:m(""),blockScope:m("global"),captchaLife:m(""),captchaMaxFails:m(""),captchaFailBlockTimeout:m(""),get302Life:m(""),post307Life:m(""),recordIPType:m("black"),recordIPLevel:m("critical"),recordIPTimeout:m(""),recordIPListId:m(0),recordIPListName:m(""),tagTags:m([]),pageUseDefault:m(!0),pageStatus:m(403),pageBody:m(t),defaultPageBody:m(t),redirectStatus:m(307),redirectURL:m(""),goGroupName:m(""),goGroupId:m(0),goGroup:m(null),goSetId:m(0),goSetName:m(""),jsCookieLife:m(""),jsCookieMaxFails:m(""),jsCookieFailBlockTimeout:m(""),statusOptions:m([{code:301,text:"Moved Permanently"},{code:308,text:"Permanent Redirect"},{code:302,text:"Found"},{code:303,text:"See Other"},{code:307,text:"Temporary Redirect"}])}}(),$e=function(){x.value=null,v.value="page",A.value=!0,c.value={},f.value="global",h.value="",d.value="",N.value="global",L.value="",M.value="",Q.value="",ne.value="",se.value="",ue.value="",X.value="",Z.value="",ae.value="critical",z.value="black",ee.value="",J.value=0,ve.value="",H.value=[],E.value=!0,te.value=403,le.value=we.value,oe.value=307,q.value="",Y.value="",S.value=0,K.value=null,j.value=0,ie.value="",x.value=b.vActions.$find(function(l,e){return e.code==v.value})},Ie=function(l){A.value=!1,U.value=-1,D.value.$remove(l)},Ne=function(l,e){if(A.value&&U.value==l){ye();return}switch($e(),A.value=!0,U.value=l,v.value=e.code,x.value=pe.value.$find(function(t,V){return V.code==e.code}),e.code){case"block":h.value="",d.value="",(e.options.timeout!=null||e.options.timeout>0)&&(h.value=e.options.timeout.toString()),(e.options.timeoutMax!=null||e.options.timeoutMax>0)&&(d.value=e.options.timeoutMax.toString()),e.options.scope!=null&&e.options.scope.length>0?N.value=e.options.scope:N.value="global";break;case"allow":e.options!=null&&e.options.scope!=null&&e.options.scope.length>0?f.value=e.options.scope:f.value="global";break;case"log":break;case"captcha":L.value="",(e.options.life!=null||e.options.life>0)&&(L.value=e.options.life.toString()),M.value="",(e.options.maxFails!=null||e.options.maxFails>0)&&(M.value=e.options.maxFails.toString()),Q.value="",(e.options.failBlockTimeout!=null||e.options.failBlockTimeout>0)&&(Q.value=e.options.failBlockTimeout.toString());break;case"js_cookie":ne.value="",(e.options.life!=null||e.options.life>0)&&(ne.value=e.options.life.toString()),se.value="",(e.options.maxFails!=null||e.options.maxFails>0)&&(se.value=e.options.maxFails.toString()),ue.value="",(e.options.failBlockTimeout!=null||e.options.failBlockTimeout>0)&&(ue.value=e.options.failBlockTimeout.toString());break;case"notify":break;case"get_302":X.value="",(e.options.life!=null||e.options.life>0)&&(X.value=e.options.life.toString());break;case"post_307":Z.value="",(e.options.life!=null||e.options.life>0)&&(Z.value=e.options.life.toString());break;case"record_ip":e.options!=null&&(ae.value=e.options.level,z.value=e.options.type,e.options.timeout>0&&(ee.value=e.options.timeout.toString()),setTimeout(function(){J.value=e.options.ipListId,ve.value=e.options.ipListName}));break;case"tag":H.value=[],e.options.tags!=null&&(H.value=e.options.tags);break;case"page":E.value=!0,te.value=403,le.value=we.value,typeof e.options.useDefault=="boolean"?E.value=e.options.useDefault:E.value=!1,e.options.status!=null&&(te.value=e.options.status),e.options.body!=null&&(le.value=e.options.body);break;case"redirect":oe.value=307,q.value="",e.options.status!=null&&(oe.value=e.options.status),e.options.url!=null&&(q.value=e.options.url);break;case"go_group":e.options!=null&&(Y.value=e.options.groupName,S.value=e.options.groupId,K.value=b.vFirewallPolicy.inbound.groups.$find(function(t,V){return V.id==e.options.groupId}));break;case"go_set":e.options!=null&&(Y.value=e.options.groupName,S.value=e.options.groupId,K.value=b.vFirewallPolicy.inbound.groups.$find(function(t,V){return V.id==e.options.groupId}),setTimeout(function(){if(j.value=e.options.setId,K.value!=null){let t=K.value.sets.$find(function(V,fe){return fe.id==e.options.setId});t!=null&&(ie.value=t.name)}}));break}},ye=function(){A.value=!1,U.value=-1},I=function(){if(x.value==null)return;if(c.value==null&&(c.value={}),v.value=="record_ip"){let e=parseInt(ee.value);if(isNaN(e)&&(e=0),J.value<0)return;c.value={type:z.value,level:ae.value,timeout:e,ipListId:J.value,ipListName:ve.value}}else if(v.value=="tag"){if(H.value==null||H.value.length==0)return;c.value={tags:H.value}}else if(v.value=="page"){let e=te.value.toString();e.match(/^\d{3}$/)?e=parseInt(e):e=403,c.value={useDefault:E.value,status:e,body:le.value}}else if(v.value=="redirect"){let e=oe.value.toString();if(e.match(/^\d{3}$/)?e=parseInt(e):e=307,q.value.length==0){W.warn("请输入跳转到URL");return}c.value={status:e,url:q.value}}else if(v.value=="go_group"){let e=S.value;if(typeof e=="string"&&(e=parseInt(e),isNaN(e)&&(e=0)),e<=0)return;c.value={groupId:e.toString(),groupName:Y.value}}else if(v.value=="go_set"){let e=S.value;typeof e=="string"&&(e=parseInt(e),isNaN(e)&&(e=0));let t=j.value;if(typeof t=="string"&&(t=parseInt(t),isNaN(t)&&(t=0)),t<=0)return;c.value={groupId:e.toString(),groupName:Y.value,setId:t.toString(),setName:ie.value}}let l={};for(let e in c.value)c.value.hasOwnProperty(e)&&(l[e]=c.value[e]);U.value>-1?D.value[U.value]={id:D.value[U.value].id,code:v.value,name:x.value.name,options:l}:D.value.push({id:_e.value++,code:v.value,name:x.value.name,options:l}),ye()},Pe=function(){J.value=0},Te=function(){W.popup("/servers/iplists/selectPopup?type="+z.value,{width:"50em",callback:function(l){J.value=l.data.list.id,ve.value=l.data.list.name}})},xe=function(l){H.value=l};return F(v,function(l){x.value=pe.value.$find(function(e,t){return t.code==l}),c.value={}}),F(f,function(l){c.value.scope=l}),F(h,function(l){l=parseInt(l),isNaN(l)?c.value.timeout=0:c.value.timeout=l}),F(d,function(l){l=parseInt(l),isNaN(l)?c.value.timeoutMax=0:c.value.timeoutMax=l}),F(N,function(l){c.value.scope=l}),F(L,function(l){l=parseInt(l),isNaN(l)?c.value.life=0:c.value.life=l}),F(M,function(l){l=parseInt(l),isNaN(l)?c.value.maxFails=0:c.value.maxFails=l}),F(Q,function(l){l=parseInt(l),isNaN(l)?c.value.failBlockTimeout=0:c.value.failBlockTimeout=l}),F(X,function(l){l=parseInt(l),isNaN(l)?c.value.life=0:c.value.life=l}),F(Z,function(l){l=parseInt(l),isNaN(l)?c.value.life=0:c.value.life=l}),F(z,function(l){J.value=0}),F(ee,function(l){l=parseInt(l),isNaN(l)?c.value.timeout=0:c.value.timeout=l}),F(S,function(l){let e=b.vFirewallPolicy.inbound.groups.$find(function(t,V){return V.id==l});K.value=e,e==null?(e=b.vFirewallPolicy.outbound.groups.$find(function(t,V){return V.id==l}),e==null?Y.value="":(K.value=e,Y.value=e.name)):Y.value=e.name,j.value=0,ie.value=""}),F(j,function(l){if(K.value==null)return;let e=K.value.sets.$find(function(t,V){return V.id==l});e==null?(j.value=0,ie.value=""):ie.value=e.name}),F(ne,function(l){l=parseInt(l),isNaN(l)?c.value.life=0:c.value.life=l}),F(se,function(l){l=parseInt(l),isNaN(l)?c.value.maxFails=0:c.value.maxFails=l}),F(ue,function(l){l=parseInt(l),isNaN(l)?c.value.failBlockTimeout=0:c.value.failBlockTimeout=l}),Ue(()=>{de.action("/servers/iplists/levelOptions").success(function(l){y.value=l.data.levels}).post(),De.create(ce.value,{draggable:".sort-label",handle:".sort-handle",onUpdate:function(l){W.moveElement(D.value,l.oldDraggableIndex,l.newDraggableIndex)}})}),(l,e)=>(n(),s("div",null,[o("input",{type:"hidden",name:"actionsJSON",value:JSON.stringify(u(D))},null,8,st),ke(o("div",{class:"label-group",ref_key:"actionsBoxRef",ref:ce},[(n(!0),s(T,null,O(u(D),(t,V)=>(n(),B(me,{outlined:"","data-index":V,key:t.id,class:he(["sort-label",{blue:V==u(U)}])},{default:r(()=>[p(_(t.name)+" ",1),o("span",ut,"("+_(t.code.toUpperCase())+")",1),t.code=="allow"&&t.options!=null&&t.options.scope!=null&&t.options.scope.length>0?(n(),s("span",at,[t.options.scope=="group"?(n(),s("span",it,"[分组]")):a("",!0),t.options.scope=="server"?(n(),s("span",rt,"[网站]")):a("",!0),t.options.scope=="global"?(n(),s("span",dt,"[网站和策略]")):a("",!0)])):a("",!0),t.code=="block"&&t.options.timeout>0?(n(),s("span",pt,[p("：封禁时长"+_(t.options.timeout),1),t.options.timeoutMax>t.options.timeout?(n(),s("span",vt,"-"+_(t.options.timeoutMax),1)):a("",!0),p("秒")])):a("",!0),t.code=="captcha"&&t.options.life>0?(n(),s("span",mt,[p("：有效期"+_(t.options.life)+"秒 ",1),t.options.maxFails>0?(n(),s("span",ct," / 最多失败"+_(t.options.maxFails)+"次",1)):a("",!0)])):a("",!0),t.code=="js_cookie"&&t.options.life>0?(n(),s("span",_t,[p("：有效期"+_(t.options.life)+"秒 ",1),t.options.maxFails>0?(n(),s("span",yt," / 最多失败"+_(t.options.maxFails)+"次",1)):a("",!0)])):a("",!0),t.code=="get_302"&&t.options.life>0?(n(),s("span",ft,"：有效期"+_(t.options.life)+"秒",1)):a("",!0),t.code=="post_307"&&t.options.life>0?(n(),s("span",ht,"：有效期"+_(t.options.life)+"秒",1)):a("",!0),t.code=="record_ip"?(n(),s("span",kt,[p("："),o("span",{class:he({red:t.options.ipListIsDeleted})},_(t.options.ipListName),3)])):a("",!0),t.code=="tag"?(n(),s("span",bt,"："+_(t.options.tags.join(", ")),1)):a("",!0),t.code=="page"?(n(),s("span",wt,[p("：["+_(t.options.status)+"]",1),t.options.useDefault?(n(),s("span",$t,"  [默认页面]")):a("",!0)])):a("",!0),t.code=="redirect"?(n(),s("span",Vt,"："+_(t.options.url),1)):a("",!0),t.code=="go_group"?(n(),s("span",gt,"："+_(t.options.groupName),1)):a("",!0),t.code=="go_set"?(n(),s("span",Ft,"："+_(t.options.groupName)+" / "+_(t.options.setName),1)):a("",!0),t.code!="allow"&&t.options.scope!=null&&t.options.scope.length>0?(n(),s("span",It,[p("   "),t.options.scope=="global"?(n(),s("span",Nt,"[所有网站]")):a("",!0),t.options.scope=="service"?(n(),s("span",Pt,"[当前网站]")):a("",!0)])):a("",!0),p("   "),o("a",{href:"",title:"修改",onClick:$(fe=>Ne(V,t),["prevent"])},St,8,Tt),p("   "),o("a",{href:"",title:"删除",onClick:$(fe=>Ie(V),["prevent"])},Kt,8,Ut),p("   "),Rt]),_:2},1032,["data-index","class"]))),128)),i(ge)],512),[[Le,u(D).length>0]]),u(A)?(n(),s("div",Ct,[o("table",{class:he(["ui table definition",{blue:u(U)>-1}])},[o("tr",null,[Ot,o("td",null,[i(G,{modelValue:u(v),"onUpdate:modelValue":e[0]||(e[0]=t=>w(v)?v.value=t:null)},{default:r(()=>[(n(!0),s(T,null,O(u(pe),t=>(n(),B(g,{value:t.code},{default:r(()=>[p(_(t.name)+" ("+_(t.code.toUpperCase())+")",1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"]),u(x)!=null&&u(x).description.length>0?(n(),s("p",Bt,_(u(x).description),1)):a("",!0)])]),u(v)=="allow"?(n(),s("tr",Dt,[Et,o("td",null,[i(G,{modelValue:u(f),"onUpdate:modelValue":e[1]||(e[1]=t=>w(f)?f.value=t:null)},{default:r(()=>[i(g,{value:"group"},{default:r(()=>[p("分组")]),_:1}),i(g,{value:"server"},{default:r(()=>[p("网站")]),_:1}),i(g,{value:"global"},{default:r(()=>[p("网站和策略")]),_:1})]),_:1},8,["modelValue"]),u(f)=="group"?(n(),s("p",At,"跳过当前分组其他规则集，继续执行其他分组的规则集。")):a("",!0),u(f)=="server"?(n(),s("p",Mt,"跳过当前网站所有的规则集。")):a("",!0),u(f)=="global"?(n(),s("p",jt,"跳过当前网站和网站对应WAF策略所有的规则集。")):a("",!0)])])):a("",!0),u(v)=="block"?(n(),s("tr",Gt,[Wt,o("td",null,[i(G,{modelValue:u(N),"onUpdate:modelValue":e[2]||(e[2]=t=>w(N)?N.value=t:null)},{default:r(()=>[i(g,{value:"service"},{default:r(()=>[p("当前网站")]),_:1}),i(g,{value:"global"},{default:r(()=>[p("所有网站")]),_:1})]),_:1},8,["modelValue"]),u(N)=="service"?(n(),s("p",zt,"只封禁用户对当前网站的访问，其他网站不受影响。")):a("",!0),u(N)=="global"?(n(),s("p",Jt,"封禁用户对所有网站的访问。")):a("",!0)])])):a("",!0),u(v)=="block"?(n(),s("tr",Ht,[qt,o("td",null,[i(C,null,{default:r(()=>[i(P,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:u(h),"onUpdate:modelValue":e[3]||(e[3]=t=>w(h)?h.value=t:null),onKeyup:e[4]||(e[4]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[Yt]),_:1})]),_:1})])])):a("",!0),u(v)=="block"?(n(),s("tr",Qt,[Xt,o("td",null,[i(C,null,{default:r(()=>[i(P,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:u(d),"onUpdate:modelValue":e[5]||(e[5]=t=>w(d)?d.value=t:null),onKeyup:e[6]||(e[6]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[Zt]),_:1})]),_:1}),el])])):a("",!0),u(v)=="captcha"?(n(),s("tr",tl,[ll,o("td",null,[i(C,null,{default:r(()=>[i(P,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:u(L),"onUpdate:modelValue":e[7]||(e[7]=t=>w(L)?L.value=t:null),onKeyup:e[8]||(e[8]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[ol]),_:1})]),_:1}),nl])])):a("",!0),u(v)=="captcha"?(n(),s("tr",sl,[ul,o("td",null,[i(C,null,{default:r(()=>[i(P,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:u(M),"onUpdate:modelValue":e[9]||(e[9]=t=>w(M)?M.value=t:null),onKeyup:e[10]||(e[10]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[al]),_:1})]),_:1}),o("p",il,[u(M)>0&&u(M)<5?(n(),s("span",rl,"建议填入一个不小于5的数字，以减少误判几率。")):a("",!0),p("允许用户失败尝试的最多次数，超过这个次数将被自动加入黑名单；如果为空或者为0表示默认。 ")])])])):a("",!0),u(v)=="captcha"?(n(),s("tr",dl,[pl,o("td",null,[i(C,null,{default:r(()=>[i(P,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:u(Q),"onUpdate:modelValue":e[11]||(e[11]=t=>w(Q)?Q.value=t:null),onKeyup:e[12]||(e[12]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[vl]),_:1})]),_:1}),ml])])):a("",!0),u(v)=="js_cookie"?(n(),s("tr",cl,[_l,o("td",null,[i(C,null,{default:r(()=>[i(P,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:u(ne),"onUpdate:modelValue":e[13]||(e[13]=t=>w(ne)?ne.value=t:null),onKeyup:e[14]||(e[14]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[yl]),_:1})]),_:1}),fl])])):a("",!0),u(v)=="js_cookie"?(n(),s("tr",hl,[kl,o("td",null,[i(C,null,{default:r(()=>[i(P,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:u(se),"onUpdate:modelValue":e[15]||(e[15]=t=>w(se)?se.value=t:null),onKeyup:e[16]||(e[16]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[bl]),_:1})]),_:1}),wl])])):a("",!0),u(v)=="js_cookie"?(n(),s("tr",$l,[Vl,o("td",null,[i(C,null,{default:r(()=>[i(P,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:u(ue),"onUpdate:modelValue":e[17]||(e[17]=t=>w(ue)?ue.value=t:null),onKeyup:e[18]||(e[18]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[gl]),_:1})]),_:1}),Fl])])):a("",!0),u(v)=="get_302"?(n(),s("tr",Il,[Nl,o("td",null,[i(C,null,{default:r(()=>[i(P,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:u(X),"onUpdate:modelValue":e[19]||(e[19]=t=>w(X)?X.value=t:null),onKeyup:e[20]||(e[20]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[Pl]),_:1})]),_:1}),Tl])])):a("",!0),u(v)=="post_307"?(n(),s("tr",xl,[Sl,o("td",null,[i(C,null,{default:r(()=>[i(P,{type:"text",style:{width:"5em"},maxlength:"9",modelValue:u(Z),"onUpdate:modelValue":e[21]||(e[21]=t=>w(Z)?Z.value=t:null),onKeyup:e[22]||(e[22]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[Ul]),_:1})]),_:1}),Ll])])):a("",!0),u(v)=="record_ip"?(n(),s("tr",Kl,[Rl,o("td",null,[i(G,{modelValue:u(z),"onUpdate:modelValue":e[23]||(e[23]=t=>w(z)?z.value=t:null)},{default:r(()=>[i(g,{value:"black"},{default:r(()=>[p("黑名单")]),_:1}),i(g,{value:"white"},{default:r(()=>[p("白名单")]),_:1}),i(g,{value:"grey"},{default:r(()=>[p("灰名单")]),_:1})]),_:1},8,["modelValue"])])])):a("",!0),u(v)=="record_ip"?(n(),s("tr",Cl,[Ol,o("td",null,[u(J)>0?(n(),s("div",Bl,[i(me,{outlined:""},{default:r(()=>[p(_(u(ve))+" ",1),o("a",{href:"",onClick:$(Pe,["prevent"])},El)]),_:1})])):a("",!0),i(be,{size:"small",onClick:$(Te,["prevent"])},{default:r(()=>[p("+")]),_:1}),Al])])):a("",!0),u(v)=="record_ip"?(n(),s("tr",Ml,[jl,o("td",null,[i(G,{modelValue:u(ae),"onUpdate:modelValue":e[24]||(e[24]=t=>w(ae)?ae.value=t:null)},{default:r(()=>[(n(!0),s(T,null,O(u(y),t=>(n(),B(g,{value:t.code},{default:r(()=>[p(_(t.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])])])):a("",!0),u(v)=="record_ip"?(n(),s("tr",Gl,[Wl,o("td",null,[i(C,null,{default:r(()=>[i(P,{type:"text",style:{width:"6em"},maxlength:"9",modelValue:u(ee),"onUpdate:modelValue":e[25]||(e[25]=t=>w(ee)?ee.value=t:null),onKeyup:e[26]||(e[26]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"]),i(R,null,{default:r(()=>[zl]),_:1})]),_:1}),Jl])])):a("",!0),u(v)=="tag"?(n(),s("tr",Hl,[ql,o("td",null,[i(Ce,{onChange:xe,values:u(H)},null,8,["values"])])])):a("",!0),u(v)=="page"?(n(),s("tr",Yl,[Ql,o("td",null,[i(Be,{modelValue:u(E),"onUpdate:modelValue":e[27]||(e[27]=t=>w(E)?E.value=t:null)},null,8,["modelValue"])])])):a("",!0),u(v)=="page"&&!u(E)?(n(),s("tr",Xl,[Zl,o("td",null,[i(P,{type:"text",style:{width:"4em"},maxlength:"3",modelValue:u(te),"onUpdate:modelValue":e[28]||(e[28]=t=>w(te)?te.value=t:null),onKeyup:e[29]||(e[29]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"])])])):a("",!0),u(v)=="page"&&!u(E)?(n(),s("tr",eo,[to,o("td",null,[i(Oe,{modelValue:u(le),"onUpdate:modelValue":e[30]||(e[30]=t=>w(le)?le.value=t:null),class:"w-full",rows:"5"},null,8,["modelValue"])])])):a("",!0),u(v)=="redirect"?(n(),s("tr",lo,[oo,o("td",null,[i(G,{modelValue:u(oe),"onUpdate:modelValue":e[31]||(e[31]=t=>w(oe)?oe.value=t:null)},{default:r(()=>[(n(!0),s(T,null,O(u(Fe),t=>(n(),B(g,{value:t.code},{default:r(()=>[p(_(t.code)+" "+_(t.text),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])])])):a("",!0),u(v)=="redirect"?(n(),s("tr",no,[so,o("td",null,[i(P,{type:"text",modelValue:u(q),"onUpdate:modelValue":e[32]||(e[32]=t=>w(q)?q.value=t:null),class:"w-full",onKeyup:e[33]||(e[33]=k(t=>I(),["enter"])),onKeypress:k($(t=>1,["prevent"]),["enter"])},null,8,["modelValue","onKeypress"])])])):a("",!0),u(v)=="go_group"?(n(),s("tr",uo,[ao,o("td",null,[i(G,{modelValue:u(S),"onUpdate:modelValue":e[34]||(e[34]=t=>w(S)?S.value=t:null)},{default:r(()=>[i(g,{value:"0"},{default:r(()=>[p("[选择分组]")]),_:1}),l.vFirewallPolicy.inbound!=null&&l.vFirewallPolicy.inbound.groups!=null?(n(!0),s(T,{key:0},O(l.vFirewallPolicy.inbound.groups,t=>(n(),B(g,{value:t.id},{default:r(()=>[p("入站："+_(t.name),1)]),_:2},1032,["value"]))),256)):a("",!0),l.vGroupType=="outbound"&&l.vFirewallPolicy.outbound!=null&&l.vFirewallPolicy.outbound.groups!=null?(n(!0),s(T,{key:1},O(l.vFirewallPolicy.outbound.groups,t=>(n(),B(g,{value:t.id},{default:r(()=>[p("出站："+_(t.name),1)]),_:2},1032,["value"]))),256)):a("",!0)]),_:1},8,["modelValue"])])])):a("",!0),u(v)=="go_set"?(n(),s("tr",io,[ro,o("td",null,[i(G,{modelValue:u(S),"onUpdate:modelValue":e[35]||(e[35]=t=>w(S)?S.value=t:null)},{default:r(()=>[i(g,{value:"0"},{default:r(()=>[p("[选择分组]")]),_:1}),l.vFirewallPolicy.inbound!=null&&l.vFirewallPolicy.inbound.groups!=null?(n(!0),s(T,{key:0},O(l.vFirewallPolicy.inbound.groups,t=>(n(),B(g,{value:t.id},{default:r(()=>[p("入站："+_(t.name),1)]),_:2},1032,["value"]))),256)):a("",!0),l.vGroupType=="outbound"&&l.vFirewallPolicy.outbound!=null&&l.vFirewallPolicy.outbound.groups!=null?(n(!0),s(T,{key:1},O(l.vFirewallPolicy.outbound.groups,t=>(n(),B(g,{value:t.id},{default:r(()=>[p("出站："+_(t.name),1)]),_:2},1032,["value"]))),256)):a("",!0)]),_:1},8,["modelValue"])])])):a("",!0),u(v)=="go_set"&&u(K)!=null?(n(),s("tr",po,[vo,o("td",null,[i(G,{modelValue:u(j),"onUpdate:modelValue":e[36]||(e[36]=t=>w(j)?j.value=t:null)},{default:r(()=>[i(g,{value:"0"},{default:r(()=>[p("[选择规则集]")]),_:1}),(n(!0),s(T,null,O(u(K).sets,t=>(n(),B(g,{value:t.id},{default:r(()=>[p(_(t.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])])])):a("",!0)],2),i(Re,{secondary:"",size:"small",type:"button",onClick:$(I,["prevent"])},{default:r(()=>[p("确定")]),_:1}),p("   "),o("a",{href:"",onClick:$(ye,["prevent"]),title:"取消"},co)])):a("",!0),u(A)?a("",!0):(n(),s("div",_o,[i(be,{size:"small",onClick:$($e,["prevent"])})])),yo]))}};export{xo as _,So as a};
