diff --git a/cvat-ui/.env b/cvat-ui/.env index 9f972cf2..acc9a2fe 100644 --- a/cvat-ui/.env +++ b/cvat-ui/.env @@ -1,8 +1,10 @@ REACT_APP_VERSION=${npm_package_version} + REACT_APP_API_PROTOCOL=http REACT_APP_API_HOST=localhost REACT_APP_API_PORT=7000 REACT_APP_API_HOST_URL=${REACT_APP_API_PROTOCOL}://${REACT_APP_API_HOST}:${REACT_APP_API_PORT} REACT_APP_API_FULL_URL=${REACT_APP_API_PROTOCOL}://${REACT_APP_API_HOST}:${REACT_APP_API_PORT}/api/v1 + REACT_APP_LOGIN=admin REACT_APP_PASSWORD=admin diff --git a/cvat-ui/src/components/dashboard/content/dashboard-content.scss b/cvat-ui/src/components/dashboard/content/dashboard-content.scss index 127eceff..128ba49a 100644 --- a/cvat-ui/src/components/dashboard/content/dashboard-content.scss +++ b/cvat-ui/src/components/dashboard/content/dashboard-content.scss @@ -1,23 +1,52 @@ -.dashboard-content-сard { - &__header { - - } +.dashboard-content { + width: 1024px; + min-height: calc(100vh - 64px - 64px); + margin: 0 auto; + + .dashboard-content-сard { + margin: 20px; + padding: 20px; + border: 1px solid #001529; + border-radius: 3px; + background: white; + + &__header { + text-align: center; + + h2 { + margin-bottom: 20px; + } + } - &__content { + &__content { - .card-cover { + .card-cover { - img { - max-width: 300px; + img { + max-width: 300px; + } } - } - .card-actions { + .card-actions { + display: flex; + flex-flow: column wrap; - } + button { + min-width: 200px; + margin-bottom: 1px; + } + } - .card-jobs { + .card-jobs { + } } } } + +.empty { + display: flex; + flex-direction: column; + justify-content: center; + height: calc(100vh - 64px - 64px); +} diff --git a/cvat-ui/src/components/dashboard/content/dashboard-content.tsx b/cvat-ui/src/components/dashboard/content/dashboard-content.tsx index 3260fca3..87afb81d 100644 --- a/cvat-ui/src/components/dashboard/content/dashboard-content.tsx +++ b/cvat-ui/src/components/dashboard/content/dashboard-content.tsx @@ -1,10 +1,12 @@ import React, { Component } from 'react'; -import { Layout, Empty, Button, Col, Row } from 'antd'; +import { Layout, Empty, Button, Modal, Col, Row } from 'antd'; +import Title from 'antd/lib/typography/Title'; import './dashboard-content.scss'; const { Content } = Layout; +const { confirm } = Modal; interface DashboardContentAction { id: number, @@ -25,26 +27,32 @@ class DashboardContent extends Component { this.apiUrl = process.env.REACT_APP_API_FULL_URL; this.actions = [ - // { - // id: 1, - // name: 'Dump annotation', - // trigger: () => {}, - // }, - // { - // id: 2, - // name: 'Upload annotation', - // trigger: () => {}, - // }, - // { - // id: 3, - // name: 'Update task', - // trigger: () => {}, - // }, + { + id: 1, + name: 'Dump annotation', + trigger: () => { + this.onDumpAnnotation(); + }, + }, + { + id: 2, + name: 'Upload annotation', + trigger: () => { + this.onUploadAnnotation(); + }, + }, + { + id: 3, + name: 'Update task', + trigger: (task: any) => { + this.onUpdateTask(task); + }, + }, { id: 4, name: 'Delete task', trigger: (task: any) => { - this.props.deleteTask(task); + this.onDeleteTask(task); }, }, ]; @@ -58,30 +66,63 @@ class DashboardContent extends Component { ); } + private onDumpAnnotation() { + console.log('Dump'); + } + + private onUploadAnnotation() { + console.log('Upload'); + } + + private onUpdateTask(task: any) { + console.log('Update'); + } + + private onDeleteTask(task: any) { + const props = this.props; + + confirm({ + title: 'Do you want to delete this task?', + okText: 'Yes', + okType: 'danger', + centered: true, + onOk() { + return props.deleteTask(task); + }, + cancelText: 'No', + onCancel() { + return; + }, + }); + } + private renderPlaceholder() { return ( - No tasks in this workspace yet... + No tasks found... } > - + ) } private renderTasks() { return( - + { this.props.tasks.map( (task: any) => (
-

{ `${task.name}: ${task.mode}` }

+ { `${task.name}: ${task.mode}` }
@@ -90,7 +131,7 @@ class DashboardContent extends Component { Task cover - + { this.actions.map( (action: DashboardContentAction) => ( @@ -105,7 +146,7 @@ class DashboardContent extends Component { - Jobs + Jobs { task.jobs.map( (job: any) => ( diff --git a/cvat-ui/src/components/dashboard/dashboard.scss b/cvat-ui/src/components/dashboard/dashboard.scss index e69de29b..07b1cd83 100644 --- a/cvat-ui/src/components/dashboard/dashboard.scss +++ b/cvat-ui/src/components/dashboard/dashboard.scss @@ -0,0 +1,3 @@ +.layout { + +} diff --git a/cvat-ui/src/components/dashboard/dashboard.tsx b/cvat-ui/src/components/dashboard/dashboard.tsx index 1d3e38c7..99a47edb 100644 --- a/cvat-ui/src/components/dashboard/dashboard.tsx +++ b/cvat-ui/src/components/dashboard/dashboard.tsx @@ -25,10 +25,20 @@ class Dashboard extends Component { render() { return ( - - - - + + + + + + + + + ); } diff --git a/cvat-ui/src/components/dashboard/footer/dashboard-footer.scss b/cvat-ui/src/components/dashboard/footer/dashboard-footer.scss index e69de29b..965e4781 100644 --- a/cvat-ui/src/components/dashboard/footer/dashboard-footer.scss +++ b/cvat-ui/src/components/dashboard/footer/dashboard-footer.scss @@ -0,0 +1,9 @@ +.dashboard-footer { + display: flex; + align-items: center; + justify-content: center; + min-width: 1024px; + padding: 0 50px; + height: 64px; + background: #001529; +} diff --git a/cvat-ui/src/components/dashboard/footer/dashboard-footer.tsx b/cvat-ui/src/components/dashboard/footer/dashboard-footer.tsx index 8d4c39c0..12ceaeda 100644 --- a/cvat-ui/src/components/dashboard/footer/dashboard-footer.tsx +++ b/cvat-ui/src/components/dashboard/footer/dashboard-footer.tsx @@ -1,22 +1,29 @@ -import React, { Component } from 'react'; +import React, { PureComponent } from 'react'; -import { Layout, Pagination } from 'antd'; +import { Layout, Pagination, Row, Col } from 'antd'; import './dashboard-footer.scss'; const { Footer } = Layout; -class DashboardFooter extends Component { - constructor(props: any) { - super(props); - - this.state = {}; - } - +class DashboardFooter extends PureComponent { render() { + const pagination = ( + + + + + ); + return( -