mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-16 05:36:36 +08:00
改进操作日志
This commit is contained in:
@@ -99,7 +99,7 @@ func (this *CreateBatchAction) RunPost(params struct {
|
||||
}
|
||||
|
||||
// 创建日志
|
||||
this.CreateLog(oplogs.LevelInfo, "批量创建节点")
|
||||
defer this.CreateLog(oplogs.LevelInfo, "批量创建节点")
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ func (this *SortAction) RunPost(params struct {
|
||||
}
|
||||
|
||||
// 创建日志
|
||||
this.CreateLog(oplogs.LevelInfo, "修改集群分组排序")
|
||||
defer this.CreateLog(oplogs.LevelInfo, "修改集群分组排序")
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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("要操作的节点不存在")
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user