2023-06-08 10:49:33 +03:00
|
|
|
import {
|
|
|
|
|
AlertOutlined,
|
|
|
|
|
AlignLeftOutlined,
|
|
|
|
|
ApiOutlined,
|
|
|
|
|
BarChartOutlined,
|
|
|
|
|
BugOutlined,
|
|
|
|
|
DashboardFilled,
|
|
|
|
|
DeploymentUnitOutlined,
|
|
|
|
|
LineChartOutlined,
|
|
|
|
|
MenuOutlined,
|
|
|
|
|
SettingOutlined,
|
|
|
|
|
} from '@ant-design/icons';
|
|
|
|
|
import { MenuProps, Space, Typography } from 'antd';
|
|
|
|
|
import ROUTES from 'constants/routes';
|
|
|
|
|
|
|
|
|
|
import { Tags } from './styles';
|
|
|
|
|
|
|
|
|
|
type MenuItem = Required<MenuProps>['items'][number];
|
|
|
|
|
|
|
|
|
|
export const createLabelWithTags = (
|
|
|
|
|
label: string,
|
|
|
|
|
tags: string[],
|
|
|
|
|
): JSX.Element => (
|
|
|
|
|
<Space>
|
|
|
|
|
<div>{label}</div>
|
|
|
|
|
{tags.map((tag) => (
|
|
|
|
|
<Tags key={tag}>
|
|
|
|
|
<Typography.Text>{tag}</Typography.Text>
|
|
|
|
|
</Tags>
|
|
|
|
|
))}
|
|
|
|
|
</Space>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const menus: SidebarMenu[] = [
|
|
|
|
|
{
|
|
|
|
|
key: ROUTES.APPLICATION,
|
|
|
|
|
label: 'Services',
|
|
|
|
|
icon: <BarChartOutlined />,
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-06-19 15:57:58 +03:00
|
|
|
key: ROUTES.TRACE,
|
2023-06-08 10:49:33 +03:00
|
|
|
label: 'Traces',
|
|
|
|
|
icon: <MenuOutlined />,
|
2023-06-19 15:57:58 +03:00
|
|
|
// children: [
|
|
|
|
|
// {
|
|
|
|
|
// key: ROUTES.TRACE,
|
|
|
|
|
// label: 'Traces',
|
|
|
|
|
// },
|
|
|
|
|
// TODO: uncomment when will be ready explorer
|
|
|
|
|
// {
|
|
|
|
|
// key: ROUTES.TRACES_EXPLORER,
|
|
|
|
|
// label: "Explorer",
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
2023-06-08 10:49:33 +03:00
|
|
|
},
|
|
|
|
|
{
|
2023-06-19 15:57:58 +03:00
|
|
|
key: ROUTES.LOGS,
|
2023-06-08 10:49:33 +03:00
|
|
|
label: 'Logs',
|
|
|
|
|
icon: <AlignLeftOutlined />,
|
2023-06-19 15:57:58 +03:00
|
|
|
// children: [
|
|
|
|
|
// {
|
|
|
|
|
// key: ROUTES.LOGS,
|
|
|
|
|
// label: 'Search',
|
|
|
|
|
// },
|
|
|
|
|
// TODO: uncomment when will be ready explorer
|
|
|
|
|
// {
|
|
|
|
|
// key: ROUTES.LOGS_EXPLORER,
|
|
|
|
|
// label: 'Views',
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
2023-08-02 11:22:24 +05:30
|
|
|
// {
|
|
|
|
|
// key: ROUTES.PIPELINES,
|
|
|
|
|
// label: 'Pipelines',
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
2023-06-08 10:49:33 +03:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: ROUTES.ALL_DASHBOARD,
|
|
|
|
|
label: 'Dashboards',
|
|
|
|
|
icon: <DashboardFilled />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: ROUTES.LIST_ALL_ALERT,
|
|
|
|
|
label: 'Alerts',
|
|
|
|
|
icon: <AlertOutlined />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: ROUTES.ALL_ERROR,
|
|
|
|
|
label: 'Exceptions',
|
|
|
|
|
icon: <BugOutlined />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: ROUTES.SERVICE_MAP,
|
|
|
|
|
label: 'Service Map',
|
|
|
|
|
icon: <DeploymentUnitOutlined />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: ROUTES.USAGE_EXPLORER,
|
|
|
|
|
label: 'Usage Explorer',
|
|
|
|
|
icon: <LineChartOutlined />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: ROUTES.SETTINGS,
|
|
|
|
|
label: 'Settings',
|
|
|
|
|
icon: <SettingOutlined />,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: ROUTES.INSTRUMENTATION,
|
|
|
|
|
label: 'Get Started',
|
|
|
|
|
icon: <ApiOutlined />,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
type SidebarMenu = MenuItem & {
|
|
|
|
|
tags?: string[];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default menus;
|