@spalger/kibana
Version:
Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic
36 lines (29 loc) • 1.06 kB
JavaScript
define(function (require) {
var _ = require('lodash');
var ConfigTemplate = require('ui/ConfigTemplate');
require('ui/modules')
.get('kibana')
.directive('chromeContext', function (timefilter, globalState) {
var listenForUpdates = _.once(function ($scope) {
$scope.$listen(timefilter, 'update', function (newVal, oldVal) {
globalState.time = _.clone(timefilter.time);
globalState.refreshInterval = _.clone(timefilter.refreshInterval);
globalState.save();
});
});
return {
link: function ($scope) {
listenForUpdates($scope);
// chrome is responsible for timepicker ui and state transfer...
$scope.timefilter = timefilter;
$scope.pickerTemplate = new ConfigTemplate({
filter: require('ui/chrome/config/filter.html'),
interval: require('ui/chrome/config/interval.html')
});
$scope.toggleRefresh = function () {
timefilter.refreshInterval.pause = !timefilter.refreshInterval.pause;
};
}
};
});
});