blob: 58808a333341c9ef7793219c49e818409cc92a80 (
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
72
73
74
75
76
77
|
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 '../common'
import Gallery from '../common/gallery.component'
import * as dashboardActions from './dashboard.actions'
import modules from '../modules'
import actions from '../actions'
class Dashboard extends Component {
constructor(props){
super()
console.log(props)
props.actions.load()
}
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 { site, foldersByModule, queue, images } = this.props
const { tasks } = queue
const folders = foldersByModule && Object.keys(modules).sort().map(key => {
console.log(key)
console.log(foldersByModule[key])
return (
<div>
</div>
)
})
return (
<div className='app dashboard'>
<DashboardHeader />
<div className='params row'>
<div className='column'>
{!!queue.queue.length &&
<Group title='Upcoming Tasks'>
<TaskList tasks={queue.queue.map(id => tasks[id])} />
</Group>
}
{!!queue.completed.length &&
<Group title='Completed Tasks'>
<TaskList tasks={queue.completed.map(id => tasks[id])} />
</Group>
}
</div>
<div className='column'>
{folders}
</div>
</div>
</div>
)
}
}
const mapStateToProps = state => ({
site: state.system.site,
foldersByModule: state.dashboard.data.foldersByModule,
images: state.dashboard.images,
files: state.dashboard.files,
queue: state.queue,
})
const mapDispatchToProps = (dispatch, ownProps) => ({
actions: bindActionCreators(dashboardActions, dispatch)
})
export default connect(mapStateToProps, mapDispatchToProps)(Dashboard)
|