mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 13:35:54 +08:00
fix: edit form shows incorrect eval window when 24hours is saved (#1393)
* fix: edit form shows incorrect eval window when 24hours is saved * fix: edit form shows incorrect eval window when 24hours is saved * feat: added 4 hour window to alert ui Co-authored-by: Palash <palashgdev@gmail.com>
This commit is contained in:
parent
46f258747a
commit
a2e1c41343
@ -33,6 +33,7 @@
|
||||
"option_10min": "10 mins",
|
||||
"option_15min": "15 mins",
|
||||
"option_60min": "60 mins",
|
||||
"option_4hours": "4 hours",
|
||||
"option_24hours": "24 hours",
|
||||
"field_threshold": "Alert Threshold",
|
||||
"option_allthetimes": "all the times",
|
||||
|
@ -33,6 +33,7 @@
|
||||
"option_10min": "10 mins",
|
||||
"option_15min": "15 mins",
|
||||
"option_60min": "60 mins",
|
||||
"option_4hours": "4 hours",
|
||||
"option_24hours": "24 hours",
|
||||
"field_threshold": "Alert Threshold",
|
||||
"option_allthetimes": "all the times",
|
||||
|
@ -112,7 +112,8 @@ function RuleOptions({
|
||||
<Option value="10m0s">{t('option_10min')}</Option>
|
||||
<Option value="15m0s">{t('option_15min')}</Option>
|
||||
<Option value="60m0s">{t('option_60min')}</Option>
|
||||
<Option value="1440m0s">{t('option_24hours')}</Option>
|
||||
<Option value="4h0m0s">{t('option_4hours')}</Option>
|
||||
<Option value="24h0m0s">{t('option_24hours')}</Option>
|
||||
</InlineSelect>
|
||||
);
|
||||
};
|
||||
|
@ -126,7 +126,9 @@ export const toChartInterval = (evalWindow: string | undefined): Time => {
|
||||
return '30min';
|
||||
case '60m0s':
|
||||
return '30min';
|
||||
case '1440m0s':
|
||||
case '4h0m0s':
|
||||
return '4hr';
|
||||
case '24h0m0s':
|
||||
return '1day';
|
||||
default:
|
||||
return '5min';
|
||||
|
@ -7,6 +7,7 @@ type ThirtyMin = '30min';
|
||||
type OneMin = '1min';
|
||||
type SixHour = '6hr';
|
||||
type OneHour = '1hr';
|
||||
type FourHour = '4hr';
|
||||
type OneDay = '1day';
|
||||
type OneWeek = '1week';
|
||||
type Custom = 'custom';
|
||||
@ -17,6 +18,7 @@ export type Time =
|
||||
| FifteenMin
|
||||
| ThirtyMin
|
||||
| OneMin
|
||||
| FourHour
|
||||
| SixHour
|
||||
| OneHour
|
||||
| Custom
|
||||
|
@ -36,8 +36,9 @@ const GetMinMax = (
|
||||
// one week = one day * 7
|
||||
const minTimeAgo = getMinAgo({ minutes: 26 * 60 * 7 }).getTime();
|
||||
minTime = minTimeAgo;
|
||||
} else if (interval === '6hr') {
|
||||
const minTimeAgo = getMinAgo({ minutes: 6 * 60 }).getTime();
|
||||
} else if (['4hr', '6hr'].includes(interval)) {
|
||||
const h = parseInt(interval.replace('hr', ''), 10);
|
||||
const minTimeAgo = getMinAgo({ minutes: h * 60 }).getTime();
|
||||
minTime = minTimeAgo;
|
||||
} else if (interval === 'custom') {
|
||||
maxTime = (dateTimeRange || [])[1] || 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user