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-DA7OTM4Q.js";import{P as $}from"./app-YXi6Hc2l.js";import{i as b,c as P}from"./app-BT68AfZ-.js";import{_ as k}from"./app-DuUYZNNT.js";import{_ as x,a as I}from"./app-BHFzVhjx.js";import{_ as V}from"./app-DokSVapq.js";import{_ as h}from"./app-a9KqBnqw.js";import{_ as D}from"./app-BMjG4tWp.js";import{_ as S}from"./app-CKSEN_Rg.js";import{T}from"./app-up4gT9D9.js";import{_ as F,a as N}from"./app-uBpw-HYG.js";import{_ as B}from"./app-D2gM4iLU.js";import{D as E}from"./app-DNL2FXPk.js";import"./app-BlCBGn5D.js";import"./app-DSiZNBrr.js";import"./app-C5ROEzFd.js";import"./app-Bnbo6OlJ.js";import"./app-Dxa5h-uG.js";import"./app-AbPAjGV5.js";import"./app-BqY8p2gl.js";import"./app-C-GI59rl.js";import"./app-BotiHebp.js";import"./app-KNE_24OY.js";import"./app-Zes_jb7S.js";import"./app-D29bbm9n.js";import"./app-B_5dka6q.js";import"./app-CQwVTjAx.js";import"./app-CHxME8Sw.js";import"./app-BkWUIifj.js";import"./app-DEIWLCpe.js";import"./app-Daq_vi_n.js";import"./app-Bll_3-lM.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};
