[waf]支持包含二进制、不支持二进制等操作符;支持对参数值编解码

This commit is contained in:
GoEdgeLab
2020-11-21 20:43:45 +08:00
parent 64e71fad5d
commit da795cfdd7
7 changed files with 120 additions and 13 deletions

View File

@@ -20,13 +20,15 @@
<p class="comment" v-if="checkpoint != null"><span class="ui label tiny">${<em style="font-style: normal;">{{checkpoint.prefix}}</em>}</span>{{checkpoint.description}}</p>
</td>
</tr>
<!-- 参数名 -->
<tr v-if="checkpoint != null && checkpoint.hasParams">
<td>参数名</td>
<td>
<select name="param" v-model="rule.checkpointParam" class="ui dropdown auto-width" v-if="checkpoint.params != null">
<option v-for="o in checkpoint.params" :value="o.value">{{o.name}}</option>
</select>
<input type="text" maxlength="100" v-model="rule.checkpointParam" v-if="checkpoint.params == null"/>
<input type="text" name="param" maxlength="100" v-model="rule.checkpointParam" v-if="checkpoint.params == null"/>
</td>
</tr>
@@ -40,6 +42,14 @@
</tr>
</tbody>
<!-- 参数过滤器 -->
<tr v-if="checkpoint != null && !checkpoint.isComposed">
<td>编解码</td>
<td>
<http-firewall-param-filters-box :v-filters="rule.paramFilters"></http-firewall-param-filters-box>
</td>
</tr>
<!-- 选项 -->
<tbody v-if="checkpoint != null && !checkpoint.isComposed && checkpoint.options != null && checkpoint.options.length > 0">
<tr v-for="option in checkpoint.options">
@@ -91,7 +101,18 @@
<tr>
<td>对比值</td>
<td>
<textarea rows="3" maxlength="4096" name="value" v-model="rule.value"></textarea>
<!-- 二进制数据 -->
<div v-if="rule.operator != 'contains binary'">
<textarea rows="3" maxlength="4096" name="value" v-model="rule.value"></textarea>
<p class="comment">将二进制进行Base64Encode后放在这里比如<code-label>Hello</code-label>对应<code-label>SGVsbG8=</code-label></p>
</div>
<div v-else-if="rule.operator != 'not contains binary'">
<textarea rows="3" maxlength="4096" name="value" v-model="rule.value"></textarea>
<p class="comment">将二进制进行Base64Encode后放在这里比如<code-label>Hello</code-label>对应<code-label>SGVsbG8=</code-label></p>
</div>
<!-- 其余数据 -->
<textarea rows="3" maxlength="4096" name="value" v-model="rule.value" v-else></textarea>
</td>
</tr>
</tbody>

View File

@@ -5,6 +5,7 @@ Tea.context(function () {
this.rule = {
id: 0,
param: "",
paramFilters: [],
checkpointPrefix: "",
checkpointParam: "",
value: "",

View File

@@ -48,7 +48,7 @@
</td>
<td class="rules-box">
<div v-for="rule in set.rules" style="margin-top: 0.4em;margin-bottom:0.4em">
<span class="ui label tiny basic">{{rule.name}}[{{rule.param}}] <var :class="{dash:rule.isCaseInsensitive}" :title="rule.isCaseInsensitive ? '大小写不敏感':''" v-if="!rule.isComposed">{{rule.operator}}</var> {{rule.value}}</span>
<span class="ui label tiny basic">{{rule.name}}[{{rule.param}}] <span v-if="rule.paramFilters != null && rule.paramFilters.length > 0" v-for="paramFilter in rule.paramFilters"> | {{paramFilter.code}}</span> <var :class="{dash:rule.isCaseInsensitive}" :title="rule.isCaseInsensitive ? '大小写不敏感':''" v-if="!rule.isComposed">{{rule.operator}}</var> {{rule.value}}</span>
</div>
<span class="ui disabled" v-if="set.rules.length == 0">暂时还没有规则</span>
</td>