From d94c415168b20dd43848dd7c8c77c07d8d4528d4 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 16 Sep 2018 16:39:27 +0200 Subject: s00per k3wl 0bj3ct d357rUc7ur1nG --- app/client/common/buttonGrid.component.js | 73 +++++++++++++++++++----------- app/client/common/currentTask.component.js | 6 +-- 2 files changed, 49 insertions(+), 30 deletions(-) (limited to 'app/client/common') diff --git a/app/client/common/buttonGrid.component.js b/app/client/common/buttonGrid.component.js index 4b86d62..6c7c105 100644 --- a/app/client/common/buttonGrid.component.js +++ b/app/client/common/buttonGrid.component.js @@ -1,32 +1,51 @@ import { h, Component } from 'preact' -export default function ButtonGrid(props) { - const max = props.max || Infinity - return ( - - - - {props.x.map(x => ( - - ))} - - {props.y.map(y => ( +export default class ButtonGrid extends Component { + state = { + x: 0, y: 0, + } + + render() { + const { + x: _x, + y: _y, + } = this.state + const { + x: X, + y: Y, + max = Infinity, + onClick, + onHover, + } = this.props + return ( +
{" "}{x}
- - {props.x.map(x => ( - + + {X.map(x => ( + ))} - - ))} -
{y} - {x * y > max ? " " : - - } - {" "}{x}
- ) + + {Y.map(y => ( + + {y} + {X.map(x => ( + + {x * y > max ? " " : + + } + + ))} + + ))} + + ) + } } diff --git a/app/client/common/currentTask.component.js b/app/client/common/currentTask.component.js index a4d9750..3c71a88 100644 --- a/app/client/common/currentTask.component.js +++ b/app/client/common/currentTask.component.js @@ -22,10 +22,10 @@ function CurrentTask ({ cpu, gpu, processor }) { const { last_message, pid, task } = p const { activity, epoch, epochs, dataset, module } = task return ( -
+
#{pid}: {module} {activity} {dataset} - {epochs - ? {epoch} epoch{util.courtesy_s(epoch)} + {!!epochs + ? {epochs} epoch{util.courtesy_s(epochs)} : ""} {epoch ? (currently #{epoch}) -- cgit v1.2.3-70-g09d2