mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-30 00:30:31 +08:00
[WAF]规则支持导入导出
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
<menu-item :href="'/servers/components/waf/ipadmin?firewallPolicyId=' + firewallPolicyId" code="ipadmin">IP管理</menu-item>
|
||||
<menu-item :href="'/servers/components/waf/log?firewallPolicyId=' + firewallPolicyId" code="log">拦截日志</menu-item>
|
||||
<!-- TODO -->
|
||||
<!--<menu-item :href="'/servers/components/waf/test?firewallPolicyId=' + firewallPolicyId" code="test">测试</menu-item>
|
||||
<!--<menu-item :href="'/servers/components/waf/test?firewallPolicyId=' + firewallPolicyId" code="test">测试</menu-item>-->
|
||||
<menu-item :href="'/servers/components/waf/import?firewallPolicyId=' + firewallPolicyId" code="import">导入</menu-item>
|
||||
<menu-item :href="'/servers/components/waf/export?firewallPolicyId=' + firewallPolicyId" code="export">导出</menu-item>-->
|
||||
<menu-item :href="'/servers/components/waf/export?firewallPolicyId=' + firewallPolicyId" code="export">导出</menu-item>
|
||||
<menu-item :href="'/servers/components/waf/update?firewallPolicyId=' + firewallPolicyId" code="update">修改</menu-item>
|
||||
</second-menu>
|
||||
7
web/views/@default/servers/components/waf/export.css
Normal file
7
web/views/@default/servers/components/waf/export.css
Normal file
@@ -0,0 +1,7 @@
|
||||
.groups-box .group-box {
|
||||
float: left;
|
||||
width: 11em;
|
||||
margin-top: 0.1em;
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
/*# sourceMappingURL=export.css.map */
|
||||
1
web/views/@default/servers/components/waf/export.css.map
Normal file
1
web/views/@default/servers/components/waf/export.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["export.less"],"names":[],"mappings":"AAAA,WACC;EACC,WAAA;EACA,WAAA;EACA,iBAAA;EACA,oBAAA","file":"export.css"}
|
||||
@@ -1,5 +1,33 @@
|
||||
{$layout}
|
||||
{$template "waf_menu"}
|
||||
|
||||
{$template "waf_menu"}
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="firewallPolicyId" :value="firewallPolicyId"/>
|
||||
|
||||
<p class="ui message">此功能暂未开放,敬请期待。</p>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">选择入站规则</td>
|
||||
<td>
|
||||
<span v-if="inboundGroups.length == 0" class="disabled">暂时还没有入站规则。</span>
|
||||
<div class="groups-box" v-show="inboundGroups.length > 0">
|
||||
<div v-for="g in inboundGroups" class="group-box">
|
||||
<checkbox name="inboundGroupIds" :value="true" :v-value="g.id">{{g.name}}</checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>选择出站规则</td>
|
||||
<td>
|
||||
<span v-if="outboundGroups.length == 0" class="disabled">暂时还没有出站规则。</span>
|
||||
<div class="groups-box" v-show="outboundGroups.length > 0">
|
||||
<div v-for="g in outboundGroups" class="group-box">
|
||||
<checkbox name="outboundGroupIds" :value="true" :v-value="g.id">{{g.name}}</checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn>导出</submit-btn>
|
||||
</form>
|
||||
5
web/views/@default/servers/components/waf/export.js
Normal file
5
web/views/@default/servers/components/waf/export.js
Normal file
@@ -0,0 +1,5 @@
|
||||
Tea.context(function () {
|
||||
this.success = function (resp) {
|
||||
window.location = "/servers/components/waf/exportDownload?key=" + resp.data.key
|
||||
}
|
||||
})
|
||||
8
web/views/@default/servers/components/waf/export.less
Normal file
8
web/views/@default/servers/components/waf/export.less
Normal file
@@ -0,0 +1,8 @@
|
||||
.groups-box {
|
||||
.group-box {
|
||||
float: left;
|
||||
width: 11em;
|
||||
margin-top: 0.1em;
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,16 @@
|
||||
{$layout}
|
||||
{$template "waf_menu"}
|
||||
|
||||
{$template "waf_menu"}
|
||||
|
||||
<p class="ui message">此功能暂未开放,敬请期待。</p>
|
||||
<form method="post" class="ui form" data-tea-success="success" data-tea-action="$">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="firewallPolicyId" :value="firewallPolicyId"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">选择要倒入的规则文件</td>
|
||||
<td>
|
||||
<input type="file" name="file" accept=".json"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn>导入</submit-btn>
|
||||
</form>
|
||||
3
web/views/@default/servers/components/waf/import.js
Normal file
3
web/views/@default/servers/components/waf/import.js
Normal file
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("导入成功")
|
||||
})
|
||||
Reference in New Issue
Block a user