diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-26 12:07:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-26 12:07:52 +0300 |
commit | 7e019504f5ac6decde690565857238e7e59aa034 (patch) | |
tree | fab8832b40e25fc9bc1ae54b9303b95ea146b5d5 /app/assets/javascripts/monitoring/components | |
parent | 116d4e56e83a1f408afe710ce070e699ba206475 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/monitoring/components')
-rw-r--r-- | app/assets/javascripts/monitoring/components/dashboard.vue | 16 | ||||
-rw-r--r-- | app/assets/javascripts/monitoring/components/panel_type.vue | 5 |
2 files changed, 20 insertions, 1 deletions
diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue index dbfb3e97c20..531d23bb6e5 100644 --- a/app/assets/javascripts/monitoring/components/dashboard.vue +++ b/app/assets/javascripts/monitoring/components/dashboard.vue @@ -19,7 +19,12 @@ import PanelType from 'ee_else_ce/monitoring/components/panel_type.vue'; import { s__ } from '~/locale'; import createFlash from '~/flash'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; -import { mergeUrlParams, redirectTo, refreshCurrentPage } from '~/lib/utils/url_utility'; +import { + mergeUrlParams, + redirectTo, + refreshCurrentPage, + updateHistory, +} from '~/lib/utils/url_utility'; import invalidUrl from '~/lib/utils/invalid_url'; import Icon from '~/vue_shared/components/icon.vue'; import DateTimePicker from '~/vue_shared/components/date_time_picker/date_time_picker.vue'; @@ -356,6 +361,14 @@ export default { refreshDashboard() { refreshCurrentPage(); }, + + onTimeRangeZoom({ start, end }) { + updateHistory({ + url: mergeUrlParams({ start, end }, window.location.href), + title: document.title, + }); + this.selectedTimeRange = { start, end }; + }, }, addMetric: { title: s__('Metrics|Add metric'), @@ -577,6 +590,7 @@ export default { :alerts-endpoint="alertsEndpoint" :prometheus-alerts-available="prometheusAlertsAvailable" :index="`${index}-${graphIndex}`" + @timerangezoom="onTimeRangeZoom" /> </div> </div> diff --git a/app/assets/javascripts/monitoring/components/panel_type.vue b/app/assets/javascripts/monitoring/components/panel_type.vue index ba92b72a71d..79f2c8ad41f 100644 --- a/app/assets/javascripts/monitoring/components/panel_type.vue +++ b/app/assets/javascripts/monitoring/components/panel_type.vue @@ -23,6 +23,10 @@ import MonitorEmptyChart from './charts/empty_chart.vue'; import TrackEventDirective from '~/vue_shared/directives/track_event'; import { timeRangeToUrl, downloadCSVOptions, generateLinkToChartOptions } from '../utils'; +const events = { + timeRangeZoom: 'timerangezoom', +}; + export default { components: { MonitorSingleStatChart, @@ -159,6 +163,7 @@ export default { }, onDatazoom({ start, end }) { this.zoomedTimeRange = { start, end }; + this.$emit(events.timeRangeZoom, { start, end }); }, }, }; |