mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-31 15:36:35 +08:00
域名解析中可以删除和恢复某个域名
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
)
|
||||
|
||||
// 域名列表选项
|
||||
// DomainOptionsAction 域名列表选项
|
||||
type DomainOptionsAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
@@ -23,8 +23,8 @@ func (this *DomainOptionsAction) RunPost(params struct {
|
||||
}
|
||||
domainMaps := []maps.Map{}
|
||||
for _, domain := range domainsResp.DnsDomains {
|
||||
// 未开启的先跳过
|
||||
if !domain.IsOn {
|
||||
// 未开启或者已删除的先跳过
|
||||
if !domain.IsOn || domain.IsDeleted {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
27
internal/web/actions/default/dns/domains/recover.go
Normal file
27
internal/web/actions/default/dns/domains/recover.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package domains
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/oplogs"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
)
|
||||
|
||||
type RecoverAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *RecoverAction) RunPost(params struct {
|
||||
DomainId int64
|
||||
}) {
|
||||
// 记录日志
|
||||
defer this.CreateLog(oplogs.LevelInfo, "从DNS服务商中恢复域名 %d", params.DomainId)
|
||||
|
||||
// 执行恢复
|
||||
_, err := this.RPC().DNSDomainRPC().RecoverDNSDomain(this.AdminContext(), &pb.RecoverDNSDomainRequest{DnsDomainId: params.DomainId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
@@ -52,7 +52,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
||||
// TODO 检查DomainId
|
||||
|
||||
// 记录日志
|
||||
defer this.CreateLog(oplogs.LevelInfo, "修改管理域名到DNS服务商 %d", params.DomainId)
|
||||
defer this.CreateLog(oplogs.LevelInfo, "修改DNS服务商域名 %d", params.DomainId)
|
||||
|
||||
params.Must.
|
||||
Field("name", params.Name).
|
||||
|
||||
@@ -43,6 +43,7 @@ func init() {
|
||||
GetPost("/createPopup", new(domains.CreatePopupAction)).
|
||||
GetPost("/updatePopup", new(domains.UpdatePopupAction)).
|
||||
Post("/delete", new(domains.DeleteAction)).
|
||||
Post("/recover", new(domains.RecoverAction)).
|
||||
Post("/sync", new(domains.SyncAction)).
|
||||
Get("/routesPopup", new(domains.RoutesPopupAction)).
|
||||
GetPost("/selectPopup", new(domains.SelectPopupAction)).
|
||||
|
||||
@@ -83,6 +83,7 @@ func (this *ProviderAction) RunGet(params struct {
|
||||
"name": domain.Name,
|
||||
"isOn": domain.IsOn,
|
||||
"isUp": domain.IsUp,
|
||||
"isDeleted": domain.IsDeleted,
|
||||
"dataUpdatedTime": dataUpdatedTime,
|
||||
"countRoutes": len(domain.Routes),
|
||||
"countServerRecords": domain.CountServerRecords,
|
||||
|
||||
Reference in New Issue
Block a user