import{r as C,o as r,c as m,w as c,u as o,f as p,h as y,b as s,a as t,i as v,g as _,d as u,e as d,D as g,t as f,F as w}from"./app-SC54XQDl.js";import{P as $}from"./app-BGgVpkqZ.js";import{i as b,c as P}from"./app-Ba7ZqSpq.js";import{_ as k}from"./app-CVQkwzlf.js";import{_ as x,a as I}from"./app-PrSv7rSt.js";import{_ as V}from"./app-DFulsyXy.js";import{_ as h}from"./app-FlPLZh9D.js";import{_ as D}from"./app-T1ysvErZ.js";import{_ as S}from"./app-DWUwCFNm.js";import{T}from"./app-C28obFWS.js";import{_ as F,a as N}from"./app-B_Y0qfbu.js";import{_ as B}from"./app-huVLEujn.js";import{D as E}from"./app-ZeVDYyDS.js";import"./app-yUrwy8EY.js";import"./app-DnXuoh8P.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-PPG0ZS4d.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-CCkWSX4Q.js";import"./app-DZaelcLs.js";import"./app-CNHjdV6U.js";import"./app-CkINxBL9.js";import"./app--Lj8zATS.js";import"./app-C2mBgI5Z.js";import"./app-CHxME8Sw.js";import"./app-DoVkxbmA.js";import"./app-BxWqoSpr.js";import"./app-BzdF9mA3.js";import"./app-nyOoGAKT.js";import"./app-C0-Qcoum.js";function A(){b(this),this.success=this.$NotifyPopup,this.rules=[],this.selectedConnector=this.connectors[0].value,this.selectedConnectorDescription="",this.changeConnector=function(){let a=this;this.selectedConnectorDescription=this.connectors.$find(function(n,e){return e.value==a.selectedConnector}).description},this.changeConnector(),this.action="block",this.actionGroupId=0,this.actionSetId=0,this.groupSets=function(a){let n=null;return this.firewallPolicy.inbound.groups.forEach(function(e){e.id==a&&(n=e)}),this.firewallPolicy.outbound.groups.forEach(function(e){e.id==a&&(n=e)}),n==null?[]:n.sets},this.useCode=!1,this.switchToCode=function(){this.useCode=!this.useCode,this.useCode&&this.$delay(function(){this.$refs.codeInput.focus()})}}const L=t("header",null,"添加规则集",-1),W=["value"],G=["value"],M=t("td",{class:"title"},"规则集名称 *",-1),O={class:"comment"},R={key:0},U={key:1},j=t("td",null,"规则 *",-1),q=t("td",null,"规则之间的关系 *",-1),z={class:"comment"},H=t("td",null,"执行动作 *",-1),J={colspan:"2"},K=t("td",null,"允许局域网IP",-1),Q=t("p",{class:"comment"},"选中后，表示如果请求来自局域网IP，则直接跳过当前规则集。",-1),X=t("td",null,"允许搜索引擎",-1),Y=t("p",{class:"comment"},"选中后，表示如果请求来自常见搜索引擎的IP，则直接跳过当前规则集。",-1),Z=t("td",null,"规则集代码 *",-1),Bt={__name:"createSetPopup",setup(a){const n=C(),e=P(new A,{refs:{codeInput:n}});return(tt,l)=>(r(),m($,null,{default:c(()=>[L,o(e).isGlobalPolicy?(r(),m(T,{key:0,class:"mt-2 mb-4"},{default:c(()=>[p("当前设置的规则集为WAF策略的规则集，将会应用于对应集群已经启用WAF的网站；如果你只是想设置某个网站相关的规则集，请到对应网站WAF功能中设置。")]),_:1})):y("",!0),s(V,{action:"$",onSuccess:o(e).success},{default:c(()=>[t("input",{type:"hidden",name:"groupId",value:o(e).groupId},null,8,W),t("input",{type:"hidden",name:"formType",value:o(e).useCode?"code":"normal"},null,8,G),s(E,null,{default:c(()=>[t("tbody",null,[t("tr",null,[M,t("td",null,[s(k,{type:"text",name:"name",maxlength:"100",class:"w-full",autofocus:""}),t("p",O,[p("可以用来描述当前规则集用途。"),t("a",{href:"",onClick:l[0]||(l[0]=v((...i)=>o(e).switchToCode&&o(e).switchToCode(...i),["prevent"]))},[o(e).useCode?(r(),_("span",U,"[切换到常规表单]")):(r(),_("span",R,"[使用代码]"))])])])])]),u(t("tbody",null,[t("tr",null,[j,t("td",null,[s(F,{"v-rules":o(e).rules,"v-type":o(e).type,connector:o(e).selectedConnector},null,8,["v-rules","v-type","connector"])])]),u(t("tr",null,[q,t("td",null,[s(x,{name:"connector",onChange:l[1]||(l[1]=i=>o(e).changeConnector()),modelValue:o(e).selectedConnector,"onUpdate:modelValue":l[2]||(l[2]=i=>o(e).selectedConnector=i)},{default:c(()=>[(r(!0),_(w,null,g(o(e).connectors,i=>(r(),m(I,{value:i.value},{default:c(()=>[p(f(i.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"]),t("p",z,f(o(e).selectedConnectorDescription),1)])],512),[[d,o(e).rules.length>1]]),t("tr",null,[H,t("td",null,[s(N,{"v-actions":o(e).actions,"v-firewall-policy":o(e).firewallPolicy,"v-group-type":o(e).type},null,8,["v-actions","v-firewall-policy","v-group-type"])])]),t("tr",null,[t("td",J,[s(B)])]),u(t("tr",null,[K,t("td",null,[s(h,{name:"ignoreLocal"}),Q])],512),[[d,o(e).moreOptionsVisible]]),u(t("tr",null,[X,t("td",null,[s(h,{name:"ignoreSearchEngine"}),Y])],512),[[d,o(e).moreOptionsVisible]])],512),[[d,!o(e).useCode]]),u(t("tbody",null,[t("tr",null,[Z,t("td",null,[s(D,{name:"code",ref_key:"codeInput",ref:n,placeholder:"{ ... 规则集代码  ... }",rows:"20",class:"w-full"},null,512)])])],512),[[d,o(e).useCode]])]),_:1}),s(S)]),_:1},8,["onSuccess"])]),_:1}))}};export{Bt as default};
