import './styles.scss'; import React from 'react'; import { RouteComponentProps } from 'react-router'; import { withRouter } from 'react-router-dom'; import { Layout, Icon, Button, Menu, Dropdown, Modal, Row, Col, } from 'antd'; import Text from 'antd/lib/typography/Text'; import getCore from 'cvat-core'; import { CVATLogo, AccountIcon, } from 'icons'; const core = getCore(); const serverHost = core.config.backendAPI.slice(0, -7); interface HeaderContainerProps { onLogout: () => void; logoutFetching: boolean; installedAnalytics: boolean; installedAutoAnnotation: boolean; installedTFAnnotation: boolean; installedTFSegmentation: boolean; username: string; serverAbout: any; } type Props = HeaderContainerProps & RouteComponentProps; function HeaderContainer(props: Props): JSX.Element { const { installedTFSegmentation, installedAutoAnnotation, installedTFAnnotation, installedAnalytics, username, serverAbout, onLogout, logoutFetching, } = props; const renderModels = installedAutoAnnotation || installedTFAnnotation || installedTFSegmentation; function aboutModal(): void { const CHANGELOG = 'https://github.com/opencv/cvat/blob/develop/CHANGELOG.md'; const LICENSE = 'https://github.com/opencv/cvat/blob/develop/LICENSE'; const GITTER = 'https://gitter.im/opencv-cvat'; const FORUM = 'https://software.intel.com/en-us/forums/intel-distribution-of-openvino-toolkit'; Modal.info({ title: `${serverAbout.name}`, content: (

{`${serverAbout.description}`}

Server version: {` ${serverAbout.version}`}

Client version: {` ${core.client.version}`}

{'What\'s new?'} License Need help? Forum on Intel Developer Zone
), width: 800, okButtonProps: { style: { width: '100px', }, }, }); } const menu = ( props.history.push('/settings') } > Settings aboutModal()}> About {logoutFetching ? : } Logout ); return (
{ renderModels && ( )} { installedAnalytics && ( )}
{username.length > 14 ? `${username.slice(0, 10)} ...` : username}
); } export default withRouter(HeaderContainer);