diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-16 15:16:13 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-16 15:16:13 +0200 |
| commit | f6c930431fff255935c8fd5dc22a95ef5db9fc34 (patch) | |
| tree | 3ef8b0d53de9921e8b0a4c4470501270b7eb5e4f /public/bundle.js | |
| parent | 3504248ae4db51380413c45699e4453efb314561 (diff) | |
dashboard stuff
Diffstat (limited to 'public/bundle.js')
| -rw-r--r-- | public/bundle.js | 102 |
1 files changed, 86 insertions, 16 deletions
diff --git a/public/bundle.js b/public/bundle.js index 0612d03..e424dfe 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -2911,11 +2911,16 @@ function Header(props) { return (0, _preact.h)( 'header', null, + playing && (0, _preact.h)( + 'span', + null, + fps, + ' fps' + ), (0, _preact.h)( - 'b', + 'span', null, - site.name, - ' cortex' + links ), (0, _preact.h)( 'span', @@ -2947,15 +2952,10 @@ function Header(props) { ) ), (0, _preact.h)( - 'span', - null, - links - ), - playing && (0, _preact.h)( - 'span', + 'b', null, - fps, - ' fps' + site.name, + ' cortex' ) ); } @@ -3911,13 +3911,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de var load = exports.load = function load() { return function (dispatch) { - _util2.default.allProgress([_actions2.default.task.index(), _actions2.default.folder.index()], function (percent, i, n) { + _util2.default.allProgress([_actions2.default.task.index({ limit: 40, orderBy: 'created_at desc' }), _actions2.default.folder.index(), _actions2.default.file.index({ module: 'samplernn', generated: 1, limit: 10, orderBy: 'created_at desc' })], function (percent, i, n) { console.log('dashboard load progress', i, n); dispatch({ type: _types2.default.app.load_progress, progress: { i: i, n: n } }); }).then(function (res) { - var _res = _slicedToArray(res, 2), + var _res = _slicedToArray(res, 3), tasks = _res[0], - folders = _res[1]; + folders = _res[1], + sampleRNNrenders = _res[2]; var _util$sort$orderByFn = _util2.default.sort.orderByFn('date desc'), mapFn = _util$sort$orderByFn.mapFn, @@ -3934,6 +3935,7 @@ var load = exports.load = function load() { data: { tasks: tasks, folders: folders, + sampleRNNrenders: sampleRNNrenders, foldersByModule: foldersByModule } }); @@ -3963,6 +3965,8 @@ var _preact = __webpack_require__(/*! preact */ "./node_modules/preact/dist/prea var _redux = __webpack_require__(/*! redux */ "./node_modules/redux/es/redux.js"); +var _reactRouterDom = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/es/index.js"); + var _reactRedux = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js"); var _player = __webpack_require__(/*! ../common/player.component */ "./app/client/common/player.component.js"); @@ -4003,6 +4007,10 @@ var _dashboard = __webpack_require__(/*! ./dashboard.actions */ "./app/client/da var dashboardActions = _interopRequireWildcard(_dashboard); +var _audioPlayer = __webpack_require__(/*! ../common/audioPlayer/audioPlayer.actions */ "./app/client/common/audioPlayer/audioPlayer.actions.js"); + +var audioPlayerActions = _interopRequireWildcard(_audioPlayer); + var _modules = __webpack_require__(/*! ../modules */ "./app/client/modules/index.js"); var _modules2 = _interopRequireDefault(_modules); @@ -4043,9 +4051,12 @@ var Dashboard = function (_Component) { }, { key: 'render', value: function render() { + var _this2 = this; + var _props = this.props, site = _props.site, foldersByModule = _props.foldersByModule, + sampleRNNrenders = _props.sampleRNNrenders, queue = _props.queue, images = _props.images; var tasks = queue.tasks; @@ -4053,8 +4064,59 @@ var Dashboard = function (_Component) { var folders = foldersByModule && Object.keys(_modules2.default).sort().map(function (key) { console.log(key); console.log(foldersByModule[key]); - return (0, _preact.h)('div', null); + if (!foldersByModule[key]) return null; + var path = key === 'samplernn' ? '/samplernn/datasets/' : '/' + key + '/sequences/'; + var folders = foldersByModule[key].map(function (folder) { + return (0, _preact.h)( + 'div', + { key: folder.id }, + (0, _preact.h)( + _reactRouterDom.Link, + { to: path + folder.id + '/' }, + folder.name + ) + ); + }); + var files = key === 'samplernn' && (0, _preact.h)(_common.FileList, { + files: sampleRNNrenders, + orderBy: 'date desc', + fields: 'name date epoch size', + onClick: function onClick(file, e) { + e.preventDefault(); + e.stopPropagation(); + console.log('picked a file', file); + _this2.handlePick(file); + } + }); + + return (0, _preact.h)( + 'div', + { className: 'dashboardModule', key: key }, + (0, _preact.h)( + 'div', + { className: 'row moduleHeading' }, + (0, _preact.h)( + 'h3', + null, + key + ), + (0, _preact.h)( + 'div', + null, + (0, _preact.h)( + _reactRouterDom.Link, + { to: '/' + key + '/new/' }, + 'new' + ) + ), + folders + ), + files + ); + }).filter(function (a) { + return !!a; }); + console.log(sampleRNNrenders); return (0, _preact.h)( 'div', { className: 'app dashboard' }, @@ -4088,6 +4150,11 @@ var Dashboard = function (_Component) { ) ); } + }, { + key: 'handlePick', + value: function handlePick(file) { + this.props.audioPlayer.play(file); + } }]); return Dashboard; @@ -4097,6 +4164,7 @@ var mapStateToProps = function mapStateToProps(state) { return { site: state.system.site, foldersByModule: state.dashboard.data.foldersByModule, + sampleRNNrenders: state.dashboard.data.sampleRNNrenders, images: state.dashboard.images, files: state.dashboard.files, queue: state.queue @@ -4105,7 +4173,8 @@ var mapStateToProps = function mapStateToProps(state) { var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { return { - actions: (0, _redux.bindActionCreators)(dashboardActions, dispatch) + actions: (0, _redux.bindActionCreators)(dashboardActions, dispatch), + audioPlayer: (0, _redux.bindActionCreators)(audioPlayerActions, dispatch) }; }; @@ -12532,6 +12601,7 @@ var systemReducer = function systemReducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : systemInitialState; var action = arguments[1]; + console.log(action.type); var processor = null; switch (action.type) { case _types2.default.socket.connect: |
