node version parser

This commit is contained in:
cubedro 2015-02-17 17:29:26 +02:00
parent 35072afb90
commit 9f93f7059b
2 changed files with 8 additions and 4 deletions

View File

@ -39,10 +39,14 @@ angular.module('netStatsApp.filters', [])
return (! mining ? 'icon-cancel' : 'icon-check'); return (! mining ? 'icon-cancel' : 'icon-check');
}; };
}) })
.filter('nodeVersion', function() { .filter('nodeVersion', function($sce) {
return function(version) { return function(version) {
return version.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '<br>' + '$2') version = version.replace('eth version ', 'v')
} .replace("\n" + 'Network protocol version: ', ' (')
.replace("\n" + 'Client database version: ', ',')
.replace("\n" + 'Build: ', ')<br>');
return $sce.trustAsHtml(version);
};
}) })
.filter('blockClass', function() { .filter('blockClass', function() {
return function(current, best) { return function(current, best) {

View File

@ -78,7 +78,7 @@ block content
span(data-toggle="tooltip", data-placement="top", data-original-title="{{node.geo | geoTooltip}}") {{node.info.name}} span(data-toggle="tooltip", data-placement="top", data-original-title="{{node.geo | geoTooltip}}") {{node.info.name}}
div.small {{node.info.ip}} div.small {{node.info.ip}}
td.small td.small
span(ng-bind-html-unsafe="node.info.node | nodeVersion") div.small(ng-bind-html="node.info.node | nodeVersion")
div.small {{node.info.os}}, {{node.info.os_v}} div.small {{node.info.os}}, {{node.info.os_v}}
td(class="{{ node.stats.peers | peerClass }}") {{node.stats.peers}} td(class="{{ node.stats.peers | peerClass }}") {{node.stats.peers}}
td(class="{{ node.stats.mining | miningClass }}") td(class="{{ node.stats.mining | miningClass }}")