改进操作日志

This commit is contained in:
GoEdgeLab
2020-11-20 15:32:42 +08:00
parent 60ba3e0a05
commit fc459a50b9
142 changed files with 230 additions and 100 deletions

View File

@@ -99,7 +99,7 @@ func (this *CreateBatchAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "批量创建节点")
defer this.CreateLog(oplogs.LevelInfo, "批量创建节点")
this.Success()
}

View File

@@ -159,7 +159,7 @@ func (this *CreateNodeAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "创建节点 %d", nodeId)
defer this.CreateLog(oplogs.LevelInfo, "创建节点 %d", nodeId)
this.Success()
}

View File

@@ -40,7 +40,7 @@ func (this *DeleteAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "删除集群 %d", params.ClusterId)
defer this.CreateLog(oplogs.LevelInfo, "删除集群 %d", params.ClusterId)
this.Success()
}

View File

@@ -48,7 +48,7 @@ func (this *CreatePopupAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "创建集群分组", createResp.GroupId)
defer this.CreateLog(oplogs.LevelInfo, "创建集群分组", createResp.GroupId)
this.Success()
}

View File

@@ -31,7 +31,7 @@ func (this *DeleteAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "删除集群分组 %d", params.GroupId)
defer this.CreateLog(oplogs.LevelInfo, "删除集群分组 %d", params.GroupId)
this.Success()
}

View File

@@ -20,7 +20,7 @@ func (this *SortAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "修改集群分组排序")
defer this.CreateLog(oplogs.LevelInfo, "修改集群分组排序")
this.Success()
}

View File

@@ -57,7 +57,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "修改集群分组 %d", params.GroupId)
defer this.CreateLog(oplogs.LevelInfo, "修改集群分组 %d", params.GroupId)
this.Success()
}

View File

@@ -80,7 +80,7 @@ func (this *InstallRemoteAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "远程安装节点 %d", params.NodeId)
defer this.CreateLog(oplogs.LevelInfo, "远程安装节点 %d", params.NodeId)
this.Success()
}

View File

@@ -112,7 +112,7 @@ func (this *InstallAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "安装节点 %d", params.NodeId)
defer this.CreateLog(oplogs.LevelInfo, "安装节点 %d", params.NodeId)
this.Success()
}

View File

@@ -20,7 +20,7 @@ func (this *StartAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "远程启动节点 %d", params.NodeId)
defer this.CreateLog(oplogs.LevelInfo, "远程启动节点 %d", params.NodeId)
if resp.IsOk {
this.Success()

View File

@@ -20,7 +20,7 @@ func (this *StopAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "远程停止节点 %d", params.NodeId)
defer this.CreateLog(oplogs.LevelInfo, "远程停止节点 %d", params.NodeId)
if resp.IsOk {
this.Success()

View File

@@ -190,7 +190,7 @@ func (this *UpdateAction) RunPost(params struct {
Must *actions.Must
}) {
// 创建日志
this.CreateLog(oplogs.LevelInfo, "修改节点 %d", params.NodeId)
defer this.CreateLog(oplogs.LevelInfo, "修改节点 %d", params.NodeId)
if params.NodeId <= 0 {
this.Fail("要操作的节点不存在")

View File

@@ -15,7 +15,7 @@ func (this *UpdateInstallStatusAction) RunPost(params struct {
IsInstalled bool
}) {
// 创建日志
this.CreateLog(oplogs.LevelInfo, "修改节点安装状态 %d", params.NodeId)
defer this.CreateLog(oplogs.LevelInfo, "修改节点安装状态 %d", params.NodeId)
_, err := this.RPC().NodeRPC().UpdateNodeIsInstalled(this.AdminContext(), &pb.UpdateNodeIsInstalledRequest{
NodeId: params.NodeId,

View File

@@ -61,7 +61,7 @@ func (this *IndexAction) RunPost(params struct {
CSRF *actionutils.CSRF
}) {
// 创建日志
this.CreateLog(oplogs.LevelInfo, "修改集群 %d DNS设置", params.ClusterId)
defer this.CreateLog(oplogs.LevelInfo, "修改集群 %d DNS设置", params.ClusterId)
// 检查DNS名称
if len(params.DnsName) > 0 {

View File

@@ -46,7 +46,7 @@ func (this *HealthAction) RunPost(params struct {
Must *actions.Must
}) {
// 创建日志
this.CreateLog(oplogs.LevelInfo, "修改集群健康检查设置 %d", params.ClusterId)
defer this.CreateLog(oplogs.LevelInfo, "修改集群健康检查设置 %d", params.ClusterId)
config := &serverconfigs.HealthCheckConfig{}
err := json.Unmarshal(params.HealthCheckJSON, config)

View File

@@ -26,7 +26,7 @@ func (this *HealthRunPopupAction) RunPost(params struct {
Must *actions.Must
}) {
// 创建日志
this.CreateLog(oplogs.LevelInfo, "执行集群健康检查设置 %d", params.ClusterId)
defer this.CreateLog(oplogs.LevelInfo, "执行集群健康检查设置 %d", params.ClusterId)
resp, err := this.RPC().NodeClusterRPC().ExecuteNodeClusterHealthCheck(this.AdminContext(), &pb.ExecuteNodeClusterHealthCheckRequest{ClusterId: params.ClusterId})
if err != nil {

View File

@@ -72,7 +72,7 @@ func (this *IndexAction) RunPost(params struct {
Must *actions.Must
}) {
// 创建日志
this.CreateLog(oplogs.LevelInfo, "修改集群基础设置 %d", params.ClusterId)
defer this.CreateLog(oplogs.LevelInfo, "修改集群基础设置 %d", params.ClusterId)
params.Must.
Field("name", params.Name).

View File

@@ -117,7 +117,7 @@ func (this *UpdateNodeSSHAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "修改节点 %d 配置", params.NodeId)
defer this.CreateLog(oplogs.LevelInfo, "修改节点 %d 配置", params.NodeId)
this.Success()
}

View File

@@ -69,7 +69,7 @@ func (this *UpgradeRemoteAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "远程升级节点 %d", params.NodeId)
defer this.CreateLog(oplogs.LevelInfo, "远程升级节点 %d", params.NodeId)
this.Success()
}

View File

@@ -79,7 +79,7 @@ func (this *CreateAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "创建节点集群:%d", createResp.ClusterId)
defer this.CreateLog(oplogs.LevelInfo, "创建节点集群:%d", createResp.ClusterId)
this.Success()
}

View File

@@ -64,7 +64,7 @@ func (this *CreateAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "创建SSH认证 %d", createResp.GrantId)
defer this.CreateLog(oplogs.LevelInfo, "创建SSH认证 %d", createResp.GrantId)
this.Success()
}

View File

@@ -72,7 +72,7 @@ func (this *CreatePopupAction) RunPost(params struct {
}
// 创建日志
this.CreateLog(oplogs.LevelInfo, "创建SSH认证 %d", createResp.GrantId)
defer this.CreateLog(oplogs.LevelInfo, "创建SSH认证 %d", createResp.GrantId)
this.Success()
}

View File

@@ -14,7 +14,7 @@ func (this *DeleteAction) RunPost(params struct {
GrantId int64
}) {
// 创建日志
this.CreateLog(oplogs.LevelInfo, "删除SSH认证 %d", params.GrantId)
defer this.CreateLog(oplogs.LevelInfo, "删除SSH认证 %d", params.GrantId)
// 检查是否有别的集群或节点正在使用
countResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClustersWithGrantId(this.AdminContext(), &pb.CountAllEnabledNodeClustersWithGrantIdRequest{

View File

@@ -62,7 +62,7 @@ func (this *UpdateAction) RunPost(params struct {
Must *actions.Must
}) {
// 创建日志
this.CreateLog(oplogs.LevelInfo, "修改SSH认证 %d", params.GrantId)
defer this.CreateLog(oplogs.LevelInfo, "修改SSH认证 %d", params.GrantId)
params.Must.
Field("name", params.Name).

View File

@@ -61,7 +61,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
Must *actions.Must
}) {
// 创建日志
this.CreateLog(oplogs.LevelInfo, "修改SSH认证 %d", params.GrantId)
defer this.CreateLog(oplogs.LevelInfo, "修改SSH认证 %d", params.GrantId)
params.Must.
Field("name", params.Name).