From eb965c4c002a408b8e68ba0b7dce3c5c197c2ef8 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Thu, 23 May 2013 21:39:48 -0700 Subject: [PATCH] Fixed null on missing trend data, added refresh on ago change, moved script loading to bottom of index.html --- index.html | 81 ++++++++++++++++++++------------------- panels/trends/editor.html | 5 +-- panels/trends/module.js | 7 ++-- 3 files changed, 46 insertions(+), 47 deletions(-) diff --git a/index.html b/index.html index c9866d8befe..ce4cae0a61d 100644 --- a/index.html +++ b/index.html @@ -1,24 +1,47 @@ - - - - - - - - - + + + + + + + + + - Kibana 3 + Kibana 3 - - - - - - - - + + + + + + + + + + + + +
+ + {{alert.title}}
{{$index + 1}} alert(s)
+
+ +
+
+
+
+
+ @@ -27,26 +50,4 @@ - - - -
- - {{alert.title}}
{{$index + 1}} alert(s)
-
- -
-
-
-
-
- diff --git a/panels/trends/editor.html b/panels/trends/editor.html index 092f909b20c..4c104257da2 100644 --- a/panels/trends/editor.html +++ b/panels/trends/editor.html @@ -15,7 +15,7 @@
- +
@@ -52,10 +52,7 @@
-
- -
diff --git a/panels/trends/module.js b/panels/trends/module.js index 83cbb71716d..eb05da0b942 100644 --- a/panels/trends/module.js +++ b/panels/trends/module.js @@ -147,7 +147,8 @@ angular.module('kibana.trends', []) $scope.hits.new += n; $scope.hits.old += o; - var percent = Math.round(percentage(hits.old,hits.new)*100)/100 + var percent = percentage(hits.old,hits.new) == null ? + '?' : Math.round(percentage(hits.old,hits.new)*100)/100 // Create series $scope.data[i] = { label: $scope.panel.query[i].label || "query"+(parseInt(i)+1), @@ -155,7 +156,7 @@ angular.module('kibana.trends', []) new : hits.new, old : hits.old }, - percent: _.isNull(percent) ? 0 : percent + percent: percent }; i++; @@ -171,7 +172,7 @@ angular.module('kibana.trends', []) } function percentage(x,y) { - return 100*(y-x)/x + return x == 0 ? null : 100*(y-x)/x } $scope.remove_query = function(q) {