import{i as I,c as F}from"./app-Ba7ZqSpq.js";import{_ as P}from"./app-Cft_lrsr.js";import{_ as k}from"./app-DJCl4rzT.js";import{_ as A}from"./app-rIYFLdeU.js";import{_ as R}from"./app-DWUwCFNm.js";import{_ as S}from"./app-DFulsyXy.js";import{r as m,J as G,o as n,g as r,a as o,u as e,b as s,w as u,c as y,h as p,d as v,e as h,f as C,F as d,D as T,t as b,bb as N}from"./app-SC54XQDl.js";import{_ as B,a as $}from"./app-PrSv7rSt.js";import{_ as D}from"./app-DkOT0Z3c.js";import{_ as W}from"./app-DjJGwY8P.js";import{_ as V}from"./app-FlPLZh9D.js";import"./app-CHxME8Sw.js";import{D as J}from"./app-ZeVDYyDS.js";import"./app-qhR41k1m.js";import"./app-CS3AUTAk.js";import"./app-CCkWSX4Q.js";import"./app-Dhl-Bw0H.js";import"./app-BjSCO7rC.js";import"./app-CL60OiIv.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";import"./app-B2C_dtYI.js";import"./app-COidJXl1.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-CNHjdV6U.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-DgoEZtNT.js";import"./app-Dw0jKdCD.js";import"./app-DnXuoh8P.js";import"./app-DZaelcLs.js";function L(){I(this),this.success=this.$NotifyReloadSuccess("保存成功")}const U=["value"],E=o("td",{class:"title"},"启用Web防火墙",-1),H=o("p",{class:"comment"},"选中后，表示启用当前网站的WAF功能。",-1),Y=o("td",null,"人机识别验证方式",-1),j={key:0,class:"comment"},q={key:0,class:"comment"},z=o("td",null,"启用系统全局规则",-1),K=o("p",{class:"comment"},"选中后，表示使用系统全局WAF策略中定义的规则。",-1),M=o("div",{class:"margin"},null,-1),Q={__name:"HTTPFirewallConfigBox",props:["v-firewall-config","v-is-location","v-is-group","v-firewall-policy"],setup(g){const i=g,{firewall:a,moreOptionsVisible:_,execGlobalRules:f,captchaTypes:w,geeTestIsOn:O}=function(){let t=i.vFirewallConfig;t==null&&(t={isPrior:!1,isOn:!1,firewallPolicyId:0,ignoreGlobalRules:!1,defaultCaptchaType:"none"}),(t.defaultCaptchaType==null||t.defaultCaptchaType.length==0)&&(t.defaultCaptchaType="none");let c=window.WAF_CAPTCHA_TYPES.$copy(),l=!1;return i.vFirewallPolicy!=null&&i.vFirewallPolicy.captchaAction!=null&&i.vFirewallPolicy.captchaAction.geeTestConfig!=null&&(l=i.vFirewallPolicy.captchaAction.geeTestConfig.isOn),!l&&t.defaultCaptchaType=="geetest"&&(t.defaultCaptchaType="none"),{firewall:m(t),moreOptionsVisible:m(!1),execGlobalRules:m(!t.ignoreGlobalRules),captchaTypes:m(c),geeTestIsOn:m(l)}}(),x=function(t){_.value=t};return G(f,function(t){a.value.ignoreGlobalRules=!t}),(t,c)=>(n(),r("div",null,[o("input",{type:"hidden",name:"firewallJSON",value:JSON.stringify(e(a))},null,8,U),s(J,null,{default:u(()=>[t.vIsLocation||t.vIsGroup?(n(),y(D,{key:0,"v-config":e(a)},null,8,["v-config"])):p("",!0),v(o("tbody",null,[o("tr",null,[E,o("td",null,[s(V,{modelValue:e(a).isOn,"onUpdate:modelValue":c[0]||(c[0]=l=>e(a).isOn=l)},null,8,["modelValue"]),H])])],512),[[h,!t.vIsLocation&&!t.vIsGroup||e(a).isPrior]]),v(s(W,{onChange:x},null,512),[[h,e(a).isOn]]),v(o("tbody",null,[o("tr",null,[Y,o("td",null,[s(B,{modelValue:e(a).defaultCaptchaType,"onUpdate:modelValue":c[1]||(c[1]=l=>e(a).defaultCaptchaType=l)},{default:u(()=>[s($,{value:"none"},{default:u(()=>[C("默认")]),_:1}),(n(!0),r(d,null,T(e(w),l=>(n(),r(d,null,[l.code!="geetest"||e(O)?(n(),y($,{key:0,value:l.code},{default:u(()=>[C(b(l.name),1)]),_:2},1032,["value"])):p("",!0)],64))),256))]),_:1},8,["modelValue"]),e(a).defaultCaptchaType=="none"?(n(),r("p",j,"使用系统默认的设置。你需要在入站规则中添加规则集来决定哪些请求需要人机识别验证。")):p("",!0),(n(!0),r(d,null,T(e(w),l=>(n(),r(d,null,[l.code==e(a).defaultCaptchaType?(n(),r("p",q,b(l.description)+"你需要在入站规则中添加规则集来决定哪些请求需要人机识别验证。",1)):p("",!0)],64))),256))])]),o("tr",null,[z,o("td",null,[s(V,{modelValue:e(f),"onUpdate:modelValue":c[2]||(c[2]=l=>N(f)?f.value=l:null)},null,8,["modelValue"]),K])])],512),[[h,e(_)]])]),_:1}),M]))}},X={key:0},Z=["value"],ee={key:1},De={__name:"index",setup(g){const i=F(new L);return(a,_)=>(n(),y(P,{ctx:e(i)},{default:u(()=>[s(k,{ctx:e(i),"active-tab":"index"},null,8,["ctx"]),e(i).featureIsOn?(n(),r("div",X,[s(S,{action:"$",onSuccess:e(i).success},{default:u(()=>[o("input",{type:"hidden",name:"webId",value:e(i).webId},null,8,Z),s(Q,{"v-firewall-config":e(i).firewallConfig,"v-firewall-policy":e(i).firewallPolicy},null,8,["v-firewall-config","v-firewall-policy"]),s(R)]),_:1},8,["onSuccess"])])):p("",!0),e(i).featureIsOn?p("",!0):(n(),r("div",ee,[s(A)]))]),_:1},8,["ctx"]))}};export{De as default};
