mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	IP名单支持模糊查询
This commit is contained in:
		@@ -21,21 +21,21 @@ func (this *IndexAction) Init() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
	Ip         string
 | 
			
		||||
	Keyword    string
 | 
			
		||||
	GlobalOnly bool
 | 
			
		||||
	Unread     bool
 | 
			
		||||
	EventLevel string
 | 
			
		||||
	ListType   string
 | 
			
		||||
}) {
 | 
			
		||||
	this.Data["type"] = ""
 | 
			
		||||
	this.Data["ip"] = params.Ip
 | 
			
		||||
	this.Data["keyword"] = params.Keyword
 | 
			
		||||
	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,
 | 
			
		||||
		Keyword:    params.Keyword,
 | 
			
		||||
		GlobalOnly: params.GlobalOnly,
 | 
			
		||||
		Unread:     true,
 | 
			
		||||
		EventLevel: params.EventLevel,
 | 
			
		||||
@@ -48,7 +48,7 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
	this.Data["countUnread"] = countUnreadResp.Count
 | 
			
		||||
 | 
			
		||||
	countResp, err := this.RPC().IPItemRPC().CountAllEnabledIPItems(this.AdminContext(), &pb.CountAllEnabledIPItemsRequest{
 | 
			
		||||
		Ip:         params.Ip,
 | 
			
		||||
		Keyword:    params.Keyword,
 | 
			
		||||
		GlobalOnly: params.GlobalOnly,
 | 
			
		||||
		Unread:     params.Unread,
 | 
			
		||||
		EventLevel: params.EventLevel,
 | 
			
		||||
@@ -63,7 +63,7 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
	this.Data["page"] = page.AsHTML()
 | 
			
		||||
 | 
			
		||||
	itemsResp, err := this.RPC().IPItemRPC().ListAllEnabledIPItems(this.AdminContext(), &pb.ListAllEnabledIPItemsRequest{
 | 
			
		||||
		Ip:         params.Ip,
 | 
			
		||||
		Keyword:    params.Keyword,
 | 
			
		||||
		GlobalOnly: params.GlobalOnly,
 | 
			
		||||
		Unread:     params.Unread,
 | 
			
		||||
		EventLevel: params.EventLevel,
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@
 | 
			
		||||
<form class="ui form" action="/servers/iplists" method="get">
 | 
			
		||||
    <div class="ui fields inline">
 | 
			
		||||
        <div class="ui field">
 | 
			
		||||
            <input type="text" name="ip" placeholder="x.x.x.x" v-model="ip"/>
 | 
			
		||||
            <input type="text" name="keyword" placeholder="x.x.x.x" v-model="keyword"/>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="ui field">
 | 
			
		||||
            <select class="ui dropdown auto-width" name="listType" v-model="listType">
 | 
			
		||||
@@ -35,7 +35,7 @@
 | 
			
		||||
        <div class="ui field">
 | 
			
		||||
            <button class="ui button" type="submit">搜索</button>
 | 
			
		||||
             
 | 
			
		||||
            <a href="/servers/iplists" v-if="ip.length > 0 || globalOnly || unread || eventLevel.length > 0 || listType.length > 0">[清除条件]</a>
 | 
			
		||||
            <a href="/servers/iplists" v-if="keyword.length > 0 || globalOnly || unread || eventLevel.length > 0 || listType.length > 0">[清除条件]</a>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="ui field" v-if="countUnread > 0">
 | 
			
		||||
            <span class="disabled">|</span>
 | 
			
		||||
@@ -50,6 +50,6 @@
 | 
			
		||||
 | 
			
		||||
<p class="comment" v-if="items.length == 0">暂时还没有IP。</p>
 | 
			
		||||
 | 
			
		||||
<ip-list-table v-if="items.length > 0" :v-items="items" @update-item="updateItem" @delete-item="deleteItem" :v-keyword="ip" :v-show-search-button="true"></ip-list-table>
 | 
			
		||||
<ip-list-table v-if="items.length > 0" :v-items="items" @update-item="updateItem" @delete-item="deleteItem" :v-keyword="keyword" :v-show-search-button="true"></ip-list-table>
 | 
			
		||||
 | 
			
		||||
<div class="page" v-html="page"></div>
 | 
			
		||||
		Reference in New Issue
	
	Block a user