summaryrefslogtreecommitdiff
path: root/public/bundle.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/bundle.js')
-rw-r--r--public/bundle.js866
1 files changed, 543 insertions, 323 deletions
diff --git a/public/bundle.js b/public/bundle.js
index a8d3c16..0ad4bf3 100644
--- a/public/bundle.js
+++ b/public/bundle.js
@@ -810,7 +810,7 @@ function randint(n) {
return Math.floor(Math.random() * n);
}
-document.body.style.background = 'linear-gradient(' + (randint(40) + 40) + 'deg, #fde, #ffe)';
+document.body.style.backgroundImage = 'linear-gradient(' + (randint(40) + 40) + 'deg, #fde, #ffe)';
/***/ }),
@@ -2388,6 +2388,415 @@ exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(
/***/ }),
+/***/ "./app/client/dataset/dataset.component.js":
+/*!*************************************************!*\
+ !*** ./app/client/dataset/dataset.component.js ***!
+ \*************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _preact = __webpack_require__(/*! preact */ "./node_modules/preact/dist/preact.esm.js");
+
+var _redux = __webpack_require__(/*! redux */ "./node_modules/redux/es/redux.js");
+
+var _reactRedux = __webpack_require__(/*! react-redux */ "./node_modules/react-redux/es/index.js");
+
+var _api = __webpack_require__(/*! ../api */ "./app/client/api/index.js");
+
+var _group = __webpack_require__(/*! ../common/group.component */ "./app/client/common/group.component.js");
+
+var _group2 = _interopRequireDefault(_group);
+
+var _param = __webpack_require__(/*! ../common/param.component */ "./app/client/common/param.component.js");
+
+var _param2 = _interopRequireDefault(_param);
+
+var _fileList = __webpack_require__(/*! ../common/fileList.component */ "./app/client/common/fileList.component.js");
+
+var _fileList2 = _interopRequireDefault(_fileList);
+
+var _fileUpload = __webpack_require__(/*! ../common/fileUpload.component */ "./app/client/common/fileUpload.component.js");
+
+var _fileUpload2 = _interopRequireDefault(_fileUpload);
+
+var _textInput = __webpack_require__(/*! ../common/textInput.component */ "./app/client/common/textInput.component.js");
+
+var _textInput2 = _interopRequireDefault(_textInput);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+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; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+var Dataset = function (_Component) {
+ _inherits(Dataset, _Component);
+
+ function Dataset(props) {
+ _classCallCheck(this, Dataset);
+
+ var _this = _possibleConstructorReturn(this, (Dataset.__proto__ || Object.getPrototypeOf(Dataset)).call(this));
+
+ _this.handleName = _this.handleName.bind(_this);
+ _this.handleUpload = _this.handleUpload.bind(_this);
+ _this.handleURL = _this.handleURL.bind(_this);
+ _this.pickFile = _this.pickFile.bind(_this);
+ return _this;
+ }
+
+ _createClass(Dataset, [{
+ key: 'handleName',
+ value: function handleName(name) {
+ var _props = this.props,
+ module = _props.module,
+ folder = _props.folder;
+
+ if (!folder.id) {
+ this.props.actions.folder.create({
+ // username... should get added inside the API
+ module: module.name,
+ datatype: module.datatype,
+ activity: 'dataset',
+ name: name
+ });
+ } else {
+ this.props.actions.folder.update({
+ id: folder.id,
+ module: module.name,
+ datatype: module.datatype,
+ activity: 'dataset',
+ name: name
+ });
+ }
+ }
+ }, {
+ key: 'handleUpload',
+ value: function handleUpload(file) {
+ var _props2 = this.props,
+ module = _props2.module,
+ folder = _props2.folder;
+
+ var fd = new FormData();
+ fd.append('file', file);
+ this.props.actions.folder.upload(fd, {
+ id: folder.id,
+ module: module.name,
+ activity: 'file',
+ epoch: 0,
+ processed: false,
+ generated: false
+ });
+ }
+ }, {
+ key: 'handleURL',
+ value: function handleURL(url) {
+ var _this2 = this;
+
+ // name url
+ // mime datatype
+ // duration analysis
+ // size activity
+ // opt created_at updated_at
+ _api.parser.parse(url, function (media) {
+ if (!media) return;
+ console.log('media', media);
+ _this2.props.actions.file.create({
+ folder_id: _this2.props.folder.id,
+ module: _this2.props.module.name,
+ activity: 'url',
+ duration: parseInt(media.duration) || 0,
+ epoch: 0,
+ processed: false,
+ generated: false,
+ opt: media,
+ url: url
+ });
+ });
+ }
+ }, {
+ key: 'pickFile',
+ value: function pickFile(file) {
+ console.log('pick', file);
+ this.props.onPick && this.props.onPick(file);
+ }
+ }, {
+ key: 'render',
+ value: function render() {
+ var _props3 = this.props,
+ loading = _props3.loading,
+ status = _props3.status,
+ error = _props3.error,
+ module = _props3.module,
+ title = _props3.title,
+ folder = _props3.folder,
+ files = _props3.files,
+ canRename = _props3.canRename,
+ canUpload = _props3.canUpload,
+ canAddURL = _props3.canAddURL,
+ canDeleteFile = _props3.canDeleteFile,
+ linkFiles = _props3.linkFiles,
+ fileOptions = _props3.fileOptions,
+ pickFile = _props3.pickFile;
+ // sort files??
+
+ return (0, _preact.h)(
+ 'div',
+ { className: 'dataset' },
+ (0, _preact.h)(
+ 'div',
+ { className: 'params row' },
+ (0, _preact.h)(
+ 'div',
+ { className: 'column' },
+ (0, _preact.h)(
+ _group2.default,
+ { title: title || 'Dataset' },
+ canRename ? this.renderFolderNameInput(folder.name) : (0, _preact.h)(
+ _param2.default,
+ { title: 'Dataset name' },
+ folder.name
+ ),
+ folder.id && canUpload && this.renderUploadInput(),
+ folder.id && canAddURL && this.renderURLInput()
+ )
+ )
+ ),
+ (0, _preact.h)(
+ 'div',
+ { className: 'params col' },
+ (0, _preact.h)(
+ 'div',
+ { 'class': 'row heading' },
+ files.length ? (0, _preact.h)(
+ 'h3',
+ null,
+ 'Files'
+ ) : (0, _preact.h)(
+ 'h4',
+ null,
+ 'No files'
+ ),
+ (0, _preact.h)(
+ 'div',
+ null,
+ (loading || error) && status
+ )
+ ),
+ (0, _preact.h)(_fileList2.default, {
+ files: files,
+ options: fileOptions,
+ onClick: pickFile,
+ canDelete: canDeleteFile,
+ linkFiles: linkFiles
+ })
+ )
+ );
+ }
+ }, {
+ key: 'renderFolderNameInput',
+ value: function renderFolderNameInput(name) {
+ return (0, _preact.h)(_textInput2.default, {
+ title: 'Dataset name',
+ value: name,
+ onSave: this.handleName
+ });
+ }
+ }, {
+ key: 'renderUploadInput',
+ value: function renderUploadInput() {
+ return (0, _preact.h)(_fileUpload2.default, {
+ title: 'Upload a file',
+ mime: 'image.*',
+ onUpload: this.handleUpload
+ });
+ }
+ }, {
+ key: 'renderURLInput',
+ value: function renderURLInput() {
+ return (0, _preact.h)(_textInput2.default, {
+ title: 'Fetch a URL',
+ placeholder: 'http://',
+ onSave: this.handleURL
+ });
+ }
+ }]);
+
+ return Dataset;
+}(_preact.Component);
+
+var mapStateToProps = function mapStateToProps(state) {
+ return state.dataset;
+};
+
+var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) {
+ return {
+ actions: {
+ folder: (0, _redux.bindActionCreators)(_api.actions.folder, dispatch),
+ file: (0, _redux.bindActionCreators)(_api.actions.file, dispatch)
+ }
+ };
+};
+
+exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Dataset);
+
+/***/ }),
+
+/***/ "./app/client/dataset/dataset.reducer.js":
+/*!***********************************************!*\
+ !*** ./app/client/dataset/dataset.reducer.js ***!
+ \***********************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+var _types = __webpack_require__(/*! ../types */ "./app/client/types.js");
+
+var _types2 = _interopRequireDefault(_types);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var datasetInitialState = {
+ loading: false,
+ error: null,
+ status: ''
+};
+
+var datasetReducer = function datasetReducer() {
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : datasetInitialState;
+ var action = arguments[1];
+
+ console.log(action);
+ switch (action.type) {
+ case _types2.default.socket.connect:
+ return _extends({}, state);
+ case _types2.default.task.task_begin:
+ return _extends({}, state);
+ case _types2.default.task.task_finish:
+ return _extends({}, state);
+
+ case _types2.default.folder.index:
+ return _extends({}, state, {
+ folders: action.data,
+ folder: action.data[0]
+ });
+ case _types2.default.folder.update:
+ return state;
+ case _types2.default.file.index:
+ return _extends({}, state, {
+ files: action.data
+ });
+
+ case _types2.default.folder.upload_loading:
+ return _extends({}, state, {
+ upload: {
+ loading: true,
+ status: 'Loading...'
+ }
+ });
+ case _types2.default.folder.upload_error:
+ return _extends({}, state, {
+ upload: {
+ loading: false,
+ status: 'Error uploading :('
+ }
+ });
+ case _types2.default.folder.upload_progress:
+ console.log(action);
+ return _extends({}, state, {
+ upload: {
+ loading: true,
+ status: 'Upload progress ' + action.percent + '%'
+ }
+ });
+ case _types2.default.folder.upload_waiting:
+ console.log(action);
+ return _extends({}, state, {
+ upload: {
+ loading: true,
+ status: 'Waiting for server to finish processing...'
+ }
+ });
+ case _types2.default.file.create_loading:
+ return _extends({}, state, {
+ upload: {
+ loading: true,
+ status: 'Creating file...'
+ }
+ });
+ case _types2.default.file.create:
+ console.log('booo');
+ if (state.folder.id === action.data.folder_id) {
+ return _extends({}, state, {
+ files: [action.data].concat(state.files),
+ upload: {
+ loading: false,
+ status: 'File created'
+ }
+ });
+ } else {
+ return _extends({}, state, {
+ upload: {
+ loading: false,
+ status: 'created'
+ }
+ });
+ }
+ case _types2.default.folder.upload_complete:
+ console.log(action);
+ if (state.folder.id === action.folder) {
+ return _extends({}, state, {
+ files: [action.files].concat(state.files),
+ upload: {
+ loading: false,
+ status: 'Upload complete'
+ }
+ });
+ } else {
+ return _extends({}, state, {
+ upload: {
+ loading: false,
+ status: 'Upload complete'
+ }
+ });
+ }
+ case _types2.default.socket.status:
+ return datasetSocket(state, action.data);
+ default:
+ return state;
+ }
+};
+
+var datasetSocket = function datasetSocket(state, action) {
+ console.log(action);
+ switch (action.key) {
+ default:
+ return state;
+ }
+};
+
+exports.default = datasetReducer;
+
+/***/ }),
+
/***/ "./app/client/index.jsx":
/*!******************************!*\
!*** ./app/client/index.jsx ***!
@@ -3833,9 +4242,73 @@ exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(
/***/ }),
-/***/ "./app/client/modules/samplernn/datasets.component.js":
+/***/ "./app/client/modules/samplernn/index.js":
+/*!***********************************************!*\
+ !*** ./app/client/modules/samplernn/index.js ***!
+ \***********************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _preact = __webpack_require__(/*! preact */ "./node_modules/preact/dist/preact.esm.js");
+
+var _reactRouterDom = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/es/index.js");
+
+var _samplernn = __webpack_require__(/*! ./samplernn.datasets */ "./app/client/modules/samplernn/samplernn.datasets.js");
+
+var _samplernn2 = _interopRequireDefault(_samplernn);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function router() {
+ return (0, _preact.h)(
+ 'div',
+ null,
+ (0, _preact.h)(_reactRouterDom.Route, { path: '/samplernn/datasets/', component: _samplernn2.default })
+ );
+}
+
+function links() {
+ return (0, _preact.h)(
+ 'span',
+ null,
+ (0, _preact.h)(
+ 'span',
+ null,
+ (0, _preact.h)(
+ _reactRouterDom.Link,
+ { to: '/samplernn/datasets/' },
+ 'datasets'
+ )
+ ),
+ (0, _preact.h)(
+ 'span',
+ null,
+ (0, _preact.h)(
+ _reactRouterDom.Link,
+ { to: '/samplernn/results/' },
+ 'results'
+ )
+ )
+ );
+}
+
+exports.default = {
+ name: 'samplernn',
+ router: router, links: links
+};
+
+/***/ }),
+
+/***/ "./app/client/modules/samplernn/samplernn.datasets.js":
/*!************************************************************!*\
- !*** ./app/client/modules/samplernn/datasets.component.js ***!
+ !*** ./app/client/modules/samplernn/samplernn.datasets.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
@@ -3865,6 +4338,10 @@ var _system = __webpack_require__(/*! ../../system/system.actions */ "./app/clie
var systemActions = _interopRequireWildcard(_system);
+var _dataset = __webpack_require__(/*! ../../dataset/dataset.component */ "./app/client/dataset/dataset.component.js");
+
+var _dataset2 = _interopRequireDefault(_dataset);
+
var _group = __webpack_require__(/*! ../../common/group.component */ "./app/client/common/group.component.js");
var _group2 = _interopRequireDefault(_group);
@@ -3885,10 +4362,6 @@ var _fileList = __webpack_require__(/*! ../../common/fileList.component */ "./ap
var _fileList2 = _interopRequireDefault(_fileList);
-var _fileUpload = __webpack_require__(/*! ../../common/fileUpload.component */ "./app/client/common/fileUpload.component.js");
-
-var _fileUpload2 = _interopRequireDefault(_fileUpload);
-
var _textInput = __webpack_require__(/*! ../../common/textInput.component */ "./app/client/common/textInput.component.js");
var _textInput2 = _interopRequireDefault(_textInput);
@@ -3902,12 +4375,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
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; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-// folderActions.index({ module: 'samplernn' })
-// folderActions.show(12)
-// folderActions.create({ module: 'samplernn', name: 'foo' })
-// folderActions.update(12, { module: 'pix2pix' })
-// folderActions.destroy(12, { confirm: true })
-// folderActions.upload(12, form_data)
var SampleRNNDatasets = function (_Component) {
_inherits(SampleRNNDatasets, _Component);
@@ -3918,10 +4385,6 @@ var SampleRNNDatasets = function (_Component) {
// fetch file list
var _this = _possibleConstructorReturn(this, (SampleRNNDatasets.__proto__ || Object.getPrototypeOf(SampleRNNDatasets)).call(this));
- _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);
_this.pickFile = _this.pickFile.bind(_this);
props.actions.folder.index({ module: 'samplernn' });
@@ -3930,81 +4393,6 @@ var SampleRNNDatasets = function (_Component) {
}
_createClass(SampleRNNDatasets, [{
- key: 'handleName',
- value: function handleName(name) {
- var folder = this.props.samplernn.folder;
- if (!folder.id) {
- this.props.actions.folder.create({
- // username... should get added inside the API
- module: 'samplernn',
- activity: 'dataset',
- datatype: 'audio',
- name: name
- });
- } else {
- this.props.actions.folder.update({
- id: folder.id,
- module: 'samplernn',
- activity: 'dataset',
- datatype: 'audio',
- name: name
- });
- }
- }
- }, {
- key: 'handleUpload',
- value: function handleUpload(file) {
- var folder = this.props.samplernn.folder;
- var fd = new FormData();
- fd.append('file', file);
- this.props.actions.folder.upload(fd, {
- id: folder.id,
- module: 'samplernn',
- activity: 'url',
- epoch: 0,
- processed: false,
- generated: false
- });
- }
- }, {
- key: 'handleURL',
- value: function handleURL(url) {
- var _this2 = this;
-
- // name url
- // mime datatype
- // duration analysis
- // size activity
- // opt created_at updated_at
- _api.parser.parse(url, function (media) {
- if (!media) return;
- console.log('media', media);
- var folder = _this2.props.samplernn.folder;
- _this2.props.actions.file.create({
- folder_id: folder.id,
- module: 'samplernn',
- activity: 'url',
- epoch: 0,
- processed: false,
- generated: false,
- opt: media,
- url: url
- });
- });
- }
- }, {
- key: 'fetchURL',
- value: function fetchURL(url) {
- console.log(url);
- this.props.actions.task.start_task({
- activity: 'fetch',
- module: 'samplernn',
- dataset: 'test',
- epochs: 1,
- opt: { url: url }
- }, { preempt: true, watch: true });
- }
- }, {
key: 'pickFile',
value: function pickFile(file) {
console.log('pick', file);
@@ -4012,7 +4400,7 @@ var SampleRNNDatasets = function (_Component) {
}, {
key: 'fileOptions',
value: function fileOptions(file) {
- var _this3 = this;
+ var _this2 = this;
console.log(file);
if (file.activity === 'url' && !file.dataset) {
@@ -4026,7 +4414,7 @@ var SampleRNNDatasets = function (_Component) {
return (0, _preact.h)(
'div',
{ className: 'link', onClick: function onClick() {
- return _this3.fetchURL(file.url);
+ return _this2.fetchURL(file.url);
} },
'fetch'
);
@@ -4038,7 +4426,7 @@ var SampleRNNDatasets = function (_Component) {
(0, _preact.h)(
'div',
{ className: 'link', onClick: function onClick() {
- return _this3.train(file);
+ return _this2.train(file);
} },
'train'
),
@@ -4051,12 +4439,28 @@ var SampleRNNDatasets = function (_Component) {
);
}
}, {
+ key: 'fetchURL',
+ value: function fetchURL(url) {
+ console.log(url);
+ this.props.actions.task.start_task({
+ activity: 'fetch',
+ module: 'samplernn',
+ dataset: 'test',
+ epochs: 1,
+ opt: { url: url }
+ }, { preempt: true, watch: true });
+ }
+ }, {
key: 'render',
value: function render() {
var samplernn = this.props.samplernn;
console.log(samplernn.upload);
// sort files??
+ var module = {
+ name: 'samplernn',
+ datatype: 'audio'
+ };
return (0, _preact.h)(
'div',
{ className: 'app' },
@@ -4069,62 +4473,18 @@ var SampleRNNDatasets = function (_Component) {
'SampleRNN'
)
),
- (0, _preact.h)(
- 'div',
- { className: 'params row' },
- (0, _preact.h)(
- 'div',
- { className: 'column' },
- (0, _preact.h)(
- _group2.default,
- { title: 'Dataset' },
- (0, _preact.h)(_textInput2.default, {
- title: 'Dataset name',
- value: samplernn.folder.name,
- onSave: this.handleName
- }),
- samplernn.folder.id && (0, _preact.h)(_fileUpload2.default, {
- title: 'Upload a file',
- mime: 'image.*',
- onUpload: this.handleUpload
- }),
- samplernn.folder.id && (0, _preact.h)(_textInput2.default, {
- title: 'Fetch a URL',
- placeholder: 'http://',
- onSave: this.handleURL
- })
- )
- )
- ),
- (0, _preact.h)(
- 'div',
- { className: 'params col' },
- (0, _preact.h)(
- 'div',
- { 'class': 'row heading' },
- samplernn.files.length ? (0, _preact.h)(
- 'h3',
- null,
- 'Files'
- ) : (0, _preact.h)(
- 'h4',
- null,
- 'No files'
- ),
- (0, _preact.h)(
- 'div',
- null,
- samplernn.upload.loading && samplernn.upload.status
- )
- ),
- (0, _preact.h)(_fileList2.default, {
- files: samplernn.files,
- options: this.fileOptions,
- onClick: this.pickFile,
- showDelete: true,
- linkFiles: true
- })
- )
+ (0, _preact.h)(_dataset2.default, {
+ canRename: true,
+ canUpload: true,
+ canAddURL: true,
+ canDeleteFile: true,
+ linkFiles: true,
+ fileOptions: this.fileOptions,
+ onPick: this.handlePick,
+ module: module,
+ folder: samplernn.input.folder,
+ files: samplernn.input.files
+ })
);
}
}]);
@@ -4155,70 +4515,6 @@ exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(
/***/ }),
-/***/ "./app/client/modules/samplernn/index.js":
-/*!***********************************************!*\
- !*** ./app/client/modules/samplernn/index.js ***!
- \***********************************************/
-/*! no static exports found */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _preact = __webpack_require__(/*! preact */ "./node_modules/preact/dist/preact.esm.js");
-
-var _reactRouterDom = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/es/index.js");
-
-var _datasets = __webpack_require__(/*! ./datasets.component */ "./app/client/modules/samplernn/datasets.component.js");
-
-var _datasets2 = _interopRequireDefault(_datasets);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-function router() {
- return (0, _preact.h)(
- 'div',
- null,
- (0, _preact.h)(_reactRouterDom.Route, { path: '/samplernn/datasets/', component: _datasets2.default })
- );
-}
-
-function links() {
- return (0, _preact.h)(
- 'span',
- null,
- (0, _preact.h)(
- 'span',
- null,
- (0, _preact.h)(
- _reactRouterDom.Link,
- { to: '/samplernn/datasets/' },
- 'datasets'
- )
- ),
- (0, _preact.h)(
- 'span',
- null,
- (0, _preact.h)(
- _reactRouterDom.Link,
- { to: '/samplernn/results/' },
- 'results'
- )
- )
- );
-}
-
-exports.default = {
- name: 'samplernn',
- router: router, links: links
-};
-
-/***/ }),
-
/***/ "./app/client/modules/samplernn/samplernn.reducer.js":
/*!***********************************************************!*\
!*** ./app/client/modules/samplernn/samplernn.reducer.js ***!
@@ -4244,13 +4540,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
var samplernnInitialState = {
loading: false,
error: null,
- folder: {},
folders: [],
- files: [],
+ datasets: [],
results: [],
- upload: {
- loading: false,
- status: ''
+ input: {
+ folder: {},
+ files: []
+ },
+ output: {
+ folder: {},
+ files: []
}
};
@@ -4260,98 +4559,11 @@ var samplernnReducer = function samplernnReducer() {
console.log(action);
switch (action.type) {
- case _types2.default.socket.connect:
- return _extends({}, state);
case _types2.default.task.task_begin:
return _extends({}, state);
case _types2.default.task.task_finish:
return _extends({}, state);
- case _types2.default.folder.index:
- return _extends({}, state, {
- folders: action.data,
- folder: action.data[0]
- });
- case _types2.default.folder.update:
- return state;
- case _types2.default.file.index:
- return _extends({}, state, {
- files: action.data
- });
-
- case _types2.default.folder.upload_loading:
- return _extends({}, state, {
- upload: {
- loading: true,
- status: 'Loading...'
- }
- });
- case _types2.default.folder.upload_error:
- return _extends({}, state, {
- upload: {
- loading: false,
- status: 'Error uploading :('
- }
- });
- case _types2.default.folder.upload_progress:
- console.log(action);
- return _extends({}, state, {
- upload: {
- loading: true,
- status: 'Upload progress ' + action.percent + '%'
- }
- });
- case _types2.default.folder.upload_waiting:
- console.log(action);
- return _extends({}, state, {
- upload: {
- loading: true,
- status: 'Waiting for server to finish processing...'
- }
- });
- case _types2.default.file.create_loading:
- return _extends({}, state, {
- upload: {
- loading: true,
- status: 'Creating file...'
- }
- });
- case _types2.default.file.create:
- console.log('booo');
- if (state.folder.id === action.data.folder_id) {
- return _extends({}, state, {
- files: [action.data].concat(state.files),
- upload: {
- loading: false,
- status: 'File created'
- }
- });
- } else {
- return _extends({}, state, {
- upload: {
- loading: false,
- status: 'created'
- }
- });
- }
- case _types2.default.folder.upload_complete:
- console.log(action);
- if (state.folder.id === action.folder) {
- return _extends({}, state, {
- files: [action.files].concat(state.files),
- upload: {
- loading: false,
- status: 'Upload complete'
- }
- });
- } else {
- return _extends({}, state, {
- upload: {
- loading: false,
- status: 'Upload complete'
- }
- });
- }
case _types2.default.socket.status:
return samplernnSocket(state, action.data);
default:
@@ -4833,6 +5045,10 @@ var _live = __webpack_require__(/*! ./live/live.reducer */ "./app/client/live/li
var _live2 = _interopRequireDefault(_live);
+var _dataset = __webpack_require__(/*! ./dataset/dataset.reducer */ "./app/client/dataset/dataset.reducer.js");
+
+var _dataset2 = _interopRequireDefault(_dataset);
+
var _task = __webpack_require__(/*! ./task/task.reducer */ "./app/client/task/task.reducer.js");
var _task2 = _interopRequireDefault(_task);
@@ -4841,16 +5057,17 @@ var _module = __webpack_require__(/*! ./modules/module.reducer */ "./app/client/
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+// import navReducer from './nav.reducer'
var appReducer = (0, _redux.combineReducers)({
system: _system2.default,
dashboard: _dashboard2.default,
live: _live2.default,
+ dataset: _dataset2.default,
task: _task2.default,
router: _reactRouterRedux.routerReducer,
module: _module.moduleReducer
});
-// import navReducer from './nav.reducer'
var history = exports.history = (0, _createBrowserHistory2.default)();
var store = exports.store = (0, _redux.createStore)(appReducer, (0, _redux.compose)((0, _redux.applyMiddleware)(
// createLogger(),
@@ -5637,9 +5854,13 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
+var _system$app$folder$fi;
+
var _crud = __webpack_require__(/*! ./api/crud.types */ "./app/client/api/crud.types.js");
-exports.default = {
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+
+exports.default = (_system$app$folder$fi = {
system: {
running_command: 'SYSTEM_RUNNING_COMMAND',
command_output: 'SYSTEM_COMMAND_OUTPUT',
@@ -5695,21 +5916,20 @@ exports.default = {
save_frame: 'SAVE_FRAME',
saving_video: 'SAVING_VIDEO',
save_video: 'SAVE_VIDEO'
- },
- samplernn: {
- // dataset uploading
- upload_files: 'UPLOAD_FILES',
- file_progress: 'FILE_PROGRESS',
- file_uploaded: 'FILE_UPLOADED',
- fetch_url: 'FETCH_URL',
- fetch_progress: 'FETCH_PROGRESS'
- // queue and train
- // update checkpoint settings
- // reset checkpoint settings
- // queue new checkpoint
- //
}
-};
+}, _defineProperty(_system$app$folder$fi, 'dataset', {
+ upload_files: 'UPLOAD_FILES',
+ file_progress: 'FILE_PROGRESS',
+ file_uploaded: 'FILE_UPLOADED',
+ fetch_url: 'FETCH_URL',
+ fetch_progress: 'FETCH_PROGRESS'
+}), _defineProperty(_system$app$folder$fi, 'samplernn', {
+ // queue and train
+ // update checkpoint settings
+ // reset checkpoint settings
+ // queue new checkpoint
+ //
+}), _system$app$folder$fi);
/***/ }),