small fixes and dashboard property cleanup
This commit is contained in:
@@ -1,32 +1,15 @@
|
||||
{
|
||||
"title": "New Dashboard",
|
||||
"services": {
|
||||
"query": {
|
||||
"list": {
|
||||
"0": {
|
||||
"query": "*",
|
||||
"alias": "",
|
||||
"color": "#7EB26D",
|
||||
"id": 0
|
||||
}
|
||||
},
|
||||
"ids": [
|
||||
0
|
||||
]
|
||||
},
|
||||
"filter": {
|
||||
"list": {},
|
||||
"ids": []
|
||||
"list": [],
|
||||
"time": {
|
||||
"from": "now-5m",
|
||||
"to": "now"
|
||||
}
|
||||
}
|
||||
},
|
||||
"rows": [
|
||||
],
|
||||
"rows": [],
|
||||
"editable": true,
|
||||
"failover": false,
|
||||
"index": {
|
||||
"interval": "none",
|
||||
"pattern": "[logstash-]YYYY.MM.DD",
|
||||
"default": "_all",
|
||||
"warm_fields": false
|
||||
}
|
||||
"failover": false
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
define([
|
||||
'angular'
|
||||
],
|
||||
function (angular) {
|
||||
'use strict';
|
||||
|
||||
angular.module('kibana.directives').directive('panelMenu', [
|
||||
'$parse',
|
||||
'$compile',
|
||||
'$timeout',
|
||||
function ($parse, $compile, $timeout) {
|
||||
var buildTemplate = function (items, ul) {
|
||||
if (!ul)
|
||||
ul = [
|
||||
'<ul class="dropdown-menu" role="menu" aria-labelledby="drop1">',
|
||||
'</ul>'
|
||||
];
|
||||
angular.forEach(items, function (item, index) {
|
||||
if (item.divider)
|
||||
return ul.splice(index + 1, 0, '<li class="divider"></li>');
|
||||
var li = '<li' + (item.submenu && item.submenu.length ? ' class="dropdown-submenu"' : '') + '>' + '<a tabindex="-1" ng-href="' + (item.href || '') + '"' + (item.click ? '" ng-click="' + item.click + '"' : '') + (item.target ? '" target="' + item.target + '"' : '') + (item.method ? '" data-method="' + item.method + '"' : '') + '>' + (item.text || '') + '</a>';
|
||||
if (item.submenu && item.submenu.length)
|
||||
li += buildTemplate(item.submenu).join('\n');
|
||||
li += '</li>';
|
||||
ul.splice(index + 1, 0, li);
|
||||
});
|
||||
return ul;
|
||||
};
|
||||
return {
|
||||
restrict: 'EA',
|
||||
scope: true,
|
||||
link: function postLink(scope, iElement, iAttrs) {
|
||||
var getter = $parse(iAttrs.bsDropdown), items = getter(scope);
|
||||
$timeout(function () {
|
||||
if (!angular.isArray(items)) {
|
||||
}
|
||||
var dropdown = angular.element(buildTemplate(items).join(''));
|
||||
dropdown.insertAfter(iElement);
|
||||
$compile(iElement.next('ul.dropdown-menu'))(scope);
|
||||
});
|
||||
iElement.addClass('dropdown-toggle').attr('data-toggle', 'dropdown');
|
||||
}
|
||||
};
|
||||
}
|
||||
]);
|
||||
|
||||
});
|
||||
@@ -8,9 +8,5 @@
|
||||
<label class="small">Auto-refresh options <small>comma seperated</small></label>
|
||||
<input type="text" array-join class="input-large" ng-model="panel.refresh_intervals">
|
||||
</div>
|
||||
<div class="editor-option">
|
||||
<label class="small">Time Field</label>
|
||||
<input type="text" class="input-small" ng-model="panel.timefield">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,9 +38,8 @@ function (angular, app, _, moment, kbn) {
|
||||
status : "Stable",
|
||||
time_options : ['5m','15m','1h','6h','12h','24h','2d','7d','30d'],
|
||||
refresh_intervals : ['5s','10s','30s','1m','5m','15m','30m','1h','2h','1d'],
|
||||
|
||||
timefield : '@timestamp'
|
||||
};
|
||||
|
||||
_.defaults($scope.panel,_d);
|
||||
|
||||
var customTimeModal = $modal({
|
||||
|
||||
@@ -26,19 +26,8 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
|
||||
failover: false,
|
||||
panel_hints: true,
|
||||
rows: [],
|
||||
pulldowns: [
|
||||
{
|
||||
type: 'query',
|
||||
},
|
||||
{
|
||||
type: 'filtering'
|
||||
}
|
||||
],
|
||||
nav: [
|
||||
{
|
||||
type: 'timepicker'
|
||||
}
|
||||
],
|
||||
pulldowns: [ { type: 'filtering' } ],
|
||||
nav: [ { type: 'timepicker' } ],
|
||||
services: {},
|
||||
loader: {
|
||||
save_gist: false,
|
||||
@@ -54,12 +43,6 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
|
||||
load_local: false,
|
||||
hide: false
|
||||
},
|
||||
index: {
|
||||
interval: 'none',
|
||||
pattern: '_all',
|
||||
default: 'INDEX_MISSING',
|
||||
warm_fields: true
|
||||
},
|
||||
refresh: false
|
||||
};
|
||||
|
||||
@@ -136,7 +119,6 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
|
||||
|
||||
var dash_defaults = function(dashboard) {
|
||||
_.defaults(dashboard,_dash);
|
||||
_.defaults(dashboard.index,_dash.index);
|
||||
_.defaults(dashboard.loader,_dash.loader);
|
||||
|
||||
var filtering = _.findWhere(dashboard.pulldowns, {type: 'filtering'});
|
||||
@@ -158,11 +140,6 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
|
||||
// Make sure the dashboard being loaded has everything required
|
||||
dashboard = dash_defaults(dashboard);
|
||||
|
||||
// If not using time based indices, use the default index
|
||||
if(dashboard.index.interval === 'none') {
|
||||
self.indices = [dashboard.index.default];
|
||||
}
|
||||
|
||||
// Set the current dashboard
|
||||
self.current = _.clone(dashboard);
|
||||
|
||||
|
||||
@@ -9,9 +9,6 @@ define([
|
||||
var module = angular.module('kibana.services');
|
||||
|
||||
module.service('filterSrv', function(dashboard, $rootScope, $timeout) {
|
||||
// Create an object to hold our service state on the dashboard
|
||||
dashboard.current.services.filter = dashboard.current.services.filter || {};
|
||||
|
||||
// defaults
|
||||
var _d = {
|
||||
list: [],
|
||||
@@ -23,7 +20,10 @@ define([
|
||||
|
||||
// Call this whenever we need to reload the important stuff
|
||||
this.init = function() {
|
||||
dashboard.current.services.filter = dashboard.current.services.filter || {};
|
||||
|
||||
_.defaults(dashboard.current.services.filter, _d);
|
||||
|
||||
self.list = dashboard.current.services.filter.list;
|
||||
self.time = dashboard.current.services.filter.time;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user