WAF规则增加备注信息/其他界面优化

This commit is contained in:
GoEdgeLab
2022-01-10 10:28:23 +08:00
parent 8efae182c9
commit 0e531443f2
10 changed files with 19 additions and 4 deletions

View File

@@ -61,6 +61,7 @@ func (this *CreateRulePopupAction) RunPost(params struct {
OptionsJSON []byte OptionsJSON []byte
Value string Value string
Case bool Case bool
Description string
Must *actions.Must Must *actions.Must
}) { }) {
@@ -91,6 +92,7 @@ func (this *CreateRulePopupAction) RunPost(params struct {
rule.Operator = params.Operator rule.Operator = params.Operator
rule.Value = params.Value rule.Value = params.Value
rule.IsCaseInsensitive = params.Case rule.IsCaseInsensitive = params.Case
rule.Description = params.Description
if len(params.OptionsJSON) > 0 { if len(params.OptionsJSON) > 0 {
options := []maps.Map{} options := []maps.Map{}

View File

@@ -87,6 +87,7 @@ func (this *GroupAction) RunGet(params struct {
"operator": rule.Operator, "operator": rule.Operator,
"value": rule.Value, "value": rule.Value,
"isCaseInsensitive": rule.IsCaseInsensitive, "isCaseInsensitive": rule.IsCaseInsensitive,
"description": rule.Description,
"isComposed": firewallconfigs.CheckCheckpointIsComposed(rule.Prefix()), "isComposed": firewallconfigs.CheckCheckpointIsComposed(rule.Prefix()),
"checkpointOptions": rule.CheckpointOptions, "checkpointOptions": rule.CheckpointOptions,
"err": errString, "err": errString,

View File

@@ -85,6 +85,7 @@ func (this *GroupAction) RunGet(params struct {
"operator": rule.Operator, "operator": rule.Operator,
"value": rule.Value, "value": rule.Value,
"isCaseInsensitive": rule.IsCaseInsensitive, "isCaseInsensitive": rule.IsCaseInsensitive,
"description": rule.Description,
"isComposed": firewallconfigs.CheckCheckpointIsComposed(rule.Prefix()), "isComposed": firewallconfigs.CheckCheckpointIsComposed(rule.Prefix()),
"checkpointOptions": rule.CheckpointOptions, "checkpointOptions": rule.CheckpointOptions,
"err": errString, "err": errString,

View File

@@ -85,6 +85,7 @@ func (this *GroupAction) RunGet(params struct {
"operator": rule.Operator, "operator": rule.Operator,
"value": rule.Value, "value": rule.Value,
"isCaseInsensitive": rule.IsCaseInsensitive, "isCaseInsensitive": rule.IsCaseInsensitive,
"description": rule.Description,
"isComposed": firewallconfigs.CheckCheckpointIsComposed(rule.Prefix()), "isComposed": firewallconfigs.CheckCheckpointIsComposed(rule.Prefix()),
"checkpointOptions": rule.CheckpointOptions, "checkpointOptions": rule.CheckpointOptions,
"err": errString, "err": errString,

View File

@@ -14,7 +14,7 @@ Vue.component("http-firewall-rule-label", {
}, },
template: `<div> template: `<div>
<div class="ui label tiny basic"> <div class="ui label tiny basic" style="line-height: 1.5">
{{rule.name}}[{{rule.param}}] {{rule.name}}[{{rule.param}}]
<!-- cc2 --> <!-- cc2 -->
@@ -33,6 +33,9 @@ Vue.component("http-firewall-rule-label", {
{{rule.value}} {{rule.value}}
</span> </span>
<!-- description -->
<span v-if="rule.description != null && rule.description.length > 0" class="grey small">{{rule.description}}</span>
<a href="" v-if="rule.err != null && rule.err.length > 0" @click.prevent="showErr(rule.err)" style="color: #db2828; opacity: 1; border-bottom: 1px #db2828 dashed; margin-left: 0.5em">规则错误</a> <a href="" v-if="rule.err != null && rule.err.length > 0" @click.prevent="showErr(rule.err)" style="color: #db2828; opacity: 1; border-bottom: 1px #db2828 dashed; margin-left: 0.5em">规则错误</a>
</div> </div>
</div>` </div>`

View File

@@ -55,6 +55,9 @@ Vue.component("http-firewall-rules-box", {
<span v-if="rule.paramFilters != null && rule.paramFilters.length > 0" v-for="paramFilter in rule.paramFilters"> | {{paramFilter.code}}</span> <var>{{rule.operator}}</var> {{rule.value}} <span v-if="rule.paramFilters != null && rule.paramFilters.length > 0" v-for="paramFilter in rule.paramFilters"> | {{paramFilter.code}}</span> <var>{{rule.operator}}</var> {{rule.value}}
</span> </span>
<!-- description -->
<span v-if="rule.description != null && rule.description.length > 0" class="grey small">{{rule.description}}</span>
<a href="" title="修改" @click.prevent="updateRule(index, rule)"><i class="icon pencil small"></i></a> <a href="" title="修改" @click.prevent="updateRule(index, rule)"><i class="icon pencil small"></i></a>
<a href="" title="删除" @click.prevent="removeRule(index)"><i class="icon remove"></i></a> <a href="" title="删除" @click.prevent="removeRule(index)"><i class="icon remove"></i></a>
</div> </div>

View File

@@ -140,6 +140,10 @@
<td> <td>
<http-firewall-param-filters-box :v-filters="rule.paramFilters"></http-firewall-param-filters-box> <http-firewall-param-filters-box :v-filters="rule.paramFilters"></http-firewall-param-filters-box>
</td> </td>
</tr>
<tr>
<td>备注</td>
<td><input type="text" name="description" v-model="rule.description"/></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@@ -46,7 +46,7 @@
<tbody v-for="set in sets" :data-set-id="set.id"> <tbody v-for="set in sets" :data-set-id="set.id">
<tr> <tr>
<td style="text-align: center;"><i class="icon bars handle grey"></i> </td> <td style="text-align: center;"><i class="icon bars handle grey"></i> </td>
<td nowrap=""><a href="" @click.prevent="updateSet(set.id)"><span :class="{disabled:!set.isOn}">{{set.name}}</span></a> <td nowrap=""><a href="" @click.prevent="updateSet(set.id)"><span :class="{disabled:!set.isOn}">{{set.name}}</span> <i class="icon clone outline small"></i> </a>
<p style="margin-top:0.5em"> <p style="margin-top:0.5em">
<label-on :v-is-on="set.isOn"></label-on> <label-on :v-is-on="set.isOn"></label-on>
</p> </p>

View File

@@ -41,7 +41,7 @@
<tbody v-for="set in sets" :data-set-id="set.id"> <tbody v-for="set in sets" :data-set-id="set.id">
<tr> <tr>
<td style="text-align: center;"><i class="icon bars handle grey"></i> </td> <td style="text-align: center;"><i class="icon bars handle grey"></i> </td>
<td nowrap=""><a href="" @click.prevent="updateSet(set.id)"><span :class="{disabled:!set.isOn}">{{set.name}}</span></a> <td nowrap=""><a href="" @click.prevent="updateSet(set.id)"><span :class="{disabled:!set.isOn}">{{set.name}}</span> <i class="icon clone outline small"></i></a>
<p style="margin-top:0.5em"> <p style="margin-top:0.5em">
<label-on :v-is-on="set.isOn"></label-on> <label-on :v-is-on="set.isOn"></label-on>
</p> </p>

View File

@@ -42,7 +42,7 @@
<tbody v-for="set in sets" :data-set-id="set.id"> <tbody v-for="set in sets" :data-set-id="set.id">
<tr> <tr>
<td style="text-align: center;"><i class="icon bars handle grey"></i> </td> <td style="text-align: center;"><i class="icon bars handle grey"></i> </td>
<td nowrap=""><a href="" @click.prevent="updateSet(set.id)"><span :class="{disabled:!set.isOn}">{{set.name}}</span></a> <td nowrap=""><a href="" @click.prevent="updateSet(set.id)"><span :class="{disabled:!set.isOn}">{{set.name}}</span> <i class="icon clone outline small"></i></a>
<p style="margin-top:0.5em"> <p style="margin-top:0.5em">
<label-on :v-is-on="set.isOn"></label-on> <label-on :v-is-on="set.isOn"></label-on>
</p> </p>