mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-11 17:59:09 +08:00
feat: alert history feedback changes (#5903)
* fix: make the default offset 0 * chore: add beta tag to alert history * fix: don't add 5 minutes earlier to the timeline graph data
This commit is contained in:
parent
f3cb3b9840
commit
41d3342a42
@ -26,17 +26,14 @@ function HorizontalTimelineGraph({
|
||||
return [[], []];
|
||||
}
|
||||
|
||||
// add a first and last entry to make sure the graph displays all the data
|
||||
const FIVE_MINUTES_IN_SECONDS = 300;
|
||||
// add an entry for the end time of the last entry to make sure the graph displays all the data
|
||||
|
||||
const timestamps = [
|
||||
data[0].start / 1000 - FIVE_MINUTES_IN_SECONDS, // 5 minutes before the first entry
|
||||
...data.map((item) => item.start / 1000),
|
||||
data[data.length - 1].end / 1000, // end value of last entry
|
||||
];
|
||||
|
||||
const states = [
|
||||
ALERT_STATUS[data[0].state], // Same state as the first entry
|
||||
...data.map((item) => ALERT_STATUS[item.state]),
|
||||
ALERT_STATUS[data[data.length - 1].state], // Same state as the last entry
|
||||
];
|
||||
|
@ -26,6 +26,7 @@ import history from 'lib/history';
|
||||
import { History, Table } from 'lucide-react';
|
||||
import EditRules from 'pages/EditRules';
|
||||
import { OrderPreferenceItems } from 'pages/Logs/config';
|
||||
import BetaTag from 'periscope/components/BetaTag/BetaTag';
|
||||
import PaginationInfoText from 'periscope/components/PaginationInfoText/PaginationInfoText';
|
||||
import { useAlertRule } from 'providers/Alert';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
@ -125,6 +126,7 @@ export const useRouteTabUtils = (): { routes: TabRoutes[] } => {
|
||||
<div className="tab-item">
|
||||
<History size={14} />
|
||||
History
|
||||
<BetaTag />
|
||||
</div>
|
||||
),
|
||||
route: getRouteUrl(AlertDetailsTab.HISTORY),
|
||||
@ -256,7 +258,7 @@ export const useGetAlertRuleDetailsTimelineTable = (): GetAlertRuleDetailsTimeli
|
||||
const { updatedOrder, offset } = useMemo(
|
||||
() => ({
|
||||
updatedOrder: params.get(urlKey.order) ?? OrderPreferenceItems.ASC,
|
||||
offset: parseInt(params.get(urlKey.offset) ?? '1', 10),
|
||||
offset: parseInt(params.get(urlKey.offset) ?? '0', 10),
|
||||
}),
|
||||
[params],
|
||||
);
|
||||
|
9
frontend/src/periscope/components/BetaTag/BetaTag.tsx
Normal file
9
frontend/src/periscope/components/BetaTag/BetaTag.tsx
Normal file
@ -0,0 +1,9 @@
|
||||
import { Tag } from 'antd';
|
||||
|
||||
export default function BetaTag(): JSX.Element {
|
||||
return (
|
||||
<Tag bordered={false} color="geekblue">
|
||||
Beta
|
||||
</Tag>
|
||||
);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user