diff --git a/public/app/features/dashboard/containers/DashboardPage.tsx b/public/app/features/dashboard/containers/DashboardPage.tsx index 224b04707a3..5f5e8d30559 100644 --- a/public/app/features/dashboard/containers/DashboardPage.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.tsx @@ -42,6 +42,9 @@ type DashboardPageRouteSearchParams = { editview?: string; inspect?: string; kiosk?: UrlQueryValue; + from?: string; + to?: string; + refresh?: string; }; export interface Props extends GrafanaRouteComponentProps { @@ -138,9 +141,19 @@ export class DashboardPage extends PureComponent { } if (prevProps.location.search !== this.props.location.search) { - getTimeSrv().updateTimeRangeFromUrl(); + const prevUrlParams = prevProps.queryParams; + const urlParams = this.props.queryParams; + + if (urlParams?.from !== prevUrlParams?.from && urlParams?.to !== prevUrlParams?.to) { + getTimeSrv().updateTimeRangeFromUrl(); + } + + if (!prevUrlParams?.refresh && urlParams?.refresh) { + getTimeSrv().setAutoRefresh(urlParams.refresh); + } const templateVarChanges = findTemplateVarChanges(this.props.queryParams, prevProps.queryParams); + if (templateVarChanges) { templateVarsChangedInUrl(templateVarChanges); }