mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-09 07:20:26 +08:00
IP名单增加是否只显示自动拦截名单选项
This commit is contained in:
@@ -19,12 +19,17 @@ func (this *IndexAction) Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *IndexAction) RunGet(params struct {
|
func (this *IndexAction) RunGet(params struct {
|
||||||
Ip string
|
Ip string
|
||||||
|
GlobalOnly bool
|
||||||
}) {
|
}) {
|
||||||
this.Data["type"] = ""
|
this.Data["type"] = ""
|
||||||
this.Data["ip"] = params.Ip
|
this.Data["ip"] = params.Ip
|
||||||
|
this.Data["globalOnly"] = params.GlobalOnly
|
||||||
|
|
||||||
countResp, err := this.RPC().IPItemRPC().CountAllEnabledIPItems(this.AdminContext(), &pb.CountAllEnabledIPItemsRequest{Ip: params.Ip})
|
countResp, err := this.RPC().IPItemRPC().CountAllEnabledIPItems(this.AdminContext(), &pb.CountAllEnabledIPItemsRequest{
|
||||||
|
Ip: params.Ip,
|
||||||
|
GlobalOnly: params.GlobalOnly,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
@@ -34,9 +39,10 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
this.Data["page"] = page.AsHTML()
|
this.Data["page"] = page.AsHTML()
|
||||||
|
|
||||||
itemsResp, err := this.RPC().IPItemRPC().ListAllEnabledIPItems(this.AdminContext(), &pb.ListAllEnabledIPItemsRequest{
|
itemsResp, err := this.RPC().IPItemRPC().ListAllEnabledIPItems(this.AdminContext(), &pb.ListAllEnabledIPItemsRequest{
|
||||||
Ip: params.Ip,
|
Ip: params.Ip,
|
||||||
Offset: page.Offset,
|
GlobalOnly: params.GlobalOnly,
|
||||||
Size: page.Size,
|
Offset: page.Offset,
|
||||||
|
Size: page.Size,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -7,10 +7,16 @@
|
|||||||
<div class="ui field">
|
<div class="ui field">
|
||||||
<input type="text" name="ip" placeholder="x.x.x.x" v-model="ip"/>
|
<input type="text" name="ip" placeholder="x.x.x.x" v-model="ip"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ui field">
|
||||||
|
<div class="ui checkbox">
|
||||||
|
<input type="checkbox" name="globalOnly" value="1" v-model="globalOnly"/>
|
||||||
|
<label>自动拦截名单</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="ui field">
|
<div class="ui field">
|
||||||
<button class="ui button" type="submit">搜索</button>
|
<button class="ui button" type="submit">搜索</button>
|
||||||
|
|
||||||
<a href="/servers/iplists" v-if="ip.length > 0">[清除条件]</a>
|
<a href="/servers/iplists" v-if="ip.length > 0 || globalOnly">[清除条件]</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user