mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 00:08:10 -05:00
PublicDashboards: Ignore time range input and changes on public dashboard (#55412)
* Ignore time range input and changes on public dashboard * Use config instead of getConfig to access boot config
This commit is contained in:
@@ -148,6 +148,11 @@ export class TimeSrv {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private initTimeFromUrl() {
|
private initTimeFromUrl() {
|
||||||
|
// If we are in a public dashboard ignore the time range in the url
|
||||||
|
if (config.isPublicDashboardView) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const params = locationService.getSearch();
|
const params = locationService.getSearch();
|
||||||
|
|
||||||
if (params.get('time') && params.get('time.window')) {
|
if (params.get('time') && params.get('time.window')) {
|
||||||
@@ -275,6 +280,11 @@ export class TimeSrv {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTime(time: RawTimeRange, updateUrl = true) {
|
setTime(time: RawTimeRange, updateUrl = true) {
|
||||||
|
// If we are in a public dashboard ignore time range changes
|
||||||
|
if (config.isPublicDashboardView) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
extend(this.time, time);
|
extend(this.time, time);
|
||||||
|
|
||||||
// disable refresh if zoom in or zoom out
|
// disable refresh if zoom in or zoom out
|
||||||
|
|||||||
Reference in New Issue
Block a user