DNS服务商支持搜索

This commit is contained in:
GoEdgeLab
2021-08-25 18:46:57 +08:00
parent a2bf5d5a3e
commit b2f287a27a
2 changed files with 20 additions and 1 deletions

View File

@@ -15,9 +15,14 @@ func (this *IndexAction) Init() {
this.Nav("", "", "") this.Nav("", "", "")
} }
func (this *IndexAction) RunGet(params struct{}) { func (this *IndexAction) RunGet(params struct {
Keyword string
}) {
this.Data["keyword"] = params.Keyword
countResp, err := this.RPC().DNSProviderRPC().CountAllEnabledDNSProviders(this.AdminContext(), &pb.CountAllEnabledDNSProvidersRequest{ countResp, err := this.RPC().DNSProviderRPC().CountAllEnabledDNSProviders(this.AdminContext(), &pb.CountAllEnabledDNSProvidersRequest{
AdminId: this.AdminId(), AdminId: this.AdminId(),
Keyword: params.Keyword,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)
@@ -29,6 +34,7 @@ func (this *IndexAction) RunGet(params struct{}) {
providersResp, err := this.RPC().DNSProviderRPC().ListEnabledDNSProviders(this.AdminContext(), &pb.ListEnabledDNSProvidersRequest{ providersResp, err := this.RPC().DNSProviderRPC().ListEnabledDNSProviders(this.AdminContext(), &pb.ListEnabledDNSProvidersRequest{
AdminId: this.AdminId(), AdminId: this.AdminId(),
Keyword: params.Keyword,
Offset: page.Offset, Offset: page.Offset,
Size: page.Size, Size: page.Size,
}) })

View File

@@ -4,6 +4,19 @@
<a href="" class="item" @click.prevent="createProvider()">[添加DNS账号信息]</a> <a href="" class="item" @click.prevent="createProvider()">[添加DNS账号信息]</a>
</first-menu> </first-menu>
<div class="margin"></div>
<form class="ui form" method="get" action="/dns/providers">
<div class="ui fields inline">
<div class="ui field">
<input type="text" name="keyword" placeholder="账号说明..." v-model="keyword"/>
</div>
<div class="ui field">
<button class="ui button" type="submit">搜索</button>
</div>
</div>
</form>
<p class="comment" v-if="providers.length == 0">暂时还没有第三方DNS服务商。</p> <p class="comment" v-if="providers.length == 0">暂时还没有第三方DNS服务商。</p>
<table class="ui table selectable celled" v-if="providers.length > 0"> <table class="ui table selectable celled" v-if="providers.length > 0">