优化节点日志:可以批量设置服务错误日志为已修复等

This commit is contained in:
GoEdgeLab
2021-11-30 16:43:44 +08:00
parent fbac9c4578
commit bcb079e902
7 changed files with 54 additions and 10 deletions

View File

@@ -12,9 +12,9 @@ type FixLogAction struct {
}
func (this *FixLogAction) RunPost(params struct {
LogId int64
LogIds []int64
}) {
_, err := this.RPC().NodeLogRPC().FixNodeLog(this.AdminContext(), &pb.FixNodeLogRequest{NodeLogId: params.LogId})
_, err := this.RPC().NodeLogRPC().FixNodeLogs(this.AdminContext(), &pb.FixNodeLogsRequest{NodeLogIds: params.LogIds})
if err != nil {
this.ErrorPage(err)
return

View File

@@ -258,7 +258,7 @@ func (this *IndexAction) RunGet(params struct {
NodeId: 0,
Role: nodeconfigs.NodeRoleNode,
Offset: 0,
Size: 10,
Size: 20,
Level: "",
FixedState: int32(configutils.BoolStateNo),
AllServers: true,
@@ -279,7 +279,7 @@ func (this *IndexAction) RunGet(params struct {
var server = serverResp.Server
if server == nil {
// 设置为已修复
_, err = this.RPC().NodeLogRPC().FixNodeLog(this.AdminContext(), &pb.FixNodeLogRequest{NodeLogId: errorLog.Id})
_, err = this.RPC().NodeLogRPC().FixNodeLogs(this.AdminContext(), &pb.FixNodeLogsRequest{NodeLogIds: []int64{errorLog.Id}})
if err != nil {
this.ErrorPage(err)
return
@@ -297,7 +297,7 @@ func (this *IndexAction) RunGet(params struct {
var node = nodeResp.Node
if node == nil || node.NodeCluster == nil {
// 设置为已修复
_, err = this.RPC().NodeLogRPC().FixNodeLog(this.AdminContext(), &pb.FixNodeLogRequest{NodeLogId: errorLog.Id})
_, err = this.RPC().NodeLogRPC().FixNodeLogs(this.AdminContext(), &pb.FixNodeLogsRequest{NodeLogIds: []int64{errorLog.Id}})
if err != nil {
this.ErrorPage(err)
return