You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "debiswal (via GitHub)" <gi...@apache.org> on 2023/02/20 08:17:14 UTC

[GitHub] [ozone] debiswal opened a new pull request, #4289: HDDS-7816. Add DataNode list to the SCM WebUI

debiswal opened a new pull request, #4289:
URL: https://github.com/apache/ozone/pull/4289

   What changes were proposed in this pull request?
   commit id : 74b79146fcdb288a29e583e0af9270dc983e3d48
   This Includes Sorting, Searching & Pagination on SCM UI where page deafult size is 10. we can also set this to 20 or 50 or 'All' records per page as well.
   Page slicing & Record Slicing both have been implemented along wth sort & search.
   
   Backend Changes ::
   JMX API developed & the response from API is
   
   "NodeStatusInfo" : [ {
   "key" : "ozone_datanode_1.ozone_default",
   "value" : [ "HEALTHY", "IN_SERVICE" ]
   }, {
   "key" : "ozone_datanode_3.ozone_default",
   "value" : [ "HEALTHY", "IN_SERVICE" ]
   }, {
   "key" : "ozone_datanode_2.ozone_default",
   "value" : [ "HEALTHY", "IN_SERVICE" ]
   } ]
   
   Note: HDDS 7816 JIRA includes both UI & Backend changes .
   
   What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-7816
   
   How was this patch tested?
   
   Manually
   Attached screenshot for reference
   
   image
   
   Search:
   image
   
   Sort:
   image
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] fapifta commented on a diff in pull request #4289: HDDS-7816. Add DataNode list to the SCM WebUI

Posted by "fapifta (via GitHub)" <gi...@apache.org>.
fapifta commented on code in PR #4289:
URL: https://github.com/apache/ozone/pull/4289#discussion_r1113655293


##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                  });

Review Comment:
   This line should be 2 spaces to the left to have the correct indentation, as this belongs to the .then... in line 37, so it should be on the same level.



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                  });
+                /*if option is 'All' display all records else display specified record on page*/
+                $scope.UpdateRecordsToShow = () => {
+                     if($scope.RecordsToDisplay == 'All') {
+                         $scope.lastIndex = 1;
+                         $scope.nodeStatus = nodeStatusCopy;
+                     }
+                     else {
+                         $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);

Review Comment:
   Missing space around the / operator.



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                  });
+                /*if option is 'All' display all records else display specified record on page*/

Review Comment:
   for this line to up until line 75 (inclusive), every line should be 4 spaces to the left, while the handle pagination part by 5 spaces, as that is indented 1 to the right now even compared to this line.



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                  });
+                /*if option is 'All' display all records else display specified record on page*/
+                $scope.UpdateRecordsToShow = () => {
+                     if($scope.RecordsToDisplay == 'All') {
+                         $scope.lastIndex = 1;
+                         $scope.nodeStatus = nodeStatusCopy;
+                     }
+                     else {

Review Comment:
   This else { should go to the previous line.



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{

Review Comment:
   This line, and the following line up until line 47 (inclusive) should be 4 spaces to the right to have the correct indentation level.
   Also in this line at the end there is a missing space between value and }, and => and {.



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);

Review Comment:
   Missing space around the / operator.



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                  });
+                /*if option is 'All' display all records else display specified record on page*/
+                $scope.UpdateRecordsToShow = () => {
+                     if($scope.RecordsToDisplay == 'All') {
+                         $scope.lastIndex = 1;
+                         $scope.nodeStatus = nodeStatusCopy;
+                     }
+                     else {
+                         $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                         $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                     }
+                     $scope.currentPage=1;

Review Comment:
   Missing spaces around the = sign



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/NodeManagerMXBean.java:
##########
@@ -41,5 +42,6 @@ public interface NodeManagerMXBean {
    * storage type.
    */
   Map<String, Long> getNodeInfo();
+  Map<String, List<String>> getNodeStatusInfo();

Review Comment:
   Please add some API documentation for this method, to describe what is being generated and returned by the method.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] fapifta merged pull request #4289: HDDS-7816. Add DataNode list to the SCM WebUI

Posted by "fapifta (via GitHub)" <gi...@apache.org>.
fapifta merged PR #4289:
URL: https://github.com/apache/ozone/pull/4289


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] debiswal commented on a diff in pull request #4289: HDDS-7816. Add DataNode list to the SCM WebUI

Posted by "debiswal (via GitHub)" <gi...@apache.org>.
debiswal commented on code in PR #4289:
URL: https://github.com/apache/ozone/pull/4289#discussion_r1114325744


##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                  });
+                /*if option is 'All' display all records else display specified record on page*/
+                $scope.UpdateRecordsToShow = () => {
+                     if($scope.RecordsToDisplay == 'All') {
+                         $scope.lastIndex = 1;
+                         $scope.nodeStatus = nodeStatusCopy;
+                     }
+                     else {

Review Comment:
   done



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                  });
+                /*if option is 'All' display all records else display specified record on page*/
+                $scope.UpdateRecordsToShow = () => {
+                     if($scope.RecordsToDisplay == 'All') {
+                         $scope.lastIndex = 1;
+                         $scope.nodeStatus = nodeStatusCopy;
+                     }
+                     else {
+                         $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                         $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                     }
+                     $scope.currentPage=1;

Review Comment:
   done



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] debiswal commented on a diff in pull request #4289: HDDS-7816. Add DataNode list to the SCM WebUI

Posted by "debiswal (via GitHub)" <gi...@apache.org>.
debiswal commented on code in PR #4289:
URL: https://github.com/apache/ozone/pull/4289#discussion_r1114326135


##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                  });
+                /*if option is 'All' display all records else display specified record on page*/
+                $scope.UpdateRecordsToShow = () => {
+                     if($scope.RecordsToDisplay == 'All') {
+                         $scope.lastIndex = 1;
+                         $scope.nodeStatus = nodeStatusCopy;
+                     }
+                     else {
+                         $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] debiswal commented on a diff in pull request #4289: HDDS-7816. Add DataNode list to the SCM WebUI

Posted by "debiswal (via GitHub)" <gi...@apache.org>.
debiswal commented on code in PR #4289:
URL: https://github.com/apache/ozone/pull/4289#discussion_r1114325477


##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                  });

Review Comment:
   done



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -24,12 +24,55 @@
         require: {
             overview: "^overview"
         },
-        controller: function ($http) {
+        controller: function ($http,$scope) {
             var ctrl = this;
+            $scope.reverse = true;
+            $scope.columnName = "";
+            let nodeStatusCopy = [];
+            $scope.RecordsToDisplay = "10";
+            $scope.currentPage = 1;
+            $scope.lastIndex = 0;
+
             $http.get("jmx?qry=Hadoop:service=SCMNodeManager,name=SCMNodeManagerInfo")
                 .then(function (result) {
                     ctrl.nodemanagermetrics = result.data.beans[0];
-                });
+                $scope.nodeStatus = ctrl.nodemanagermetrics && ctrl.nodemanagermetrics.NodeStatusInfo && ctrl.nodemanagermetrics.NodeStatusInfo.map(({ key, value}) =>{
+                            return {
+                                hostname: key,
+                                opstate: value[0],
+                                comstate: value[1]
+                            }});
+                nodeStatusCopy = [...$scope.nodeStatus];
+                $scope.lastIndex = Math.ceil(nodeStatusCopy.length/$scope.RecordsToDisplay);
+                $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay);
+                  });
+                /*if option is 'All' display all records else display specified record on page*/

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] debiswal commented on pull request #4289: HDDS-7816. Add DataNode list to the SCM WebUI

Posted by "debiswal (via GitHub)" <gi...@apache.org>.
debiswal commented on PR #4289:
URL: https://github.com/apache/ozone/pull/4289#issuecomment-1450050988

   commit id : 8111630102597486959bad31d13291e7b9c62908
   
   1. Sorting enabled wrt each column name.
   2. When page loads it loads with Hostname sorting ascending order enabled with default.
   3. sorting symbol from user point of View .
   
   screenshot attached for below change 
   ![image](https://user-images.githubusercontent.com/112392916/222136810-ed44b165-a362-4ee7-9fb7-13151af73785.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org