mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 11:59:03 +08:00
refactor(ListAlert): update styles and button layout (#5931)
This commit is contained in:
parent
90b5f88413
commit
6c446226eb
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable react/display-name */
|
/* eslint-disable react/display-name */
|
||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import { Input, Typography } from 'antd';
|
import { Flex, Input, Typography } from 'antd';
|
||||||
import type { ColumnsType } from 'antd/es/table/interface';
|
import type { ColumnsType } from 'antd/es/table/interface';
|
||||||
import saveAlertApi from 'api/alerts/save';
|
import saveAlertApi from 'api/alerts/save';
|
||||||
import logEvent from 'api/common/logEvent';
|
import logEvent from 'api/common/logEvent';
|
||||||
@ -34,12 +34,7 @@ import { GettableAlert } from 'types/api/alerts/get';
|
|||||||
import AppReducer from 'types/reducer/app';
|
import AppReducer from 'types/reducer/app';
|
||||||
|
|
||||||
import DeleteAlert from './DeleteAlert';
|
import DeleteAlert from './DeleteAlert';
|
||||||
import {
|
import { Button, ColumnButton, SearchContainer } from './styles';
|
||||||
Button,
|
|
||||||
ButtonContainer,
|
|
||||||
ColumnButton,
|
|
||||||
SearchContainer,
|
|
||||||
} from './styles';
|
|
||||||
import Status from './TableComponents/Status';
|
import Status from './TableComponents/Status';
|
||||||
import ToggleAlertState from './ToggleAlertState';
|
import ToggleAlertState from './ToggleAlertState';
|
||||||
import { alertActionLogEvent, filterAlerts } from './utils';
|
import { alertActionLogEvent, filterAlerts } from './utils';
|
||||||
@ -373,21 +368,25 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element {
|
|||||||
onChange={handleSearch}
|
onChange={handleSearch}
|
||||||
defaultValue={searchString}
|
defaultValue={searchString}
|
||||||
/>
|
/>
|
||||||
<ButtonContainer>
|
<Flex gap={12}>
|
||||||
|
{addNewAlert && (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={onClickNewAlertHandler}
|
||||||
|
icon={<PlusOutlined />}
|
||||||
|
>
|
||||||
|
New Alert
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
<TextToolTip
|
<TextToolTip
|
||||||
{...{
|
{...{
|
||||||
text: `More details on how to create alerts`,
|
text: `More details on how to create alerts`,
|
||||||
url:
|
url:
|
||||||
'https://signoz.io/docs/alerts/?utm_source=product&utm_medium=list-alerts',
|
'https://signoz.io/docs/alerts/?utm_source=product&utm_medium=list-alerts',
|
||||||
|
urlText: 'Learn More',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
</Flex>
|
||||||
{addNewAlert && (
|
|
||||||
<Button onClick={onClickNewAlertHandler} icon={<PlusOutlined />}>
|
|
||||||
New Alert
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</ButtonContainer>
|
|
||||||
</SearchContainer>
|
</SearchContainer>
|
||||||
<DynamicColumnTable
|
<DynamicColumnTable
|
||||||
tablesource={TableDataSource.Alert}
|
tablesource={TableDataSource.Alert}
|
||||||
|
@ -9,12 +9,6 @@ export const SearchContainer = styled.div`
|
|||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const ButtonContainer = styled.div`
|
|
||||||
&&& {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
export const Button = styled(ButtonComponent)`
|
export const Button = styled(ButtonComponent)`
|
||||||
&&& {
|
&&& {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user