|
|
|
@ -7,8 +7,12 @@ import React from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { useHistory } from 'react-router';
|
|
|
|
import { useHistory } from 'react-router';
|
|
|
|
import { Row, Col } from 'antd/lib/grid';
|
|
|
|
import { Row, Col } from 'antd/lib/grid';
|
|
|
|
|
|
|
|
import Icon, {
|
|
|
|
|
|
|
|
ContactsOutlined, SettingOutlined, InfoCircleOutlined, EditOutlined,
|
|
|
|
|
|
|
|
LoadingOutlined, LogoutOutlined, GithubOutlined,
|
|
|
|
|
|
|
|
QuestionCircleOutlined, CaretDownOutlined,
|
|
|
|
|
|
|
|
} from '@ant-design/icons';
|
|
|
|
import Layout from 'antd/lib/layout';
|
|
|
|
import Layout from 'antd/lib/layout';
|
|
|
|
import Icon from 'antd/lib/icon';
|
|
|
|
|
|
|
|
import Button from 'antd/lib/button';
|
|
|
|
import Button from 'antd/lib/button';
|
|
|
|
import Menu from 'antd/lib/menu';
|
|
|
|
import Menu from 'antd/lib/menu';
|
|
|
|
import Dropdown from 'antd/lib/dropdown';
|
|
|
|
import Dropdown from 'antd/lib/dropdown';
|
|
|
|
@ -208,28 +212,28 @@ function HeaderContainer(props: Props): JSX.Element {
|
|
|
|
window.open(`${tool.server.host}/admin`, '_blank');
|
|
|
|
window.open(`${tool.server.host}/admin`, '_blank');
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Icon type='control' />
|
|
|
|
<ContactsOutlined />
|
|
|
|
Admin page
|
|
|
|
Admin page
|
|
|
|
</Menu.Item>
|
|
|
|
</Menu.Item>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
<Menu.Item title={`Press ${switchSettingsShortcut} to switch`} onClick={() => switchSettingsDialog(true)}>
|
|
|
|
<Menu.Item title={`Press ${switchSettingsShortcut} to switch`} onClick={() => switchSettingsDialog(true)}>
|
|
|
|
<Icon type='setting' />
|
|
|
|
<SettingOutlined />
|
|
|
|
Settings
|
|
|
|
Settings
|
|
|
|
</Menu.Item>
|
|
|
|
</Menu.Item>
|
|
|
|
<Menu.Item onClick={showAboutModal}>
|
|
|
|
<Menu.Item onClick={showAboutModal}>
|
|
|
|
<Icon type='info-circle' />
|
|
|
|
<InfoCircleOutlined />
|
|
|
|
About
|
|
|
|
About
|
|
|
|
</Menu.Item>
|
|
|
|
</Menu.Item>
|
|
|
|
{renderChangePasswordItem && (
|
|
|
|
{renderChangePasswordItem && (
|
|
|
|
<Menu.Item onClick={(): void => switchChangePasswordDialog(true)} disabled={changePasswordFetching}>
|
|
|
|
<Menu.Item onClick={(): void => switchChangePasswordDialog(true)} disabled={changePasswordFetching}>
|
|
|
|
{changePasswordFetching ? <Icon type='loading' /> : <Icon type='edit' />}
|
|
|
|
{changePasswordFetching ? <LoadingOutlined /> : <EditOutlined />}
|
|
|
|
Change password
|
|
|
|
Change password
|
|
|
|
</Menu.Item>
|
|
|
|
</Menu.Item>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
<Menu.Item onClick={onLogout} disabled={logoutFetching}>
|
|
|
|
<Menu.Item onClick={onLogout} disabled={logoutFetching}>
|
|
|
|
{logoutFetching ? <Icon type='loading' /> : <Icon type='logout' />}
|
|
|
|
{logoutFetching ? <LoadingOutlined /> : <LogoutOutlined />}
|
|
|
|
Logout
|
|
|
|
Logout
|
|
|
|
</Menu.Item>
|
|
|
|
</Menu.Item>
|
|
|
|
</Menu>
|
|
|
|
</Menu>
|
|
|
|
@ -239,7 +243,6 @@ function HeaderContainer(props: Props): JSX.Element {
|
|
|
|
<Layout.Header className='cvat-header'>
|
|
|
|
<Layout.Header className='cvat-header'>
|
|
|
|
<div className='cvat-left-header'>
|
|
|
|
<div className='cvat-left-header'>
|
|
|
|
<Icon className='cvat-logo-icon' component={CVATLogo} />
|
|
|
|
<Icon className='cvat-logo-icon' component={CVATLogo} />
|
|
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
className='cvat-header-button'
|
|
|
|
className='cvat-header-button'
|
|
|
|
type='link'
|
|
|
|
type='link'
|
|
|
|
@ -305,7 +308,7 @@ function HeaderContainer(props: Props): JSX.Element {
|
|
|
|
window.open(GITHUB_URL, '_blank');
|
|
|
|
window.open(GITHUB_URL, '_blank');
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Icon type='github' />
|
|
|
|
<GithubOutlined />
|
|
|
|
<Text className='cvat-text-color'>GitHub</Text>
|
|
|
|
<Text className='cvat-text-color'>GitHub</Text>
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
@ -319,7 +322,7 @@ function HeaderContainer(props: Props): JSX.Element {
|
|
|
|
window.open(`${tool.server.host}/documentation/user_guide.html`, '_blank');
|
|
|
|
window.open(`${tool.server.host}/documentation/user_guide.html`, '_blank');
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Icon type='question-circle' />
|
|
|
|
<QuestionCircleOutlined />
|
|
|
|
Help
|
|
|
|
Help
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<Dropdown overlay={menu} className='cvat-header-menu-dropdown'>
|
|
|
|
<Dropdown overlay={menu} className='cvat-header-menu-dropdown'>
|
|
|
|
@ -328,7 +331,7 @@ function HeaderContainer(props: Props): JSX.Element {
|
|
|
|
<Text strong>
|
|
|
|
<Text strong>
|
|
|
|
{user.username.length > 14 ? `${user.username.slice(0, 10)} ...` : user.username}
|
|
|
|
{user.username.length > 14 ? `${user.username.slice(0, 10)} ...` : user.username}
|
|
|
|
</Text>
|
|
|
|
</Text>
|
|
|
|
<Icon className='cvat-header-menu-icon' type='caret-down' />
|
|
|
|
<CaretDownOutlined className='cvat-header-menu-icon' />
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</Dropdown>
|
|
|
|
</Dropdown>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|