From 24afefd3f10c721f549639daa9075ce7d46088b3 Mon Sep 17 00:00:00 2001 From: cubedro Date: Fri, 17 Apr 2015 04:35:08 +0300 Subject: [PATCH] visual improvements --- public/css/style.css | 10 +++++++--- public/js/filters.js | 38 ++++++++++++++++++++++++++++++++------ 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 304d8c3..ac74821 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -10,8 +10,9 @@ body { -moz-font-smoothing: antialiased; } -td { +table td { font-size: 14px; + white-space: nowrap !important; -webkit-font-smoothing: subpixel-antialiased; -moz-font-smoothing: subpixel-antialiased; } @@ -285,9 +286,12 @@ table td i { left: 0; } -table td { - white-space: nowrap !important; +.nodeInfo .tooltip .tooltip-inner { + max-width: 400px; + text-align: left; + font-size: 12px; } + .table>tbody>tr>td, .table>thead>tr>th { padding: 5px; diff --git a/public/js/filters.js b/public/js/filters.js index 98d8e0c..13bffc8 100644 --- a/public/js/filters.js +++ b/public/js/filters.js @@ -44,10 +44,31 @@ angular.module('netStatsApp.filters', []) }) .filter('nodeVersion', function($sce) { return function(version) { - if(typeof version !== 'undefined') { - return $sce.trustAsHtml(version); - } else - return ''; + if(typeof version !== 'undefined') + { + var tmp = version.split('/'); + + tmp[0] = tmp[0].replace('Ethereum(++)', 'Eth'); + + if(tmp[1][0] !== 'v' && tmp[1][2] !== '.') + { + tmp.splice(1,1); + } + + if(tmp[2] === 'Release'){ + tmp.splice(2,1); + } + + if(tmp[2].indexOf('Linux') === 0) + tmp[2] = 'linux'; + + if(tmp[2].indexOf('Darwin') === 0) + tmp[2] = 'darwin'; + + return $sce.trustAsHtml(tmp.join('/')); + } + + return ''; }; }) .filter('blockClass', function() { @@ -225,8 +246,7 @@ angular.module('netStatsApp.filters', []) eth_version.splice(1,1); } - string = "Ethereum: " + (eth_version[0]) + ""; - + string = "Ethereum: " + node.info.node + ""; tooltip.push(string); string = "Version: " + (eth_version[1]) + ""; @@ -257,6 +277,12 @@ angular.module('netStatsApp.filters', []) tooltip.push(string); } + if(node.info.os !== '') { + string = "OS: " + (typeof node.info.os !== 'undefined' ? node.info.os + ' ' + node.info.os_v : '?') + ""; + + tooltip.push(string); + } + return tooltip.join("
"); }; })