2021-11-15 11:31:54 +08:00
|
|
|
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
|
|
|
|
|
|
|
|
|
package logs
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
2022-08-18 09:28:09 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
2021-11-15 11:31:54 +08:00
|
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ReadAllLogsAction struct {
|
|
|
|
|
actionutils.ParentAction
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (this *ReadAllLogsAction) RunPost(params struct {
|
|
|
|
|
LogIds []int64
|
|
|
|
|
}) {
|
|
|
|
|
_, err := this.RPC().NodeLogRPC().UpdateAllNodeLogsRead(this.AdminContext(), &pb.UpdateAllNodeLogsReadRequest{})
|
|
|
|
|
if err != nil {
|
|
|
|
|
this.ErrorPage(err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-18 09:28:09 +08:00
|
|
|
// 通知左侧数字Badge更新
|
|
|
|
|
helpers.NotifyNodeLogsCountChange()
|
|
|
|
|
|
2021-11-15 11:31:54 +08:00
|
|
|
this.Success()
|
|
|
|
|
}
|