From 4bd8ec6c78e0cfa7adf45c7a8e4071027273d24f Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 30 Mar 2022 11:15:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E7=94=A8=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E6=90=9C=E7=B4=A2DNS=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/web/actions/default/dns/providers/index.go | 11 +++++++++++ web/views/@default/dns/providers/index.html | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/internal/web/actions/default/dns/providers/index.go b/internal/web/actions/default/dns/providers/index.go index 07f08b1d..94707e93 100644 --- a/internal/web/actions/default/dns/providers/index.go +++ b/internal/web/actions/default/dns/providers/index.go @@ -5,6 +5,8 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/iwind/TeaGo/maps" timeutil "github.com/iwind/TeaGo/utils/time" + "regexp" + "strings" ) type IndexAction struct { @@ -17,12 +19,20 @@ func (this *IndexAction) Init() { func (this *IndexAction) RunGet(params struct { Keyword string + Domain string }) { 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{ AdminId: this.AdminId(), Keyword: params.Keyword, + Domain: domain, }) if err != nil { this.ErrorPage(err) @@ -35,6 +45,7 @@ func (this *IndexAction) RunGet(params struct { providersResp, err := this.RPC().DNSProviderRPC().ListEnabledDNSProviders(this.AdminContext(), &pb.ListEnabledDNSProvidersRequest{ AdminId: this.AdminId(), Keyword: params.Keyword, + Domain: domain, Offset: page.Offset, Size: page.Size, }) diff --git a/web/views/@default/dns/providers/index.html b/web/views/@default/dns/providers/index.html index 7d86112b..e4b7d959 100644 --- a/web/views/@default/dns/providers/index.html +++ b/web/views/@default/dns/providers/index.html @@ -11,10 +11,13 @@
+
+ +
  - [清除条件] + [清除条件]