From 18c70835484e617e66c4f6bf16f756fbb0632777 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Fri, 15 Feb 2013 15:54:36 -0700 Subject: [PATCH] Added failover index setting --- panels/timepicker/editor.html | 15 +++++++++++---- panels/timepicker/module.js | 5 ++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/panels/timepicker/editor.html b/panels/timepicker/editor.html index a00aeeea138..0dc1f72f361 100644 --- a/panels/timepicker/editor.html +++ b/panels/timepicker/editor.html @@ -5,18 +5,25 @@
Time Field
- +
-
+
+
+
Index Settings
+
Index pattern Absolutes in double quotes
- + +
+
+
Failover Index If none match the pattern
+
Relative mode settings
Relative time options comma seperated
- +
Default timespan
diff --git a/panels/timepicker/module.js b/panels/timepicker/module.js index 2ea10aebaa7..40d5cde31b0 100644 --- a/panels/timepicker/module.js +++ b/panels/timepicker/module.js @@ -35,6 +35,7 @@ angular.module('kibana.timepicker', []) timespan : '15m', timefield : '@timestamp', index : '"logstash-"yyyy.mm.dd', + defaultindex : "NOINDEX", group : "default", refresh : { enable : false, @@ -195,7 +196,9 @@ angular.module('kibana.timepicker', []) }); return all_indices().then(function(p) { - return _.intersection(p,possible); + var indices = _.intersection(p,possible); + console.log(indices) + return indices.length == 0 ? [$scope.panel.defaultindex] : indices; }) };