diff --git a/internal/web/actions/default/clusters/cluster/node/detail.go b/internal/web/actions/default/clusters/cluster/node/detail.go index f131afcb..75f9b37d 100644 --- a/internal/web/actions/default/clusters/cluster/node/detail.go +++ b/internal/web/actions/default/clusters/cluster/node/detail.go @@ -356,6 +356,8 @@ func (this *DetailAction) RunGet(params struct { "cacheTotalDiskSize": numberutils.FormatBytes(status.CacheTotalDiskSize), "cacheTotalMemorySize": numberutils.FormatBytes(status.CacheTotalMemorySize), "exePath": status.ExePath, + "apiSuccessPercent": status.APISuccessPercent, + "apiAvgCostSeconds": status.APIAvgCostSeconds, }, "group": groupMap, diff --git a/web/views/@default/clusters/cluster/node/detail.html b/web/views/@default/clusters/cluster/node/detail.html index 630f9bae..1e29c8f8 100644 --- a/web/views/@default/clusters/cluster/node/detail.html +++ b/web/views/@default/clusters/cluster/node/detail.html @@ -235,6 +235,23 @@ 主程序位置 {{node.status.exePath}} + + 最近API连接状况 + + + 连接错误异常严重({{round(100 - node.status.apiSuccessPercent)}}%失败),请改善当前节点和API节点之间通讯 + 连接错误较多({{round(100 - node.status.apiSuccessPercent)}}%失败),请改善当前节点和API节点之间通讯 + 有连接错误发生({{round(100 - node.status.apiSuccessPercent)}}%失败),请改善当前节点和API节点之间通讯 + + 连接良好 + 连接基本稳定(平均{{round(node.status.apiAvgCostSeconds)}}秒) + 连接速度较慢(平均{{round(node.status.apiAvgCostSeconds)}}秒) + 连接非常慢(平均{{round(node.status.apiAvgCostSeconds)}}秒),请改善当前节点和API节点之间通讯 + + + 尚未连接 + + 上次更新时间 diff --git a/web/views/@default/clusters/cluster/node/detail.js b/web/views/@default/clusters/cluster/node/detail.js index b219642e..a1b48f95 100644 --- a/web/views/@default/clusters/cluster/node/detail.js +++ b/web/views/@default/clusters/cluster/node/detail.js @@ -32,4 +32,8 @@ Tea.context(function () { this.isStopping = false }) } + + this.round = function (f) { + return Math.round(f * 100) / 100 + } }) \ No newline at end of file