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.map = [];
$scope.predicate = ['-stats.block.number', 'stats.block.propagation'];
$scope.reverse = false;
$scope.timeout = setInterval(function(){
$scope.$apply();
}, 1000);

View File

@ -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 &nbsp({{node.info.ip}})