-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add about CVAT #1024
Merged
Merged
Add about CVAT #1024
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
78b52da
Add about CVAT
LiSa20120 fc75b5e
Changes to about button
LiSa20120 1f1ce86
Merge branch 'develop' of https://github.com/opencv/cvat into about
LiSa20120 7ae247f
Merge branch 'develop' of https://github.com/opencv/cvat into about
LiSa20120 6a533e1
Add about button
LiSa20120 167ed3e
Add about button
LiSa20120 df89e3f
Add about button
LiSa20120 46b2438
Merge branch 'develop' into about
LiSa20120 ed9ea9c
Update about-actions.ts
LiSa20120 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { AnyAction, Dispatch, ActionCreator } from 'redux'; | ||
import { ThunkAction } from 'redux-thunk'; | ||
|
||
import getCore from '../core'; | ||
|
||
const core = getCore(); | ||
|
||
export enum AboutActionTypes { | ||
GET_ABOUT = 'GET_ABOUT', | ||
GET_ABOUT_SUCCESS = 'GET_ABOUT_SUCCESS', | ||
GET_ABOUT_FAILED = 'GET_ABOUT_FAILED', | ||
} | ||
|
||
function getAbout(): AnyAction { | ||
const action = { | ||
type: AboutActionTypes.GET_ABOUT, | ||
payload: {}, | ||
}; | ||
|
||
return action; | ||
} | ||
|
||
function getAboutSuccess(about: any): AnyAction { | ||
const action = { | ||
type: AboutActionTypes.GET_ABOUT_SUCCESS, | ||
payload: { about }, | ||
}; | ||
|
||
return action; | ||
} | ||
|
||
function getAboutFailed(error: any): AnyAction { | ||
const action = { | ||
type: AboutActionTypes.GET_ABOUT_FAILED, | ||
payload: { error }, | ||
}; | ||
|
||
return action; | ||
} | ||
|
||
export function getAboutAsync(): | ||
ThunkAction<Promise<void>, {}, {}, AnyAction> { | ||
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => { | ||
dispatch(getAbout()); | ||
|
||
try { | ||
const about = await core.server.about(); | ||
dispatch( | ||
getAboutSuccess(about), | ||
); | ||
} catch (error) { | ||
dispatch(getAboutFailed(error)); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { AnyAction, Dispatch, ActionCreator } from 'redux'; | ||
bsekachev marked this conversation as resolved.
Show resolved
Hide resolved
LiSa20120 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import { ThunkAction } from 'redux-thunk'; | ||
|
||
import getCore from '../core'; | ||
|
||
const core = getCore(); | ||
|
||
export enum ServerInfoActionTypes { | ||
bsekachev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
GET_SERVER_INFO = 'GET_SERVER_INFO', | ||
GET_SERVER_INFO_SUCCESS = 'GET_SERVER_INFO_SUCCESS', | ||
GET_SERVER_INFO_FAILED = 'GET_SERVER_INFO_FAILED', | ||
} | ||
|
||
function getServerInfo(): AnyAction { | ||
const action = { | ||
type: ServerInfoActionTypes.GET_SERVER_INFO, | ||
payload: {}, | ||
}; | ||
|
||
return action; | ||
} | ||
|
||
function getServerInfoSuccess(serverInfo: string): AnyAction { | ||
const action = { | ||
type: ServerInfoActionTypes.GET_SERVER_INFO_SUCCESS, | ||
payload: { serverInfo }, | ||
}; | ||
|
||
return action; | ||
} | ||
|
||
function getServerInfoFailed(error: any): AnyAction { | ||
const action = { | ||
type: ServerInfoActionTypes.GET_SERVER_INFO_FAILED, | ||
payload: { error }, | ||
}; | ||
|
||
return action; | ||
} | ||
|
||
export function getServerInfoAsync(): | ||
ThunkAction<Promise<void>, {}, {}, AnyAction> { | ||
return async (dispatch: ActionCreator<Dispatch>): Promise<void> => { | ||
dispatch(getServerInfo()); | ||
|
||
try { | ||
const about = await core.server.about(); | ||
dispatch( | ||
getServerInfoSuccess(about), | ||
); | ||
} catch (error) { | ||
dispatch(getServerInfoFailed(error)); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,23 @@ import React from 'react'; | |
|
||
import { RouteComponentProps } from 'react-router'; | ||
import { withRouter } from 'react-router-dom'; | ||
import { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You do not need this import, right? |
||
BrowserRouter as Router, | ||
Link, | ||
Switch, | ||
Route, | ||
} from "react-router-dom"; | ||
LiSa20120 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
import { | ||
Layout, | ||
Icon, | ||
Button, | ||
Menu, | ||
Dropdown, | ||
Modal, | ||
Row, | ||
Col, | ||
} from 'antd'; | ||
|
||
import Text from 'antd/lib/typography/Text'; | ||
|
@@ -31,6 +41,7 @@ interface HeaderContainerProps { | |
installedTFAnnotation: boolean; | ||
installedTFSegmentation: boolean; | ||
username: string; | ||
about: any; | ||
} | ||
|
||
type Props = HeaderContainerProps & RouteComponentProps; | ||
|
@@ -42,6 +53,7 @@ function HeaderContainer(props: Props): JSX.Element { | |
installedTFAnnotation, | ||
installedAnalytics, | ||
username, | ||
about, | ||
onLogout, | ||
logoutFetching, | ||
} = props; | ||
|
@@ -50,13 +62,54 @@ function HeaderContainer(props: Props): JSX.Element { | |
|| installedTFAnnotation | ||
|| installedTFSegmentation; | ||
|
||
function aboutModal() { | ||
Modal.info({ | ||
title: `${about.name}`, | ||
content: ( | ||
<div> | ||
<p> | ||
{`${about.description}`} | ||
</p> | ||
<p> | ||
<Text strong> | ||
Server version: | ||
</Text> | ||
<Text type='secondary'> | ||
{` ${about.version}`} | ||
</Text> | ||
</p> | ||
<p> | ||
<Text strong> | ||
Client version: | ||
</Text> | ||
<Text type='secondary'> | ||
{` ${core.client.version}`} | ||
</Text> | ||
</p> | ||
<Row type='flex' justify='space-around'> | ||
<Col span={4}><a href= 'https://github.com/opencv/cvat/blob/develop/CHANGELOG.md' target='_blank' rel="noopener noreferrer" >What's new?</a></Col> | ||
<Col span={4}><a href='https://github.com/opencv/cvat/blob/develop/LICENSE' target='_blank' rel="noopener noreferrer" >License</a></Col> | ||
<Col span={4}><a href='https://gitter.im/opencv-cvat' target='_blank' rel="noopener noreferrer" >Need help?</a></Col> | ||
<Col span={4}><a href='https://software.intel.com/en-us/forums/intel-distribution-of-openvino-toolkit' target='_blank' rel="noopener noreferrer" >Forum on Intel Developer Zone</a></Col> | ||
LiSa20120 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</Row> | ||
</div> | ||
), | ||
width : 800, | ||
okButtonProps: { | ||
style: { | ||
width: '100px', | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
const menu = ( | ||
<Menu className='cvat-header-menu' mode='vertical'> | ||
<Menu.Item> | ||
<Icon type='setting' /> | ||
Settings | ||
</Menu.Item> | ||
<Menu.Item> | ||
<Menu.Item onClick={() => aboutModal()}> | ||
<Icon type='info-circle' /> | ||
About | ||
</Menu.Item> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The module was renamed in the latest patch.
So, it should be
It's a reason why UI doesn't work in your patch.