blob: 3d3d168d5f837fb8e95dc80f0ef140fe77e36659 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
import { h, Component } from 'preact'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import Player from '../common/player.component'
import Group from '../common/group.component'
import Slider from '../common/slider.component'
import Select from '../common/select.component'
import Button from '../common/button.component'
import DashboardHeader from './dashboardheader.component'
import TaskList from './tasklist.component'
import FileList from './filelist.component'
import Gallery from './gallery.component'
import * as dashboardActions from './dashboard.actions'
class Dashboard extends Component {
constructor(props){
super()
}
componentWillUpdate(nextProps) {
// if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) {
// this.props.actions.list_epochs(nextProps.opt.checkpoint_name)
// }
}
render(){
const { tasks, files, images, site } = this.props
return (
<div className='dashboard'>
<DashboardHeader />
<div className='params'>
<div className='column'>
<Group title='Completed Tasks'>
<TaskList tasks={tasks} />
</Group>
<Group title='Upcoming Tasks'>
<TaskList tasks={tasks} />
</Group>
</div>
<div className='column'>
<Group title='Your Datasets'>
<FileList files={files} />
</Group>
<Group title='Results'>
<FileList files={files} />
</Group>
<Group title='Audio Player'>
<FileList files={files} />
</Group>
</div>
</div>
<div>
<Gallery images={images} />
</div>
</div>
)
}
}
const mapStateToProps = state => ({
site: state.system.site,
images: state.dashboard.images,
files: state.dashboard.files,
tasks: state.task.tasks,
})
const mapDispatchToProps = (dispatch, ownProps) => ({
actions: bindActionCreators(dashboardActions, dispatch)
})
export default connect(mapStateToProps, mapDispatchToProps)(Dashboard)
|