From 27b441e7f2f2d01c107ee98ea7817a30d7ed59ac Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Tue, 22 Nov 2022 11:27:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8A=82=E7=82=B9=E8=AF=A6=E6=83=85=E6=98=BE?= =?UTF-8?q?=E7=A4=BAAPI=E8=BF=9E=E6=8E=A5=E7=8A=B6=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/clusters/cluster/node/detail.go | 2 ++ .../@default/clusters/cluster/node/detail.html | 17 +++++++++++++++++ .../@default/clusters/cluster/node/detail.js | 4 ++++ 3 files changed, 23 insertions(+) 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