[Monitoring] No longer overwriting time to the 1h default (#88102)
* No longer overwriting time to the 1h default * Added auto refresh
This commit is contained in:
parent
0c9c2c91f5
commit
ca3f4de7d7
|
@ -18,7 +18,6 @@ import {
|
||||||
FeatureCatalogueCategory,
|
FeatureCatalogueCategory,
|
||||||
HomePublicPluginSetup,
|
HomePublicPluginSetup,
|
||||||
} from '../../../../src/plugins/home/public';
|
} from '../../../../src/plugins/home/public';
|
||||||
import { UI_SETTINGS } from '../../../../src/plugins/data/public';
|
|
||||||
import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public';
|
import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public';
|
||||||
import { MonitoringStartPluginDependencies, MonitoringConfig } from './types';
|
import { MonitoringStartPluginDependencies, MonitoringConfig } from './types';
|
||||||
import { TriggersAndActionsUIPublicPluginSetup } from '../../triggers_actions_ui/public';
|
import { TriggersAndActionsUIPublicPluginSetup } from '../../triggers_actions_ui/public';
|
||||||
|
@ -98,7 +97,6 @@ export class MonitoringPlugin
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setInitialTimefilter(deps);
|
this.setInitialTimefilter(deps);
|
||||||
|
|
||||||
const monitoringApp = new AngularApp(deps);
|
const monitoringApp = new AngularApp(deps);
|
||||||
const removeHistoryListener = params.history.listen((location) => {
|
const removeHistoryListener = params.history.listen((location) => {
|
||||||
if (location.pathname === '' && location.hash === '') {
|
if (location.pathname === '' && location.hash === '') {
|
||||||
|
@ -121,18 +119,10 @@ export class MonitoringPlugin
|
||||||
|
|
||||||
public stop() {}
|
public stop() {}
|
||||||
|
|
||||||
private setInitialTimefilter({ core: coreContext, data }: MonitoringStartPluginDependencies) {
|
private setInitialTimefilter({ data }: MonitoringStartPluginDependencies) {
|
||||||
const { timefilter } = data.query.timefilter;
|
const { timefilter } = data.query.timefilter;
|
||||||
const { uiSettings } = coreContext;
|
|
||||||
const refreshInterval = { value: 10000, pause: false };
|
const refreshInterval = { value: 10000, pause: false };
|
||||||
const time = { from: 'now-1h', to: 'now' };
|
|
||||||
timefilter.setRefreshInterval(refreshInterval);
|
timefilter.setRefreshInterval(refreshInterval);
|
||||||
timefilter.setTime(time);
|
|
||||||
uiSettings.overrideLocalDefault(
|
|
||||||
UI_SETTINGS.TIMEPICKER_REFRESH_INTERVAL_DEFAULTS,
|
|
||||||
JSON.stringify(refreshInterval)
|
|
||||||
);
|
|
||||||
uiSettings.overrideLocalDefault(UI_SETTINGS.TIMEPICKER_TIME_DEFAULTS, JSON.stringify(time));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private getExternalConfig() {
|
private getExternalConfig() {
|
||||||
|
|
Loading…
Reference in a new issue