added table order

This commit is contained in:
cubedro 2015-04-06 05:40:29 +03:00
parent 2a7cf566f3
commit e764147d2a
2 changed files with 6 additions and 3 deletions

View File

@ -25,6 +25,9 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
$scope.nodes = []; $scope.nodes = [];
$scope.map = []; $scope.map = [];
$scope.predicate = ['-stats.block.number', 'stats.block.propagation'];
$scope.reverse = false;
$scope.timeout = setInterval(function(){ $scope.timeout = setInterval(function(){
$scope.$apply(); $scope.$apply();
}, 1000); }, 1000);

View File

@ -106,7 +106,7 @@ block content
thead thead
tr.text-info tr.text-info
th 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 th.th-nodename
i.icon-laptop(data-toggle="tooltip", data-placement="top", title="Node type") i.icon-laptop(data-toggle="tooltip", data-placement="top", title="Node type")
th.th-latency th.th-latency
@ -118,7 +118,7 @@ block content
th th
i.icon-network(data-toggle="tooltip", data-placement="top", title="Pending transactions") i.icon-network(data-toggle="tooltip", data-placement="top", title="Pending transactions")
th 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.th-blockhash  
th th
i.icon-check-o(data-toggle="tooltip", data-placement="top", title="Block transactions") i.icon-check-o(data-toggle="tooltip", data-placement="top", title="Block transactions")
@ -129,7 +129,7 @@ block content
th th
i.icon-bulb(data-toggle="tooltip", data-placement="top", title="Up-time") i.icon-bulb(data-toggle="tooltip", data-placement="top", title="Up-time")
tbody 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}}") td(rel="{{node.id}}")
span.small(data-toggle="tooltip", data-placement="top", data-original-title="{{node.geo | geoTooltip}}") {{node.info.name}} span.small(data-toggle="tooltip", data-placement="top", data-original-title="{{node.geo | geoTooltip}}") {{node.info.name}}
span.small &nbsp({{node.info.ip}}) span.small &nbsp({{node.info.ip}})