diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-23 09:09:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-23 09:09:07 +0000 |
commit | f47c768fad17d4c876e96524f83f8306f071db66 (patch) | |
tree | 9350146fdfb67f001716357d745436338621b590 /app/assets/javascripts/monitoring/constants.js | |
parent | 0f8c2334f0e57a22bf10e4485c17f856289e4fb4 (diff) | |
download | gitlab-ce-f47c768fad17d4c876e96524f83f8306f071db66.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/monitoring/constants.js')
-rw-r--r-- | app/assets/javascripts/monitoring/constants.js | 64 |
1 files changed, 30 insertions, 34 deletions
diff --git a/app/assets/javascripts/monitoring/constants.js b/app/assets/javascripts/monitoring/constants.js index 398b45b9012..2d5361a5029 100644 --- a/app/assets/javascripts/monitoring/constants.js +++ b/app/assets/javascripts/monitoring/constants.js @@ -50,11 +50,6 @@ export const metricStates = { export const sidebarAnimationDuration = 300; // milliseconds. export const chartHeight = 300; -/** - * Valid strings for this regex are - * 2019-10-01 and 2019-10-01 01:02:03 - */ -export const dateTimePickerRegex = /^(\d{4})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])(?: (0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]))?$/; export const graphTypes = { deploymentData: 'scatter', @@ -83,38 +78,39 @@ export const lineWidths = { default: 2, }; -export const timeWindows = { - thirtyMinutes: __('30 minutes'), - threeHours: __('3 hours'), - eightHours: __('8 hours'), - oneDay: __('1 day'), - threeDays: __('3 days'), - oneWeek: __('1 week'), -}; - export const dateFormats = { timeOfDay: 'h:MM TT', default: 'dd mmm yyyy, h:MMTT', - dateTimePicker: { - format: 'yyyy-mm-dd hh:mm:ss', - ISODate: "yyyy-mm-dd'T'HH:MM:ss'Z'", - stringDate: 'yyyy-mm-dd HH:MM:ss', - }, }; -export const secondsIn = { - thirtyMinutes: 60 * 30, - threeHours: 60 * 60 * 3, - eightHours: 60 * 60 * 8, - oneDay: 60 * 60 * 24 * 1, - threeDays: 60 * 60 * 24 * 3, - oneWeek: 60 * 60 * 24 * 7 * 1, +export const datePickerTimeWindows = { + thirtyMinutes: { + label: __('30 minutes'), + seconds: 60 * 30, + }, + threeHours: { + label: __('3 hours'), + seconds: 60 * 60 * 3, + }, + eightHours: { + label: __('8 hours'), + seconds: 60 * 60 * 8, + default: true, + }, + oneDay: { + label: __('1 day'), + seconds: 60 * 60 * 24 * 1, + }, + threeDays: { + label: __('3 days'), + seconds: 60 * 60 * 24 * 3, + }, + oneWeek: { + label: __('1 week'), + seconds: 60 * 60 * 24 * 7 * 1, + }, + twoWeeks: { + label: __('2 weeks'), + seconds: 60 * 60 * 24 * 7 * 2, + }, }; - -export const timeWindowsKeyNames = Object.keys(secondsIn).reduce( - (otherTimeWindows, timeWindow) => ({ - ...otherTimeWindows, - [timeWindow]: timeWindow, - }), - {}, -); |