From d0b5aee1fbd50d58c418952cd649c6ed28260e23 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 23 Sep 2018 20:37:43 +0200 Subject: more tasklist stuff --- .../modules/pix2pixhd/views/sequence.editor.js | 27 +++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'app/client/modules/pix2pixhd/views/sequence.editor.js') diff --git a/app/client/modules/pix2pixhd/views/sequence.editor.js b/app/client/modules/pix2pixhd/views/sequence.editor.js index 06f3889..33ed629 100644 --- a/app/client/modules/pix2pixhd/views/sequence.editor.js +++ b/app/client/modules/pix2pixhd/views/sequence.editor.js @@ -2,11 +2,13 @@ import { h, Component } from 'preact' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import { Route, Link } from 'react-router-dom' +import moment from 'moment/min/moment.min' import util from '../../../util' import { FileViewer, Timeline, Param, Button, Group, TextInput } from '../../../common' +import * as pix2pixhdTasks from '../pix2pixhd.tasks' import actions from '../../../actions' const initialState = { @@ -65,7 +67,7 @@ class SequenceEditor extends Component { console.log(checkpoint) this.setState({ ...initialState, - title: checkpoint.name + '_v_' + Date.now() + title: checkpoint.name + '_' + moment().format("YYYYMMDD") }) } @@ -78,28 +80,31 @@ class SequenceEditor extends Component { } render() { - const { app, checkpoint } = this.props + const { app, remote, checkpoint, folder_id } = this.props const { cursor, selection, title } = this.state const path = "sequences/" + checkpoint.name return (
{selection ?
+ + {selection.end.i - selection.start.i}{' frames'} + + + {util.frameTimestamp(selection.end.i - selection.start.i)} + - - {selection.end.i - selection.start.i}{' frames'} - - - {util.frameTimestamp(selection.end.i - selection.start.i)} - this.setState({ title })} + onInput={title => this.setState({ title: title.replace(/ /g, '_').replace(/\/\./g, '') })} /> + onClick={() => remote.create_dataset_task({ title, sequence: checkpoint.name, selection, folder_id })} + > + Create +
:
Please select some frames
@@ -143,7 +148,7 @@ const mapStateToProps = state => ({ }) const mapDispatchToProps = (dispatch, ownProps) => ({ - actions: bindActionCreators({}, dispatch), + remote: bindActionCreators(pix2pixhdTasks, dispatch), }) export default connect(mapStateToProps, mapDispatchToProps)(SequenceEditor) -- cgit v1.2.3-70-g09d2