2021-05-23 20:44:51 +08:00
|
|
|
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
|
|
|
|
|
2022-03-23 17:31:53 +08:00
|
|
|
package logs
|
2021-05-23 20:44:51 +08:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
2022-03-23 17:31:53 +08:00
|
|
|
"github.com/iwind/TeaGo/types"
|
|
|
|
|
"strings"
|
2021-05-23 20:44:51 +08:00
|
|
|
)
|
|
|
|
|
|
2022-03-23 17:31:53 +08:00
|
|
|
type FixAction struct {
|
2021-05-23 20:44:51 +08:00
|
|
|
actionutils.ParentAction
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-23 17:31:53 +08:00
|
|
|
func (this *FixAction) RunPost(params struct {
|
2021-11-30 16:43:44 +08:00
|
|
|
LogIds []int64
|
2021-05-23 20:44:51 +08:00
|
|
|
}) {
|
2022-03-23 17:31:53 +08:00
|
|
|
var logIdStrings = []string{}
|
|
|
|
|
for _, logId := range params.LogIds {
|
|
|
|
|
logIdStrings = append(logIdStrings, types.String(logId))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
defer this.CreateLogInfo("设置日志 %s 为已修复", strings.Join(logIdStrings, ", "))
|
|
|
|
|
|
2021-11-30 16:43:44 +08:00
|
|
|
_, err := this.RPC().NodeLogRPC().FixNodeLogs(this.AdminContext(), &pb.FixNodeLogsRequest{NodeLogIds: params.LogIds})
|
2021-05-23 20:44:51 +08:00
|
|
|
if err != nil {
|
|
|
|
|
this.ErrorPage(err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.Success()
|
|
|
|
|
}
|