mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	WAF允许ALLOW动作增加有效范围
This commit is contained in:
		@@ -85,6 +85,8 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
			ipListLevels: [],
 | 
								ipListLevels: [],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// 动作参数
 | 
								// 动作参数
 | 
				
			||||||
 | 
								allowScope: "global",
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			blockTimeout: "",
 | 
								blockTimeout: "",
 | 
				
			||||||
			blockTimeoutMax: "",
 | 
								blockTimeoutMax: "",
 | 
				
			||||||
			blockScope: "global",
 | 
								blockScope: "global",
 | 
				
			||||||
@@ -140,6 +142,9 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
			})
 | 
								})
 | 
				
			||||||
			this.actionOptions = {}
 | 
								this.actionOptions = {}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
 | 
							allowScope: function (v) {
 | 
				
			||||||
 | 
								this.actionOptions["scope"] = v
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
		blockTimeout: function (v) {
 | 
							blockTimeout: function (v) {
 | 
				
			||||||
			v = parseInt(v)
 | 
								v = parseInt(v)
 | 
				
			||||||
			if (isNaN(v)) {
 | 
								if (isNaN(v)) {
 | 
				
			||||||
@@ -279,6 +284,8 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
			this.actionOptions = {}
 | 
								this.actionOptions = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// 动作参数
 | 
								// 动作参数
 | 
				
			||||||
 | 
								this.allowScope = "global"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			this.blockTimeout = ""
 | 
								this.blockTimeout = ""
 | 
				
			||||||
			this.blockTimeoutMax = ""
 | 
								this.blockTimeoutMax = ""
 | 
				
			||||||
			this.blockScope = "global"
 | 
								this.blockScope = "global"
 | 
				
			||||||
@@ -363,6 +370,11 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
					}
 | 
										}
 | 
				
			||||||
					break
 | 
										break
 | 
				
			||||||
				case "allow":
 | 
									case "allow":
 | 
				
			||||||
 | 
										if (config.options != null && config.options.scope != null && config.options.scope.length > 0) {
 | 
				
			||||||
 | 
											this.allowScope = config.options.scope
 | 
				
			||||||
 | 
										} else {
 | 
				
			||||||
 | 
											this.allowScope = "global"
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
					break
 | 
										break
 | 
				
			||||||
				case "log":
 | 
									case "log":
 | 
				
			||||||
					break
 | 
										break
 | 
				
			||||||
@@ -674,6 +686,13 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
		<div v-for="(config, index) in configs" :data-index="index" :key="config.id" class="ui label small basic" :class="{blue: index == editingIndex}" style="margin-bottom: 0.4em">
 | 
							<div v-for="(config, index) in configs" :data-index="index" :key="config.id" class="ui label small basic" :class="{blue: index == editingIndex}" style="margin-bottom: 0.4em">
 | 
				
			||||||
			{{config.name}} <span class="small">({{config.code.toUpperCase()}})</span> 
 | 
								{{config.name}} <span class="small">({{config.code.toUpperCase()}})</span> 
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
 | 
								<!-- allow -->
 | 
				
			||||||
 | 
								<span class="small" v-if="config.code == 'allow' && config.options != null && config.options.scope != null && config.options.scope.length > 0">
 | 
				
			||||||
 | 
									<span v-if="config.options.scope == 'group'">[分组]</span>
 | 
				
			||||||
 | 
									<span v-if="config.options.scope == 'server'">[网站]</span>
 | 
				
			||||||
 | 
									<span v-if="config.options.scope == 'global'">[网站和策略]</span>
 | 
				
			||||||
 | 
								</span>
 | 
				
			||||||
 | 
								
 | 
				
			||||||
			<!-- block -->
 | 
								<!-- block -->
 | 
				
			||||||
			<span v-if="config.code == 'block' && config.options.timeout > 0">:封禁时长{{config.options.timeout}}<span v-if="config.options.timeoutMax > config.options.timeout">-{{config.options.timeoutMax}}</span>秒</span>
 | 
								<span v-if="config.code == 'block' && config.options.timeout > 0">:封禁时长{{config.options.timeout}}<span v-if="config.options.timeoutMax > config.options.timeout">-{{config.options.timeoutMax}}</span>秒</span>
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
@@ -712,7 +731,7 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
			<span v-if="config.code == 'go_set'">:{{config.options.groupName}} / {{config.options.setName}}</span>
 | 
								<span v-if="config.code == 'go_set'">:{{config.options.groupName}} / {{config.options.setName}}</span>
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
			<!-- 范围 -->
 | 
								<!-- 范围 -->
 | 
				
			||||||
			<span v-if="config.options.scope != null && config.options.scope.length > 0" class="small grey">
 | 
								<span v-if="config.code != 'allow' && config.options.scope != null && config.options.scope.length > 0" class="small grey">
 | 
				
			||||||
				  
 | 
									  
 | 
				
			||||||
				<span v-if="config.options.scope == 'global'">[所有网站]</span>
 | 
									<span v-if="config.options.scope == 'global'">[所有网站]</span>
 | 
				
			||||||
				<span v-if="config.options.scope == 'service'">[当前网站]</span>
 | 
									<span v-if="config.options.scope == 'service'">[当前网站]</span>
 | 
				
			||||||
@@ -735,6 +754,21 @@ Vue.component("http-firewall-actions-box", {
 | 
				
			|||||||
				</td>
 | 
									</td>
 | 
				
			||||||
			</tr>
 | 
								</tr>
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
 | 
								<!-- allow -->
 | 
				
			||||||
 | 
								<tr v-if="actionCode == 'allow'">
 | 
				
			||||||
 | 
									<td>有效范围</td>
 | 
				
			||||||
 | 
									<td>
 | 
				
			||||||
 | 
										<select class="ui dropdown auto-width" v-model="allowScope">
 | 
				
			||||||
 | 
											<option value="group">分组</option>
 | 
				
			||||||
 | 
											<option value="server">网站</option>
 | 
				
			||||||
 | 
											<option value="global">网站和策略</option>
 | 
				
			||||||
 | 
										</select>
 | 
				
			||||||
 | 
										<p class="comment" v-if="allowScope == 'group'">跳过当前分组其他规则集,继续执行其他分组的规则集。</p>
 | 
				
			||||||
 | 
										<p class="comment" v-if="allowScope == 'server'">跳过当前网站所有的规则集。</p>
 | 
				
			||||||
 | 
										<p class="comment" v-if="allowScope =='global'">跳过当前网站和网站对应WAF策略所有的规则集。</p>
 | 
				
			||||||
 | 
									</td>
 | 
				
			||||||
 | 
								</tr>
 | 
				
			||||||
 | 
								
 | 
				
			||||||
			<!-- block -->
 | 
								<!-- block -->
 | 
				
			||||||
			<tr v-if="actionCode == 'block'">
 | 
								<tr v-if="actionCode == 'block'">
 | 
				
			||||||
				<td>封禁范围</td>
 | 
									<td>封禁范围</td>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,11 @@ Vue.component("http-firewall-actions-view", {
 | 
				
			|||||||
			<span :class="{red: action.category == 'block', orange: action.category == 'verify', green: action.category == 'allow'}">{{action.name}} ({{action.code.toUpperCase()}})
 | 
								<span :class="{red: action.category == 'block', orange: action.category == 'verify', green: action.category == 'allow'}">{{action.name}} ({{action.code.toUpperCase()}})
 | 
				
			||||||
			  	<div v-if="action.options != null">
 | 
								  	<div v-if="action.options != null">
 | 
				
			||||||
			  		<span class="grey small" v-if="action.code.toLowerCase() == 'page'">[{{action.options.status}}]</span>
 | 
								  		<span class="grey small" v-if="action.code.toLowerCase() == 'page'">[{{action.options.status}}]</span>
 | 
				
			||||||
 | 
								  		<span class="grey small" v-if="action.code.toLowerCase() == 'allow' && action.options != null && action.options.scope != null && action.options.scope.length > 0">
 | 
				
			||||||
 | 
								  			<span v-if="action.options.scope == 'group'">[分组]</span>
 | 
				
			||||||
 | 
											<span v-if="action.options.scope == 'server'">[网站]</span>
 | 
				
			||||||
 | 
											<span v-if="action.options.scope == 'global'">[网站和策略]</span>	
 | 
				
			||||||
 | 
										</span>
 | 
				
			||||||
				</div>	
 | 
									</div>	
 | 
				
			||||||
			</span>
 | 
								</span>
 | 
				
			||||||
		</div>             
 | 
							</div>             
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user