import{o as a,c as d,w as r,b as i,a as o,u as e,d as c,e as u,g as p,D as _,f as g,t as f,F as C,h as y}from"./app-DnroACXc.js";import{P as v}from"./app-CyTk3GnO.js";import{i as V,c as $}from"./app-DckefXYL.js";import{_ as S}from"./app-MnSDCF4P.js";import{_ as w}from"./app-DPkDcD7h.js";import{_ as P,a as b}from"./app-DntYVxd7.js";import{_ as x,a as I,b as D}from"./app-Dw9eOIJR.js";import{_ as h}from"./app-BbRQPmFH.js";import{_ as k}from"./app-COct4tsy.js";import{_ as E}from"./app-BdF_-Hag.js";import{D as O}from"./app-Cx7ENVlu.js";import"./app-CUqfl6on.js";import"./app-CF0qXH5Q.js";import"./app-BJhJ7lM8.js";import"./app-Dd07dUxy.js";import"./app-CYYQ_Zep.js";import"./app-Dpl5YSiv.js";import"./app-CF8nmC-F.js";import"./app-NVAx7Sc3.js";import"./app-xECxwo4T.js";import"./app-MtOp7vk3.js";import"./app-B8VsrFxM.js";import"./app-B09rlSqG.js";import"./app-z7Z_Uo-k.js";import"./app-LqsmzyUT.js";import"./app-BBDtZW3a.js";import"./app-BZyjLC2w.js";import"./app-DFWP-E91.js";import"./app-NF1oOHjK.js";import"./app-C0-Qcoum.js";import"./app-Do8DhyKT.js";import"./app-B4bUdtyo.js";function L(){V(this),this.success=this.$NotifyPopup,this.rules=this.setConfig.rules,this.selectedConnector=this.setConfig.connector,this.selectedConnectorDescription="",this.changeConnector=function(){let t=this;this.selectedConnectorDescription=this.connectors.$find(function(l,n){return n.value==t.selectedConnector}).description},this.changeConnector(),this.action=this.setConfig.action,this.actionGroupId=0,(this.action=="go_group"||this.action=="go_set"&&this.setConfig.actionOptions!=null)&&this.$delay(function(){this.actionGroupId=this.setConfig.actionOptions.groupId}),this.actionSetId=0,this.action=="go_set"&&this.setConfig.actionOptions!=null&&this.$delay(function(){this.actionSetId=this.setConfig.actionOptions.setId}),this.groupSets=function(t){if(this.firewallPolicy==null)return;let l=null;return this.firewallPolicy.inbound.groups.forEach(function(n){n.id==t&&(l=n)}),this.firewallPolicy.outbound.groups.forEach(function(n){n.id==t&&(l=n)}),l==null?[]:l.sets},this.hasScores=!1;const m=this;this.rules.forEach(function(t){t.score>0&&(m.hasScores=!0)})}const N=o("header",null,"修改规则集",-1),B=["value"],U=o("td",{class:"title"},"规则集名称 *",-1),F=o("p",{class:"comment"},"可以用来描述当前规则集用途。",-1),G=o("td",null,"规则 *",-1),R={style:{"word-break":"break-word"}},T=o("td",null,"规则之间的关系 *",-1),j={class:"comment"},q={key:0},z=o("td",null,"分值条件 *",-1),A=o("td",null,"执行动作 *",-1),H={colspan:"2"},J=o("td",null,"允许局域网IP",-1),K=o("p",{class:"comment"},"选中后表示如果请求来自局域网IP，则直接跳过当前规则集。",-1),M=o("td",null,"允许搜索引擎",-1),Q=o("p",{class:"comment"},"选中后，表示如果请求来自常见搜索引擎的IP，则直接跳过当前规则集。",-1),It={__name:"updateSetPopup",setup(m){const t=$(new L);return(l,n)=>(a(),d(v,null,{default:r(()=>[N,i(S,{action:"$",onSuccess:e(t).success},{default:r(()=>[o("input",{type:"hidden",name:"setId",value:e(t).setConfig.id},null,8,B),i(O,null,{default:r(()=>[o("tbody",null,[o("tr",null,[U,o("td",null,[i(w,{type:"text",name:"name",maxlength:"100",class:"w-full",autofocus:"",modelValue:e(t).setConfig.name,"onUpdate:modelValue":n[0]||(n[0]=s=>e(t).setConfig.name=s)},null,8,["modelValue"]),F])]),o("tr",null,[G,o("td",R,[i(x,{"v-rules":e(t).rules,"v-type":e(t).type,connector:e(t).selectedConnector},null,8,["v-rules","v-type","connector"])])]),c(o("tr",null,[T,o("td",null,[i(P,{name:"connector",onChange:n[1]||(n[1]=s=>e(t).changeConnector()),modelValue:e(t).selectedConnector,"onUpdate:modelValue":n[2]||(n[2]=s=>e(t).selectedConnector=s)},{default:r(()=>[(a(!0),p(C,null,_(e(t).connectors,s=>(a(),d(b,{value:s.value},{default:r(()=>[g(f(s.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"]),o("p",j,f(e(t).selectedConnectorDescription),1)])],512),[[u,e(t).rules.length>1&&!e(t).hasScores]]),e(t).hasScores?(a(),p("tr",q,[z,o("td",null,[i(I,{"score-rules":e(t).setConfig.scoreRules},null,8,["score-rules"])])])):y("",!0),o("tr",null,[A,o("td",null,[i(D,{"v-actions":e(t).actions,"v-firewall-policy":e(t).firewallPolicy,"v-action-configs":e(t).actionConfigs,"v-group-type":e(t).type},null,8,["v-actions","v-firewall-policy","v-action-configs","v-group-type"])])]),o("tr",null,[o("td",H,[i(E)])]),c(o("tr",null,[J,o("td",null,[i(h,{name:"ignoreLocal",modelValue:e(t).setConfig.ignoreLocal,"onUpdate:modelValue":n[3]||(n[3]=s=>e(t).setConfig.ignoreLocal=s)},null,8,["modelValue"]),K])],512),[[u,e(t).moreOptionsVisible]]),c(o("tr",null,[M,o("td",null,[i(h,{name:"ignoreSearchEngine",modelValue:e(t).setConfig.ignoreSearchEngine,"onUpdate:modelValue":n[4]||(n[4]=s=>e(t).setConfig.ignoreSearchEngine=s)},null,8,["modelValue"]),Q])],512),[[u,e(t).moreOptionsVisible]])])]),_:1}),i(k)]),_:1},8,["onSuccess"])]),_:1}))}};export{It as default};
