removed filter form directive

pull/5/head
cubedro 10 years ago
parent 89ba119123
commit f8cf4ac069
  1. 2
      dist/js/netstats.min.js
  2. 2
      dist/js/netstats.min.js.map
  3. 32
      public/js/directives.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -75,7 +75,7 @@ angular.module('netStatsApp.directives', [])
}
};
})
.directive('nodepropagchart', ['$filter', function($filter) {
.directive('nodepropagchart', function() {
return {
restrict: 'E',
scope: {
@ -85,6 +85,32 @@ angular.module('netStatsApp.directives', [])
{
tElement.replaceWith('<span>' + tAttrs.data + "</span>");
function formatTime (ms) {
var result = 0;
if(ms < 1000) {
return ms + " ms";
}
if(ms < 1000*60) {
result = ms/1000;
return result.toFixed(1) + " s";
}
if(ms < 1000*60*60) {
result = ms/1000/60;
return Math.round(result) + " min";
}
if(ms < 1000*60*60*24) {
result = ms/1000/60/60;
return Math.round(result) + " h";
}
result = ms/1000/60/60/24;
return Math.round(result) + " days";
};
return function(scope, element, attrs)
{
attrs.$observe("data", function (newValue)
@ -108,7 +134,7 @@ angular.module('netStatsApp.directives', [])
}),
tooltipFormatter: function (spark, opt, ms) {
var tooltip = '<div class="tooltip-arrow"></div><div class="tooltip-inner">';
tooltip += $filter('blockPropagationFilter')(ms[0].value, '');
tooltip += formatTime(ms[0].value);
tooltip += '</div>';
return tooltip;
@ -118,7 +144,7 @@ angular.module('netStatsApp.directives', [])
};
}
};
}])
})
.directive('nodemap', ['$compile', function($compile) {
return {
restrict: 'EA',

Loading…
Cancel
Save