mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-13 08:31:33 +08:00

* feat: added celery task feature - with task garphs and details * feat: added celery bar graph toggle states UI * feat: added histogram charts and right panel * feat: added task latency graph with different states * feat: added right panel trace navigation * feat: added navigateToTrace logic * feat: added value graph and global filter logic * feat: added dynamic stepinterval based on timerange * feat: changed histogram occurences to bar * feat: onclick right panels for celery state bar graphs * feat: pagesetup and tabs with kafka setup * feat: custom series for bar for color generation * feat: fixed test cases * feat: update styles
58 lines
1.4 KiB
TypeScript
58 lines
1.4 KiB
TypeScript
import './CeleryTaskGraph.style.scss';
|
|
|
|
import { Col, Row } from 'antd';
|
|
import { Dispatch, SetStateAction } from 'react';
|
|
|
|
interface TabData {
|
|
label: string;
|
|
key: string;
|
|
}
|
|
|
|
export enum CeleryTaskState {
|
|
All = 'all',
|
|
Failed = 'failed',
|
|
Retry = 'retry',
|
|
Successful = 'successful',
|
|
}
|
|
|
|
function CeleryTaskStateGraphConfig({
|
|
barState,
|
|
setBarState,
|
|
}: {
|
|
setBarState: Dispatch<SetStateAction<CeleryTaskState>>;
|
|
barState: CeleryTaskState;
|
|
}): JSX.Element {
|
|
const tabs: TabData[] = [
|
|
{ label: 'All Tasks', key: CeleryTaskState.All },
|
|
{ label: 'Failed', key: CeleryTaskState.Failed },
|
|
{ label: 'Retry', key: CeleryTaskState.Retry },
|
|
{ label: 'Successful', key: CeleryTaskState.Successful },
|
|
];
|
|
|
|
const handleTabClick = (key: CeleryTaskState): void => {
|
|
setBarState(key as CeleryTaskState);
|
|
};
|
|
|
|
return (
|
|
<Row className="celery-task-states">
|
|
{tabs.map((tab, index) => (
|
|
<Col
|
|
key={tab.key}
|
|
onClick={(): void => handleTabClick(tab.key as CeleryTaskState)}
|
|
className={`celery-task-states__tab ${
|
|
tab.key === barState ? 'celery-task-states__tab--selected' : ''
|
|
}`}
|
|
data-last-tab={index === tabs.length - 1}
|
|
>
|
|
<div className="celery-task-states__label-wrapper">
|
|
<div className="celery-task-states__label">{tab.label}</div>
|
|
</div>
|
|
{tab.key === barState && <div className="celery-task-states__indicator" />}
|
|
</Col>
|
|
))}
|
|
</Row>
|
|
);
|
|
}
|
|
|
|
export { CeleryTaskStateGraphConfig };
|