diff --git a/panels/hits/module.js b/panels/hits/module.js
index f77730e564e..bb44f1abfda 100644
--- a/panels/hits/module.js
+++ b/panels/hits/module.js
@@ -141,6 +141,17 @@ angular.module('kibana.hits', [])
$scope.get_data();
}
+ $scope.set_refresh = function (state) {
+ $scope.refresh = state;
+ }
+
+ $scope.close_edit = function() {
+ if($scope.refresh)
+ $scope.get_data();
+ $scope.refresh = false;
+ $scope.$emit('render');
+ }
+
function set_time(time) {
$scope.time = time;
$scope.index = _.isUndefined(time.index) ? $scope.index : time.index
diff --git a/panels/map/module.js b/panels/map/module.js
index 28fe11b5924..0161e2cd461 100644
--- a/panels/map/module.js
+++ b/panels/map/module.js
@@ -145,7 +145,7 @@ angular.module('kibana.map', [])
map: scope.panel.map,
regionStyle: {initial: {fill: '#8c8c8c'}},
zoomOnScroll: false,
- backgroundColor: '#272b30',
+ backgroundColor: null,
series: {
regions: [{
values: scope.data,
@@ -157,9 +157,9 @@ angular.module('kibana.map', [])
$('.jvectormap-label').css({
"position" : "absolute",
"display" : "none",
- 'color' : "#c8c8c8",
- 'padding' : '10px',
- 'font-size': '11pt',
+ 'color' : "#c8c8c8",
+ 'padding' : '10px',
+ 'font-size' : '11pt',
'font-weight' : 200,
'background-color': '#1f1f1f',
'border-radius': '5px'
diff --git a/panels/pie/module.js b/panels/pie/module.js
index 3ff06940f83..0d43348464a 100644
--- a/panels/pie/module.js
+++ b/panels/pie/module.js
@@ -246,14 +246,13 @@ angular.module('kibana.pie', [])
},
label: label,
stroke: {
- color: '#272b30',
width: 0
}
}
},
//grid: { hoverable: true, clickable: true },
grid: {
- backgroundColor: '#272b30',
+ backgroundColor: null,
hoverable: true,
clickable: true
},
diff --git a/panels/timepicker/module.js b/panels/timepicker/module.js
index 06432a4df04..c4e4ef41c97 100644
--- a/panels/timepicker/module.js
+++ b/panels/timepicker/module.js
@@ -28,7 +28,7 @@
*/
angular.module('kibana.timepicker', [])
-.controller('timepicker', function($scope, eventBus, $timeout, timer, $http) {
+.controller('timepicker', function($scope, eventBus, $timeout, timer, $http, kbnIndex) {
// Set and populate defaults
var _d = {
@@ -89,7 +89,7 @@ angular.module('kibana.timepicker', [])
// request one be sent by broadcasting a 'get_time' with its _id to its group
// This panel can handle multiple groups
eventBus.register($scope,"get_time", function(event,id) {
- eventBus.broadcast($scope.$id,id,'time',unmoment($scope.time))
+ eventBus.broadcast($scope.$id,id,'time',compile_time($scope.time))
});
// In case some other panel broadcasts a time, set us to an absolute range
@@ -208,13 +208,17 @@ angular.module('kibana.timepicker', [])
// Get indices for the time period, then broadcast time range and index list
// in a single object. Not sure if I like this.
if($scope.panel.index_interval !== 'none') {
- indices($scope.time.from,$scope.time.to).then(function (p) {
+ kbnIndex.indices($scope.time.from,
+ $scope.time.to,
+ $scope.panel.index,
+ $scope.panel.index_interval
+ ).then(function (p) {
$scope.time.index = p;
- eventBus.broadcast($scope.$id,$scope.panel.group,'time',unmoment($scope.time))
+ eventBus.broadcast($scope.$id,$scope.panel.group,'time',compile_time($scope.time))
});
} else {
$scope.time.index = [$scope.panel.index];
- eventBus.broadcast($scope.$id,$scope.panel.group,'time',unmoment($scope.time))
+ eventBus.broadcast($scope.$id,$scope.panel.group,'time',compile_time($scope.time))
}
// Update panel's string representation of the time object.Don't update if
@@ -233,10 +237,12 @@ angular.module('kibana.timepicker', [])
// Prefer to pass around Date() objects in the EventBus since interacting with
// moment objects in libraries that are expecting Date()s can be tricky
- function unmoment(time) {
+ function compile_time(time) {
time = _.clone(time)
time.from = time.from.toDate()
time.to = time.to.toDate()
+ time.interval = $scope.panel.index_interval
+ time.pattern = $scope.panel.index
return time;
}
@@ -254,81 +260,4 @@ angular.module('kibana.timepicker', [])
}
}
- // returns a promise containing an array of all indices matching the index
- // pattern that exist in a given range
- function indices(from,to) {
- var possible = [];
- _.each(expand_range(fake_utc(from),fake_utc(to),$scope.panel.index_interval),function(d){
- possible.push(d.format($scope.panel.index));
- });
-
- return all_indices().then(function(p) {
- var indices = _.intersection(possible,p);
- indices.reverse();
- return indices.length == 0 ? [$scope.panel.defaultindex] : indices;
- })
- };
-
- // returns a promise containing an array of all indices in an elasticsearch
- // cluster
- function all_indices() {
- var something = $http({
- url: config.elasticsearch + "/_aliases",
- method: "GET"
- }).error(function(data, status, headers, config) {
- $scope.error = status;
- });
-
- return something.then(function(p) {
- var indices = [];
- _.each(p.data, function(v,k) {
- indices.push(k)
- });
- return indices;
- });
- }
-
- // this is stupid, but there is otherwise no good way to ensure that when
- // I extract the date from an object that I'm get the UTC date. Stupid js.
- // I die a little inside every time I call this function.
- // Update: I just read this again. I died a little more inside.
- // Update2: More death.
- function fake_utc(date) {
- date = date.clone().toDate()
- return moment(new Date(date.getTime() + date.getTimezoneOffset() * 60000));
- }
-
- // Create an array of date objects by a given interval
- function expand_range(start, end, interval) {
- if(_.contains(['hour','day','week','month','year'],interval)) {
- var range;
- start = start.clone();
- range = [];
- while (start.isBefore(end)) {
- range.push(start.clone());
- switch (interval) {
- case 'hour':
- start.add('hours',1)
- break
- case 'day':
- start.add('days',1)
- break
- case 'week':
- start.add('weeks',1)
- break
- case 'month':
- start.add('months',1)
- break
- case 'year':
- start.add('years',1)
- break
- }
- }
- range.push(end.clone());
- return range;
- } else {
- return false;
- }
- }
-
})
\ No newline at end of file
diff --git a/panels/trends/editor.html b/panels/trends/editor.html
new file mode 100644
index 00000000000..092f909b20c
--- /dev/null
+++ b/panels/trends/editor.html
@@ -0,0 +1,64 @@
+
+
+
+ The trends panel will give you a percentage representation of how your query
+ has moved in your current timespan compared a specified amount of time ago. For
+ example, if the time is 1:10pm, your time picker was set to "Last 10m", and the
+ "Time Ago" parameter was set to '1h', the panel would show how much the query
+ results have changed since 12:00-12:10pm
+