mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
save options object to savedDashboard, use in appState directly
This commit is contained in:
parent
c165d8fd82
commit
5f6307f5d8
2 changed files with 7 additions and 6 deletions
|
@ -81,9 +81,7 @@ define(function (require) {
|
|||
var stateDefaults = {
|
||||
title: dash.title,
|
||||
panels: dash.panelsJSON ? JSON.parse(dash.panelsJSON) : [],
|
||||
options: {
|
||||
darkTheme: dash.darkTheme
|
||||
},
|
||||
options: dash.optionsJSON ? JSON.parse(dash.optionsJSON) : {},
|
||||
query: extractQueryFromFilters(dash.searchSource.getOwn('filter')) || {query_string: {query: '*'}},
|
||||
filters: _.reject(dash.searchSource.getOwn('filter'), matchQueryFilter),
|
||||
};
|
||||
|
@ -163,7 +161,7 @@ define(function (require) {
|
|||
dash.panelsJSON = angular.toJson($state.panels);
|
||||
dash.timeFrom = dash.timeRestore ? timefilter.time.from : undefined;
|
||||
dash.timeTo = dash.timeRestore ? timefilter.time.to : undefined;
|
||||
dash.darkTheme = $state.options.darkTheme;
|
||||
dash.optionsJSON = angular.toJson($state.options);
|
||||
|
||||
dash.save()
|
||||
.then(function (id) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
define(function (require) {
|
||||
var module = require('ui/modules').get('app/dashboard');
|
||||
var angular = require('angular');
|
||||
var _ = require('lodash');
|
||||
var moment = require('moment');
|
||||
|
||||
|
@ -24,11 +25,13 @@ define(function (require) {
|
|||
hits: 0,
|
||||
description: '',
|
||||
panelsJSON: '[]',
|
||||
optionsJSON: angular.toJson({
|
||||
darkTheme: config.get('dashboard:defaultDarkTheme')
|
||||
}),
|
||||
version: 1,
|
||||
timeRestore: false,
|
||||
timeTo: undefined,
|
||||
timeFrom: undefined,
|
||||
darkTheme: config.get('dashboard:defaultDarkTheme')
|
||||
},
|
||||
|
||||
// if an indexPattern was saved with the searchsource of a SavedDashboard
|
||||
|
@ -46,11 +49,11 @@ define(function (require) {
|
|||
hits: 'integer',
|
||||
description: 'string',
|
||||
panelsJSON: 'string',
|
||||
optionsJSON: 'string',
|
||||
version: 'integer',
|
||||
timeRestore: 'boolean',
|
||||
timeTo: 'string',
|
||||
timeFrom: 'string',
|
||||
darkTheme: 'boolean'
|
||||
};
|
||||
|
||||
SavedDashboard.searchsource = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue