IP列表增加名单类型筛选

This commit is contained in:
GoEdgeLab
2022-04-21 15:09:24 +08:00
parent ef2cd196dc
commit dc74884f2d
3 changed files with 18 additions and 6 deletions

View File

@@ -24,18 +24,21 @@ func (this *IndexAction) RunGet(params struct {
GlobalOnly bool
Unread bool
EventLevel string
ListType string
}) {
this.Data["type"] = ""
this.Data["ip"] = params.Ip
this.Data["globalOnly"] = params.GlobalOnly
this.Data["unread"] = params.Unread
this.Data["eventLevel"] = params.EventLevel
this.Data["listType"] = params.ListType
countUnreadResp, err := this.RPC().IPItemRPC().CountAllEnabledIPItems(this.AdminContext(), &pb.CountAllEnabledIPItemsRequest{
Ip: params.Ip,
GlobalOnly: params.GlobalOnly,
Unread: true,
EventLevel: params.EventLevel,
ListType: params.ListType,
})
if err != nil {
this.ErrorPage(err)
@@ -48,6 +51,7 @@ func (this *IndexAction) RunGet(params struct {
GlobalOnly: params.GlobalOnly,
Unread: params.Unread,
EventLevel: params.EventLevel,
ListType: params.ListType,
})
if err != nil {
this.ErrorPage(err)
@@ -62,6 +66,7 @@ func (this *IndexAction) RunGet(params struct {
GlobalOnly: params.GlobalOnly,
Unread: params.Unread,
EventLevel: params.EventLevel,
ListType: params.ListType,
Offset: page.Offset,
Size: page.Size,
})

View File

@@ -98,9 +98,9 @@ Vue.component("ip-list-table", {
</div>
</th>
<th style="width:18em">IP</th>
<th>类型</th>
<th>级别</th>
<th>过期时间</th>
<th style="width: 6em">类型</th>
<th style="width: 6em">级别</th>
<th style="width: 12em">过期时间</th>
<th>备注</th>
<th class="three op">操作</th>
</tr>
@@ -114,7 +114,7 @@ Vue.component("ip-list-table", {
</div>
</td>
<td>
<span v-if="item.type != 'all'">
<span v-if="item.type != 'all'" :class="{green: item.list != null && item.list.type == 'white'}">
<keyword :v-word="keyword">{{item.ipFrom}}</keyword> <span> <span class="small red" v-if="item.isRead != null && !item.isRead">&nbsp;New&nbsp;</span>&nbsp;<a :href="'/servers/iplists?ip=' + item.ipFrom" v-if="vShowSearchButton" title="搜索此IP"><span><i class="icon search small" style="color: #ccc"></i></span></a></span>
<span v-if="item.ipTo.length > 0"> - <keyword :v-word="keyword">{{item.ipTo}}</keyword></span></span>
<span v-else class="disabled">*</span>

View File

@@ -7,6 +7,13 @@
<div class="ui field">
<input type="text" name="ip" placeholder="x.x.x.x" v-model="ip"/>
</div>
<div class="ui field">
<select class="ui dropdown auto-width" name="listType" v-model="listType">
<option value="">[类型]</option>
<option value="black">黑名单</option>
<option value="white">白名单</option>
</select>
</div>
<div class="ui field">
<select class="ui dropdown" name="eventLevel" v-model="eventLevel">
<option value="">[级别]</option>
@@ -16,7 +23,7 @@
<div class="ui field">
<div class="ui checkbox">
<input type="checkbox" name="globalOnly" value="1" v-model="globalOnly" id="global-only-checkbox"/>
<label for="global-only-checkbox">自动拦截名单</label>
<label for="global-only-checkbox">系统自动拦截</label>
</div>
</div>
<div class="ui field" v-if="countUnread > 0">
@@ -28,7 +35,7 @@
<div class="ui field">
<button class="ui button" type="submit">搜索</button>
&nbsp;
<a href="/servers/iplists" v-if="ip.length > 0 || globalOnly || unread || eventLevel.length > 0">[清除条件]</a>
<a href="/servers/iplists" v-if="ip.length > 0 || globalOnly || unread || eventLevel.length > 0 || listType.length > 0">[清除条件]</a>
</div>
<div class="ui field" v-if="countUnread > 0">
<span class="disabled">|</span>