|
|
|
|
@ -5,9 +5,12 @@ import {
|
|
|
|
|
CombinedState,
|
|
|
|
|
} from 'reducers/interfaces';
|
|
|
|
|
|
|
|
|
|
import getCore from 'cvat-core';
|
|
|
|
|
import HeaderComponent from 'components/header/header';
|
|
|
|
|
import { logoutAsync } from 'actions/auth-actions';
|
|
|
|
|
|
|
|
|
|
const core = getCore();
|
|
|
|
|
|
|
|
|
|
interface StateToProps {
|
|
|
|
|
logoutFetching: boolean;
|
|
|
|
|
installedAnalytics: boolean;
|
|
|
|
|
@ -15,7 +18,13 @@ interface StateToProps {
|
|
|
|
|
installedTFSegmentation: boolean;
|
|
|
|
|
installedTFAnnotation: boolean;
|
|
|
|
|
username: string;
|
|
|
|
|
serverAbout: any;
|
|
|
|
|
toolName: string;
|
|
|
|
|
serverHost: string;
|
|
|
|
|
serverVersion: string;
|
|
|
|
|
serverDescription: string;
|
|
|
|
|
coreVersion: string;
|
|
|
|
|
canvasVersion: string;
|
|
|
|
|
uiVersion: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface DispatchToProps {
|
|
|
|
|
@ -23,18 +32,36 @@ interface DispatchToProps {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mapStateToProps(state: CombinedState): StateToProps {
|
|
|
|
|
const { auth } = state;
|
|
|
|
|
const { list } = state.plugins;
|
|
|
|
|
const { about } = state;
|
|
|
|
|
const {
|
|
|
|
|
auth: {
|
|
|
|
|
fetching: logoutFetching,
|
|
|
|
|
user: {
|
|
|
|
|
username,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
plugins: {
|
|
|
|
|
list,
|
|
|
|
|
},
|
|
|
|
|
about: {
|
|
|
|
|
server,
|
|
|
|
|
packageVersion,
|
|
|
|
|
},
|
|
|
|
|
} = state;
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
logoutFetching: state.auth.fetching,
|
|
|
|
|
logoutFetching,
|
|
|
|
|
installedAnalytics: list[SupportedPlugins.ANALYTICS],
|
|
|
|
|
installedAutoAnnotation: list[SupportedPlugins.AUTO_ANNOTATION],
|
|
|
|
|
installedTFSegmentation: list[SupportedPlugins.TF_SEGMENTATION],
|
|
|
|
|
installedTFAnnotation: list[SupportedPlugins.TF_ANNOTATION],
|
|
|
|
|
username: auth.user.username,
|
|
|
|
|
serverAbout: about.server,
|
|
|
|
|
username,
|
|
|
|
|
toolName: server.name as string,
|
|
|
|
|
serverHost: core.config.backendAPI.slice(0, -7),
|
|
|
|
|
serverDescription: server.description as string,
|
|
|
|
|
serverVersion: server.version as string,
|
|
|
|
|
coreVersion: packageVersion.core,
|
|
|
|
|
canvasVersion: packageVersion.canvas,
|
|
|
|
|
uiVersion: packageVersion.ui,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|