summaryrefslogtreecommitdiff
path: root/public/bundle.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-21 15:47:18 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-21 15:47:18 +0200
commit34573a4f34c862ee884d0a3fd5badb1d4af1d9c2 (patch)
treefcdaf6b6182b92a91447c6fbad733eea7acdda56 /public/bundle.js
parentceb342df85308e45729067d4b56aa5b2fbaabc49 (diff)
cmdz
Diffstat (limited to 'public/bundle.js')
-rw-r--r--public/bundle.js52
1 files changed, 24 insertions, 28 deletions
diff --git a/public/bundle.js b/public/bundle.js
index 0480a4e..b45f099 100644
--- a/public/bundle.js
+++ b/public/bundle.js
@@ -555,7 +555,7 @@ var app = (0, _preact.h)(
Object.defineProperty(exports, "__esModule", {
value: true
});
-exports.list_datasets = exports.list_checkpoints = exports.set_param = exports.get_params = undefined;
+exports.list_sequences = exports.list_checkpoints = exports.set_param = exports.get_params = undefined;
var _socket = __webpack_require__(/*! ../socket */ "./app/client/socket.js");
@@ -579,9 +579,9 @@ var list_checkpoints = exports.list_checkpoints = function list_checkpoints() {
return { type: 'LOADING_CHECKPOINTS' };
};
-var list_datasets = exports.list_datasets = function list_datasets() {
- socket.list_datasets();
- return { type: 'LOADING_DATASETS' };
+var list_sequences = exports.list_sequences = function list_sequences() {
+ socket.list_sequences();
+ return { type: 'LOADING_SEQUENCES' };
};
/***/ }),
@@ -605,7 +605,11 @@ var _preact = __webpack_require__(/*! preact */ "./node_modules/preact/dist/prea
var _reactRedux = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js");
function Player(props) {
- return (0, _preact.h)('div', { className: 'player' });
+ return (0, _preact.h)(
+ 'div',
+ { className: 'player' },
+ (0, _preact.h)('canvas', { width: '424', height: '256' })
+ );
}
var mapStateToProps = function mapStateToProps(state) {
@@ -682,7 +686,7 @@ var App = function (_Component) {
props.actions.get_params();
props.actions.list_checkpoints();
- props.actions.list_datasets();
+ props.actions.list_sequences();
return _this;
}
@@ -877,7 +881,7 @@ var liveInitialState = {
error: null,
opt: {},
checkpoints: [],
- datasets: []
+ sequences: []
};
var liveReducer = function liveReducer() {
@@ -907,9 +911,9 @@ var liveReducer = function liveReducer() {
checkpoints: action.checkpoints
});
- case 'LIST_DATASETS':
+ case 'LIST_SEQUENCES':
return _extends({}, state, {
- datasets: action.datasets
+ sequences: action.sequences
});
default:
@@ -936,14 +940,13 @@ Object.defineProperty(exports, "__esModule", {
});
exports.socket = undefined;
exports.list_checkpoints = list_checkpoints;
-exports.list_datasets = list_datasets;
+exports.list_sequences = list_sequences;
exports.get_params = get_params;
exports.set_param = set_param;
var _store = __webpack_require__(/*! ./store */ "./app/client/store.js");
var socket = io.connect('/client');
-var got_frame = false;
// SOCKET ACTIONS
@@ -969,10 +972,10 @@ socket.on('res', function (data) {
checkpoints: data.res
});
break;
- case 'list_datasets':
+ case 'list_sequences':
_store.store.dispatch({
- type: 'LIST_DATASETS',
- datasets: data.res
+ type: 'LIST_SEQUENCES',
+ sequences: data.res
});
break;
default:
@@ -982,35 +985,28 @@ socket.on('res', function (data) {
});
socket.on('frame', function (data) {
- got_frame = true;
var blob = new Blob([data.frame], { type: 'image/jpg' });
var url = URL.createObjectURL(blob);
var img = new Image();
img.onload = function () {
URL.revokeObjectURL(url);
- var player = document.querySelector('.player');
- player.innerHTML = '';
- player.appendChild(img);
+ var player = document.querySelector('.player canvas');
+ player.getContext('2d');
+ player.drawImage(img, 0, 0, player.width, player.height);
+ // player.innerHTML = ''
+ // player.appendChild(img)
};
img.src = url;
});
-setTimeout(function () {
- if (!got_frame) {
- // socket.emit('cmd', {
- // cmd: 'get_last_frame',
- // })
- }
-}, 500);
-
function list_checkpoints() {
socket.emit('cmd', {
cmd: 'list_checkpoints'
});
}
-function list_datasets() {
+function list_sequences() {
socket.emit('cmd', {
- cmd: 'list_datasets'
+ cmd: 'list_sequences'
});
}
function get_params() {