diff options
Diffstat (limited to 'public/bundle.js')
| -rw-r--r-- | public/bundle.js | 59 |
1 files changed, 40 insertions, 19 deletions
diff --git a/public/bundle.js b/public/bundle.js index 00767f0..0269cac 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -572,18 +572,7 @@ var FileList = function (_Component) { ' ', file.module || '' ), - _this2.props.options && _this2.props.options(file), - file.epochs && (0, _preact.h)( - 'div', - { className: 'epochs' }, - file.epochs, - ' ep.' - ), - file.eta && (0, _preact.h)( - 'div', - { className: 'eta' }, - file.eta - ) + _this2.props.options && _this2.props.options(file) ); }); return (0, _preact.h)( @@ -3383,6 +3372,14 @@ var _reactRedux = __webpack_require__(/*! react-redux */ "./node_modules/react-r var _api = __webpack_require__(/*! ../../api */ "./app/client/api/index.js"); +var _task = __webpack_require__(/*! ../../task/task.actions */ "./app/client/task/task.actions.js"); + +var taskActions = _interopRequireWildcard(_task); + +var _system = __webpack_require__(/*! ../../system/system.actions */ "./app/client/system/system.actions.js"); + +var systemActions = _interopRequireWildcard(_system); + var _group = __webpack_require__(/*! ../../common/group.component */ "./app/client/common/group.component.js"); var _group2 = _interopRequireDefault(_group); @@ -3413,6 +3410,8 @@ var _textInput2 = _interopRequireDefault(_textInput); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } @@ -3437,6 +3436,7 @@ var SampleRNNDatasets = function (_Component) { _this.handleName = _this.handleName.bind(_this); _this.handleUpload = _this.handleUpload.bind(_this); _this.handleURL = _this.handleURL.bind(_this); + _this.fetchURL = _this.fetchURL.bind(_this); _this.fileOptions = _this.fileOptions.bind(_this); props.actions.folder.index({ module: 'samplernn' }); props.actions.file.index({ module: 'samplernn' }); @@ -3499,17 +3499,35 @@ var SampleRNNDatasets = function (_Component) { }); } }, { + key: 'fetchURL', + value: function fetchURL(url) { + _api.actions.task.start_task({ + activity: 'cpu', + module: 'samplernn', + epochs: 1, + opt: { url: url } + }, { preempt: true, watch: true }); + } + }, { key: 'fileOptions', value: function fileOptions(file) { var _this2 = this; console.log(file); if (file.activity === 'url' && !file.dataset) { - return (0, _preact.h)( - 'div', - { className: 'gray' }, - 'fetching...' - ); + if (this.props.runner.cpu.status !== 'IDLE') { + return (0, _preact.h)( + 'div', + { className: 'gray' }, + 'fetching...' + ); + } else { + return (0, _preact.h)( + 'div', + { className: 'link', onClick: this.fetchURL }, + 'fetch' + ); + } } return (0, _preact.h)( 'div', @@ -3598,7 +3616,9 @@ var SampleRNNDatasets = function (_Component) { var mapStateToProps = function mapStateToProps(state) { return { - samplernn: state.module.samplernn + samplernn: state.module.samplernn, + runner: state.system.runner, + task: state.task }; }; @@ -3607,7 +3627,8 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { actions: { folder: (0, _redux.bindActionCreators)(_api.actions.folder, dispatch), file: (0, _redux.bindActionCreators)(_api.actions.file, dispatch), - task: (0, _redux.bindActionCreators)(_api.actions.task, dispatch) + task: (0, _redux.bindActionCreators)(taskActions, dispatch), + system: (0, _redux.bindActionCreators)(systemActions, dispatch) } }; }; |
