mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-05 14:20:25 +08:00
可以用域名搜索DNS账号
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
|||||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||||
"github.com/iwind/TeaGo/maps"
|
"github.com/iwind/TeaGo/maps"
|
||||||
timeutil "github.com/iwind/TeaGo/utils/time"
|
timeutil "github.com/iwind/TeaGo/utils/time"
|
||||||
|
"regexp"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type IndexAction struct {
|
type IndexAction struct {
|
||||||
@@ -17,12 +19,20 @@ func (this *IndexAction) Init() {
|
|||||||
|
|
||||||
func (this *IndexAction) RunGet(params struct {
|
func (this *IndexAction) RunGet(params struct {
|
||||||
Keyword string
|
Keyword string
|
||||||
|
Domain string
|
||||||
}) {
|
}) {
|
||||||
this.Data["keyword"] = params.Keyword
|
this.Data["keyword"] = params.Keyword
|
||||||
|
this.Data["domain"] = params.Domain
|
||||||
|
|
||||||
|
// 格式化域名
|
||||||
|
var domain = params.Domain
|
||||||
|
domain = regexp.MustCompile(`^(www\.)`).ReplaceAllString(params.Domain, "")
|
||||||
|
domain = strings.ToLower(domain)
|
||||||
|
|
||||||
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,
|
Keyword: params.Keyword,
|
||||||
|
Domain: domain,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
@@ -35,6 +45,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,
|
Keyword: params.Keyword,
|
||||||
|
Domain: domain,
|
||||||
Offset: page.Offset,
|
Offset: page.Offset,
|
||||||
Size: page.Size,
|
Size: page.Size,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,10 +11,13 @@
|
|||||||
<div class="ui field">
|
<div class="ui field">
|
||||||
<input type="text" name="keyword" placeholder="账号说明..." v-model="keyword"/>
|
<input type="text" name="keyword" placeholder="账号说明..." v-model="keyword"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ui field">
|
||||||
|
<input type="text" name="domain" placeholder="域名..." v-model="domain"/>
|
||||||
|
</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="Tea.url('.')" v-if="keyword.length > 0">[清除条件]</a>
|
<a :href="Tea.url('.')" v-if="keyword.length > 0 || domain.length > 0">[清除条件]</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user