diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-26 21:33:26 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-26 21:33:26 +0200 |
| commit | be3b2bd56550b71a2ffb7eb1604c1b8c1d2dd4a2 (patch) | |
| tree | f8b77bcfd10187328b3fadc0de3e1eb6dfa08f8d /app/client/dashboard | |
| parent | 3d836c372d7eff1e2b507888f1ff652a30187c54 (diff) | |
refactor some task stuff
Diffstat (limited to 'app/client/dashboard')
| -rw-r--r-- | app/client/dashboard/dashboard.actions.js (renamed from app/client/dashboard/actions.js) | 0 | ||||
| -rw-r--r-- | app/client/dashboard/dashboard.component.js | 10 | ||||
| -rw-r--r-- | app/client/dashboard/dashboard.reducer.js | 21 | ||||
| -rw-r--r-- | app/client/dashboard/dashboardHeader.component.js | 5 | ||||
| -rw-r--r-- | app/client/dashboard/tasklist.component.js | 2 |
5 files changed, 29 insertions, 9 deletions
diff --git a/app/client/dashboard/actions.js b/app/client/dashboard/dashboard.actions.js index 01c0a96..01c0a96 100644 --- a/app/client/dashboard/actions.js +++ b/app/client/dashboard/dashboard.actions.js diff --git a/app/client/dashboard/dashboard.component.js b/app/client/dashboard/dashboard.component.js index 6db42ae..3d3d168 100644 --- a/app/client/dashboard/dashboard.component.js +++ b/app/client/dashboard/dashboard.component.js @@ -13,7 +13,7 @@ import TaskList from './tasklist.component' import FileList from './filelist.component' import Gallery from './gallery.component' -import * as liveActions from './actions' +import * as dashboardActions from './dashboard.actions' class Dashboard extends Component { constructor(props){ @@ -59,13 +59,13 @@ class Dashboard extends Component { } const mapStateToProps = state => ({ site: state.system.site, - images: state.system.images, - tasks: state.system.tasks, - files: state.system.files + images: state.dashboard.images, + files: state.dashboard.files, + tasks: state.task.tasks, }) const mapDispatchToProps = (dispatch, ownProps) => ({ - actions: bindActionCreators(liveActions, dispatch) + actions: bindActionCreators(dashboardActions, dispatch) }) export default connect(mapStateToProps, mapDispatchToProps)(Dashboard) diff --git a/app/client/dashboard/dashboard.reducer.js b/app/client/dashboard/dashboard.reducer.js index c5b3d4a..b3ee05e 100644 --- a/app/client/dashboard/dashboard.reducer.js +++ b/app/client/dashboard/dashboard.reducer.js @@ -4,6 +4,27 @@ let FileSaver = require('file-saver') const dashboardInitialState = { loading: false, error: null, + + images: [ + { + url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2125.png', + }, + { + url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2146%20(1).png', + }, + { + url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2149.png', + }, + { + url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2150.png', + }, + { + url: 'https://s3.amazonaws.com/i.asdf.us/bucky/data/4282/woodscaled_4_true_20180521_2146%20(1).png', + }, + ], + files: [ + { id: 2, module: 'samplernn', checkpoint: 'jwcglassbeat', dataset: 'jwcglassbeat', epoch: 18, duration: 30, batch_size: 5, filename: 'jwcglassbeat-ep18.mp3', size: 3 * 1024 * 1024, date: Date.now(), opt: "{}", } + ] } const dashboardReducer = (state = dashboardInitialState, action) => { diff --git a/app/client/dashboard/dashboardHeader.component.js b/app/client/dashboard/dashboardHeader.component.js index 492dfd8..2e53088 100644 --- a/app/client/dashboard/dashboardHeader.component.js +++ b/app/client/dashboard/dashboardHeader.component.js @@ -1,7 +1,6 @@ import { h, Component } from 'preact' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' -import * as liveActions from '../live/actions' import * as util from '../util' @@ -19,7 +18,7 @@ class DashboardHeader extends Component { return ( <div class='dashboardHeader heading'> <h3>{site.name}</h3> - Currently {util.gerund(currentTask.activity)} {currentTask.library} on {currentTask.dataset}<br/> + Currently {util.gerund(currentTask.activity)} {currentTask.module} on {currentTask.dataset}<br/> Epoch: {currentTask.epoch} / {currentTask.epochs}, ETA {eta}<br/> <br/> Want to play live? <button>Pause at the end of this epoch</button> @@ -29,7 +28,7 @@ class DashboardHeader extends Component { } const mapStateToProps = state => ({ - currentTask: state.system.currentTask, + currentTask: state.task.currentTask, site: state.system.site, }) diff --git a/app/client/dashboard/tasklist.component.js b/app/client/dashboard/tasklist.component.js index fa002de..e5b1171 100644 --- a/app/client/dashboard/tasklist.component.js +++ b/app/client/dashboard/tasklist.component.js @@ -20,7 +20,7 @@ class TaskList extends Component { } return ( <div class='row'> - <div class='activity'>{task.activity} {task.library} {dataset_type}</div> + <div class='activity'>{task.activity} {task.module} {dataset_type}</div> <div class='dataset'>{dataset_name}</div> <div class='epochs'>{task.epochs} ep.</div> <div class='eta'>{eta}</div> |
