import * as React from 'react'; import './index.less'; import { userLogOut } from 'lib/api'; import { notification, Dropdown, Icon, Tooltip, Popover } from 'component/antd'; import { urlPrefix } from 'constants/left-menu'; import { region, IRegionIdcs } from 'store/region'; import logoUrl from '../../assets/image/kafka-logo.png'; import userIcon from '../../assets/image/normal.png'; import weChat from '../../assets/image/wechat.jpeg'; import { users } from 'store/users'; import { observer } from 'mobx-react'; import { Link } from 'react-router-dom'; import './index.less'; interface IHeader { active: string; } interface IMenuItem { active: boolean; label: string; href: string; show: boolean; } export const Header = observer((props: IHeader) => { const { active } = props; const role = users.currentUser.role; const headerMenu = [{ active: active === 'topic', label: 'Topic管理', href: `/topic`, show: true, }, { active: active === 'cluster', label: '集群管理', href: `/cluster`, show: true, }, { active: active === 'alarm', label: '监控告警', href: `/alarm`, show: true, }, { active: active === 'admin', label: '运维管控', href: `/admin`, show: role !== 0, }, { active: active === 'expert', label: '专家服务', href: `/expert`, show: role === 2, }]; const logOut = () => { userLogOut().then(() => { notification.success({ message: '退出成功' }); }); }; const content = (