diff --git a/public/js/controllers.js b/public/js/controllers.js index 1e8d742..fc240ce 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -25,6 +25,9 @@ function StatsCtrl($scope, $filter, socket, _, toastr) { $scope.nodes = []; $scope.map = []; + $scope.predicate = ['-stats.block.number', 'stats.block.propagation']; + $scope.reverse = false; + $scope.timeout = setInterval(function(){ $scope.$apply(); }, 1000); diff --git a/views/index.jade b/views/index.jade index 19a6148..53c8edf 100644 --- a/views/index.jade +++ b/views/index.jade @@ -106,7 +106,7 @@ block content thead tr.text-info th - i.icon-node(data-toggle="tooltip", data-placement="top", title="Node") + i.icon-node(data-toggle="tooltip", data-placement="top", title="Node name", ng-click="predicate = 'info.name'; reverse=!reverse") th.th-nodename i.icon-laptop(data-toggle="tooltip", data-placement="top", title="Node type") th.th-latency @@ -118,7 +118,7 @@ block content th i.icon-network(data-toggle="tooltip", data-placement="top", title="Pending transactions") th - i.icon-block(data-toggle="tooltip", data-placement="top", title="Last node block") + i.icon-block(data-toggle="tooltip", data-placement="top", title="Last block", ng-click="predicate = ['-stats.block.number', 'stats.block.propagation']; reverse=!reverse") th.th-blockhash   th i.icon-check-o(data-toggle="tooltip", data-placement="top", title="Block transactions") @@ -129,7 +129,7 @@ block content th i.icon-bulb(data-toggle="tooltip", data-placement="top", title="Up-time") tbody - tr(ng-repeat='node in nodes', class="{{ node.stats | mainClass : bestBlock }}") + tr(ng-repeat='node in nodes | orderBy:predicate:reverse', class="{{ node.stats | mainClass : bestBlock }}") td(rel="{{node.id}}") span.small(data-toggle="tooltip", data-placement="top", data-original-title="{{node.geo | geoTooltip}}") {{node.info.name}} span.small  ({{node.info.ip}})