mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-30 23:16:35 +08:00
改进操作日志
This commit is contained in:
@@ -14,7 +14,7 @@ func (this *SyncAction) RunPost(params struct {
|
||||
ClusterId int64
|
||||
}) {
|
||||
// 记录日志
|
||||
this.CreateLog(oplogs.LevelInfo, "同步集群 %d 的DNS设置", params.ClusterId)
|
||||
defer this.CreateLog(oplogs.LevelInfo, "同步集群 %d 的DNS设置", params.ClusterId)
|
||||
|
||||
dnsInfoResp, err := this.RPC().NodeClusterRPC().FindEnabledNodeClusterDNS(this.AdminContext(), &pb.FindEnabledNodeClusterDNSRequest{NodeClusterId: params.ClusterId})
|
||||
if err != nil {
|
||||
|
||||
@@ -54,7 +54,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
||||
return
|
||||
}
|
||||
|
||||
this.CreateLog(oplogs.LevelInfo, "添加管理域名到DNS服务商 %d", createResp.DnsDomainId)
|
||||
defer this.CreateLog(oplogs.LevelInfo, "添加管理域名到DNS服务商 %d", createResp.DnsDomainId)
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ func (this *DeleteAction) RunPost(params struct {
|
||||
DomainId int64
|
||||
}) {
|
||||
// 记录日志
|
||||
this.CreateLog(oplogs.LevelInfo, "从DNS服务商中删除域名 %d", params.DomainId)
|
||||
defer this.CreateLog(oplogs.LevelInfo, "从DNS服务商中删除域名 %d", params.DomainId)
|
||||
|
||||
// 检查是否正在使用
|
||||
countResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClustersWithDNSDomainId(this.AdminContext(), &pb.CountAllEnabledNodeClustersWithDNSDomainIdRequest{DnsDomainId: params.DomainId})
|
||||
|
||||
@@ -14,7 +14,7 @@ func (this *SyncAction) RunPost(params struct {
|
||||
DomainId int64
|
||||
}) {
|
||||
// 记录日志
|
||||
this.CreateLog(oplogs.LevelInfo, "同步DNS域名数据 %d", params.DomainId)
|
||||
defer this.CreateLog(oplogs.LevelInfo, "同步DNS域名数据 %d", params.DomainId)
|
||||
|
||||
// 执行同步
|
||||
resp, err := this.RPC().DNSDomainRPC().SyncDNSDomainData(this.AdminContext(), &pb.SyncDNSDomainDataRequest{DnsDomainId: params.DomainId})
|
||||
|
||||
@@ -52,7 +52,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
||||
// TODO 检查DomainId
|
||||
|
||||
// 记录日志
|
||||
this.CreateLog(oplogs.LevelInfo, "修改管理域名到DNS服务商 %d", params.DomainId)
|
||||
defer this.CreateLog(oplogs.LevelInfo, "修改管理域名到DNS服务商 %d", params.DomainId)
|
||||
|
||||
params.Must.
|
||||
Field("name", params.Name).
|
||||
|
||||
@@ -74,7 +74,7 @@ func (this *UpdateNodePopupAction) RunPost(params struct {
|
||||
CSRF *actionutils.CSRF
|
||||
}) {
|
||||
// 操作日志
|
||||
this.CreateLog(oplogs.LevelInfo, "修改节点 %d 的DNS设置", params.NodeId)
|
||||
defer this.CreateLog(oplogs.LevelInfo, "修改节点 %d 的DNS设置", params.NodeId)
|
||||
|
||||
routes := []string{}
|
||||
err := json.Unmarshal(params.DnsRoutesJSON, &routes)
|
||||
|
||||
@@ -103,7 +103,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
||||
return
|
||||
}
|
||||
|
||||
this.CreateLog(oplogs.LevelInfo, "创建DNS服务商 %d", createResp.DnsProviderId)
|
||||
defer this.CreateLog(oplogs.LevelInfo, "创建DNS服务商 %d", createResp.DnsProviderId)
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ func (this *DeleteAction) RunPost(params struct {
|
||||
// TODO 检查权限
|
||||
|
||||
// 记录日志
|
||||
this.CreateLog(oplogs.LevelInfo, "删除DNS服务商 %d", params.ProviderId)
|
||||
defer this.CreateLog(oplogs.LevelInfo, "删除DNS服务商 %d", params.ProviderId)
|
||||
|
||||
// 检查是否被使用
|
||||
countClustersResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClustersWithDNSProviderId(this.AdminContext(), &pb.CountAllEnabledNodeClustersWithDNSProviderIdRequest{DnsProviderId: params.ProviderId})
|
||||
|
||||
@@ -87,7 +87,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
||||
Must *actions.Must
|
||||
CSRF *actionutils.CSRF
|
||||
}) {
|
||||
this.CreateLog(oplogs.LevelInfo, "修改DNS服务商 %d", params.ProviderId)
|
||||
defer this.CreateLog(oplogs.LevelInfo, "修改DNS服务商 %d", params.ProviderId)
|
||||
|
||||
params.Must.
|
||||
Field("name", params.Name).
|
||||
|
||||
@@ -75,7 +75,7 @@ func (this *UpdateClusterPopupAction) RunPost(params struct {
|
||||
CSRF *actionutils.CSRF
|
||||
}) {
|
||||
// 日志
|
||||
this.CreateLog(oplogs.LevelInfo, "修改集群 %d DNS设置", params.ClusterId)
|
||||
defer this.CreateLog(oplogs.LevelInfo, "修改集群 %d DNS设置", params.ClusterId)
|
||||
|
||||
params.Must.
|
||||
Field("dnsName", params.DnsName).
|
||||
|
||||
Reference in New Issue
Block a user