From 28eda92b20df45e5bcc0ce9d5cac7656ddc55dd9 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 11 Jan 2020 14:37:02 +0100 Subject: ui updates --- .../modules/biggan/views/biggan.encodingList.js | 53 ++++++++++++++++------ app/client/modules/biggan/views/biggan.live.js | 31 +++++++------ 2 files changed, 56 insertions(+), 28 deletions(-) (limited to 'app/client/modules/biggan') diff --git a/app/client/modules/biggan/views/biggan.encodingList.js b/app/client/modules/biggan/views/biggan.encodingList.js index 710752e..8ebf05b 100644 --- a/app/client/modules/biggan/views/biggan.encodingList.js +++ b/app/client/modules/biggan/views/biggan.encodingList.js @@ -3,7 +3,7 @@ import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import { - Loading, Group, Slider + Loading, Group, Slider, Button } from '../../../common/' import actions from '../../../actions' @@ -11,6 +11,10 @@ import * as bigganTasks from '../biggan.tasks' import * as bigganActions from '../biggan.actions' class BigGANEncodingList extends Component { + state = { + file_id: 0, + } + componentDidMount() { if (!this.props.biggan.encodings) { this.props.actions.biggan.load_encodings() @@ -18,31 +22,46 @@ class BigGANEncodingList extends Component { } render() { + const { file_id } = this.state + const { opt } = this.props const { encodings } = this.props.biggan if (!encodings) { return
Loading encodings...
} return (
+
+ {this.props.last_message} +
- + + + + @@ -55,9 +74,12 @@ class BigGANEncodingList extends Component { actions.live.send_command('setEncoding', JSON.stringify({ - id: file.id, - }))} + onClick={() => { + actions.live.send_command('setEncoding', JSON.stringify({ + id: file.id, + })) + this.setState({ file_id: file.id }) + }} /> ))}
@@ -71,6 +93,7 @@ class BigGANEncodingList extends Component { } const mapStateToProps = state => ({ + last_message: state.live.last_message, opt: state.live.opt, frame: state.live.frame, biggan: state.module.biggan, diff --git a/app/client/modules/biggan/views/biggan.live.js b/app/client/modules/biggan/views/biggan.live.js index 8d4a234..4410968 100644 --- a/app/client/modules/biggan/views/biggan.live.js +++ b/app/client/modules/biggan/views/biggan.live.js @@ -15,6 +15,7 @@ import * as bigganTasks from '../biggan.tasks' import * as bigganActions from '../biggan.actions' import BigGANCategoryList from './biggan.categoryList.js' import BigGANEncodingList from './biggan.encodingList.js' +import { frameTimestamp } from '../../../util' class BigGANLive extends Component { constructor(props) { @@ -32,7 +33,7 @@ class BigGANLive extends Component { this.props.actions.queue.stop_task('gpu') } render() { - const { biggan, actions } = this.props + const { biggan, actions, frame } = this.props // console.log(actions) // if (biggan.loading) { // return @@ -44,9 +45,18 @@ class BigGANLive extends Component {
- +
+ {frame.i ? +
+ Frame #{frame.i} + {frameTimestamp(frame.i)} +
+ :
Not playing
+ } +
+ + {this.renderRestartButton()} -

{this.props.last_message}

@@ -57,7 +67,7 @@ class BigGANLive extends Component { @@ -87,7 +97,7 @@ class BigGANLive extends Component {
@@ -163,14 +173,10 @@ class BigGANLive extends Component { // } return (
- + >{i18n.gpu.stop}
) } @@ -178,7 +184,6 @@ class BigGANLive extends Component { const mapStateToProps = state => ({ - last_message: state.live.last_message, fullscreen: state.live.fullscreen, opt: state.live.opt, frame: state.live.frame, -- cgit v1.2.3-70-g09d2