mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PanelData: Adds timeRange prop to PanelData (#19361)
* Refactor: Adds newTimeRange property to PanelData * Refactor: Handles timeRange prop after requests * Refactor: Makes timeRange mandatory * Refactor: Adds DefaultTimeRange
This commit is contained in:
committed by
Torkel Ödegaard
parent
e35de167f9
commit
889f8e3131
@@ -1,17 +1,22 @@
|
||||
// Libraries
|
||||
import _ from 'lodash';
|
||||
|
||||
// Utils
|
||||
import kbn from 'app/core/utils/kbn';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import { dateMath } from '@grafana/data';
|
||||
|
||||
// Types
|
||||
import { TimeRange, RawTimeRange, TimeZone } from '@grafana/data';
|
||||
import {
|
||||
dateMath,
|
||||
DefaultTimeRange,
|
||||
TimeRange,
|
||||
RawTimeRange,
|
||||
TimeZone,
|
||||
toUtc,
|
||||
dateTime,
|
||||
isDateTime,
|
||||
} from '@grafana/data';
|
||||
import { ITimeoutService, ILocationService } from 'angular';
|
||||
import { ContextSrv } from 'app/core/services/context_srv';
|
||||
import { DashboardModel } from '../state/DashboardModel';
|
||||
import { toUtc, dateTime, isDateTime } from '@grafana/data';
|
||||
import { getZoomedTimeRange, getShiftedTimeRange } from 'app/core/utils/timePicker';
|
||||
|
||||
export class TimeSrv {
|
||||
@@ -32,7 +37,7 @@ export class TimeSrv {
|
||||
private contextSrv: ContextSrv
|
||||
) {
|
||||
// default time
|
||||
this.time = { from: '6h', to: 'now' };
|
||||
this.time = DefaultTimeRange.raw;
|
||||
|
||||
$rootScope.$on('zoom-out', this.zoomOut.bind(this));
|
||||
$rootScope.$on('shift-time', this.shiftTime.bind(this));
|
||||
|
||||
Reference in New Issue
Block a user