mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-04 05:00:25 +08:00
网站服务显示服务错误的时候增加节点信息和链接
This commit is contained in:
@@ -274,7 +274,9 @@ func (this *IndexAction) RunGet(params struct {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
server := serverResp.Server
|
||||
|
||||
// 服务
|
||||
var server = serverResp.Server
|
||||
if server == nil {
|
||||
// 设置为已修复
|
||||
_, err = this.RPC().NodeLogRPC().FixNodeLog(this.AdminContext(), &pb.FixNodeLogRequest{NodeLogId: errorLog.Id})
|
||||
@@ -286,6 +288,24 @@ func (this *IndexAction) RunGet(params struct {
|
||||
continue
|
||||
}
|
||||
|
||||
// 节点
|
||||
nodeResp, err := this.RPC().NodeRPC().FindEnabledNode(this.AdminContext(), &pb.FindEnabledNodeRequest{NodeId: errorLog.NodeId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
var node = nodeResp.Node
|
||||
if node == nil || node.NodeCluster == nil {
|
||||
// 设置为已修复
|
||||
_, err = this.RPC().NodeLogRPC().FixNodeLog(this.AdminContext(), &pb.FixNodeLogRequest{NodeLogId: errorLog.Id})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
errorLogMaps = append(errorLogMaps, maps.Map{
|
||||
"id": errorLog.Id,
|
||||
"description": errorLog.Description,
|
||||
@@ -293,6 +313,9 @@ func (this *IndexAction) RunGet(params struct {
|
||||
"serverId": errorLog.ServerId,
|
||||
"level": errorLog.Level,
|
||||
"serverName": server.Name,
|
||||
"nodeId": node.Id,
|
||||
"nodeName": node.Name,
|
||||
"clusterId": node.NodeCluster.Id,
|
||||
})
|
||||
}
|
||||
this.Data["errorLogs"] = errorLogMaps
|
||||
|
||||
Reference in New Issue
Block a user