diff options
Diffstat (limited to 'app/assets/javascripts/monitoring')
-rw-r--r-- | app/assets/javascripts/monitoring/components/dashboard.vue | 3 | ||||
-rw-r--r-- | app/assets/javascripts/monitoring/components/embed.vue | 3 | ||||
-rw-r--r-- | app/assets/javascripts/monitoring/constants.js | 36 |
3 files changed, 4 insertions, 38 deletions
diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue index a0bd45bef5e..dbfb3e97c20 100644 --- a/app/assets/javascripts/monitoring/components/dashboard.vue +++ b/app/assets/javascripts/monitoring/components/dashboard.vue @@ -31,7 +31,8 @@ import DashboardsDropdown from './dashboards_dropdown.vue'; import TrackEventDirective from '~/vue_shared/directives/track_event'; import { getAddMetricTrackingOptions, timeRangeToUrl, timeRangeFromUrl } from '../utils'; -import { defaultTimeRange, timeRanges, metricStates } from '../constants'; +import { metricStates } from '../constants'; +import { defaultTimeRange, timeRanges } from '~/vue_shared/constants'; export default { components: { diff --git a/app/assets/javascripts/monitoring/components/embed.vue b/app/assets/javascripts/monitoring/components/embed.vue index 826b73908a4..6182b570e76 100644 --- a/app/assets/javascripts/monitoring/components/embed.vue +++ b/app/assets/javascripts/monitoring/components/embed.vue @@ -3,7 +3,8 @@ import { mapActions, mapState, mapGetters } from 'vuex'; import PanelType from 'ee_else_ce/monitoring/components/panel_type.vue'; import { convertToFixedRange } from '~/lib/utils/datetime_range'; import { timeRangeFromUrl, removeTimeRangeParams } from '../utils'; -import { sidebarAnimationDuration, defaultTimeRange } from '../constants'; +import { sidebarAnimationDuration } from '../constants'; +import { defaultTimeRange } from '~/vue_shared/constants'; let sidebarMutationObserver; diff --git a/app/assets/javascripts/monitoring/constants.js b/app/assets/javascripts/monitoring/constants.js index ddf6c9878df..cc7f5af2259 100644 --- a/app/assets/javascripts/monitoring/constants.js +++ b/app/assets/javascripts/monitoring/constants.js @@ -1,5 +1,3 @@ -import { __ } from '~/locale'; - export const PROMETHEUS_TIMEOUT = 120000; // TWO_MINUTES /** @@ -89,37 +87,3 @@ export const dateFormats = { timeOfDay: 'h:MM TT', default: 'dd mmm yyyy, h:MMTT', }; - -export const timeRanges = [ - { - label: __('30 minutes'), - duration: { seconds: 60 * 30 }, - }, - { - label: __('3 hours'), - duration: { seconds: 60 * 60 * 3 }, - }, - { - label: __('8 hours'), - duration: { seconds: 60 * 60 * 8 }, - default: true, - }, - { - label: __('1 day'), - duration: { seconds: 60 * 60 * 24 * 1 }, - }, - { - label: __('3 days'), - duration: { seconds: 60 * 60 * 24 * 3 }, - }, - { - label: __('1 week'), - duration: { seconds: 60 * 60 * 24 * 7 * 1 }, - }, - { - label: __('1 month'), - duration: { seconds: 60 * 60 * 24 * 30 }, - }, -]; - -export const defaultTimeRange = timeRanges.find(tr => tr.default); |