You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by si...@apache.org on 2021/01/14 18:55:25 UTC
[ozone] branch master updated: HDDS-4681. SCM webui display wrong
Node counts. (#1789)
This is an automated email from the ASF dual-hosted git repository.
siyao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new befba44 HDDS-4681. SCM webui display wrong Node counts. (#1789)
befba44 is described below
commit befba44d4ae30690515ce4930213ed8944bed5d0
Author: Huang-Mu Zheng <fl...@gmail.com>
AuthorDate: Fri Jan 15 02:55:14 2021 +0800
HDDS-4681. SCM webui display wrong Node counts. (#1789)
---
.../main/resources/webapps/scm/scm-overview.html | 14 +++++++++---
.../src/main/resources/webapps/scm/scm.js | 25 ++++++++++++++++------
2 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm-overview.html b/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm-overview.html
index a6f4fdf..c9ce216 100644
--- a/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm-overview.html
+++ b/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm-overview.html
@@ -31,10 +31,18 @@
<h2>Node counts</h2>
<table class="table table-bordered table-striped" class="col-md-6">
+ <thead>
+ <tr>
+ <th class="col-md-3"></th>
+ <th>HEALTHY</th>
+ <th>STALE</th>
+ <th>DEAD</th>
+ </tr>
+ </thead>
<tbody>
- <tr ng-repeat="typestat in $ctrl.nodemanagermetrics.NodeCount | orderBy:'key':false:$ctrl.nodeOrder">
- <td>{{typestat.key}}</td>
- <td>{{typestat.value}}</td>
+ <tr ng-repeat="nodeOpState in $ctrl.nodemanagermetrics.NodeCount | orderBy:'key':false:$ctrl.nodeOpStateOrder">
+ <td>{{nodeOpState.key}}</td>
+ <td ng-repeat="nodeState in nodeOpState.value | orderBy:'key':false:$ctrl.nodeStateOrder">{{nodeState.value}}</td>
</tr>
</tbody>
</table>
diff --git a/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js b/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js
index b5acc19..9653838 100644
--- a/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js
+++ b/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js
@@ -31,17 +31,28 @@
ctrl.nodemanagermetrics = result.data.beans[0];
});
- var statusSortOrder = {
+ const nodeOpStateSortOrder = {
+ "IN_SERVICE": "a",
+ "DECOMMISSIONING": "b",
+ "DECOMMISSIONED": "c",
+ "ENTERING_MAINTENANCE": "d",
+ "IN_MAINTENANCE": "e"
+ };
+ ctrl.nodeOpStateOrder = function (v1, v2) {
+ //status with non defined sort order will be "undefined"
+ return ("" + nodeOpStateSortOrder[v1.value])
+ .localeCompare("" + nodeOpStateSortOrder[v2.value])
+ }
+
+ const nodeStateSortOrder = {
"HEALTHY": "a",
"STALE": "b",
- "DEAD": "c",
- "UNKNOWN": "z",
- "DECOMMISSIONING": "x",
- "DECOMMISSIONED": "y"
+ "DEAD": "c"
};
- ctrl.nodeOrder = function (v1, v2) {
+ ctrl.nodeStateOrder = function (v1, v2) {
//status with non defined sort order will be "undefined"
- return ("" + statusSortOrder[v1.value]).localeCompare("" + statusSortOrder[v2.value])
+ return ("" + nodeStateSortOrder[v1.value])
+ .localeCompare("" + nodeStateSortOrder[v2.value])
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org