diff options
Diffstat (limited to 'public/bundle.js')
| -rw-r--r-- | public/bundle.js | 483 |
1 files changed, 206 insertions, 277 deletions
diff --git a/public/bundle.js b/public/bundle.js index 512deb7..ae8d7cd 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -2801,243 +2801,6 @@ exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)( /***/ }), -/***/ "./app/client/browser/browser.component.js": -/*!*************************************************!*\ - !*** ./app/client/browser/browser.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 _reactRouterDom = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/es/index.js"); - -var _common = __webpack_require__(/*! ../common */ "./app/client/common/index.js"); - -var _actions = __webpack_require__(/*! ../actions */ "./app/client/actions.js"); - -var _actions2 = _interopRequireDefault(_actions); - -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 Browser = function (_Component) { - _inherits(Browser, _Component); - - function Browser() { - var _ref; - - var _temp, _this, _ret; - - _classCallCheck(this, Browser); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Browser.__proto__ || Object.getPrototypeOf(Browser)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - dir: '/', - module: 'pix2pixhd', - files: [], - loading: true - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - _createClass(Browser, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.fetch(this.state.dir); - } - }, { - key: 'handlePick', - value: function handlePick(file) { - console.log(file); - if (file.dir) { - this.fetch([this.state.dir, file.name].join('/').replace('//', '/')); - } else { - this.fetchFile([this.state.dir, file.name].join('/').replace('//', '/')); - } - } - }, { - key: 'fetch', - value: function fetch(dir) { - var _this2 = this; - - console.log('fetch', dir); - var module = this.state.module; - - this.setState({ dir: dir, file: null, loading: true }); - _actions2.default.socket.list_directory({ module: module, dir: dir }).then(function (files) { - console.log(files); - _this2.setState({ dir: dir, files: files, loading: false }); - }); - } - }, { - key: 'fetchFile', - value: function fetchFile(fn) { - var _this3 = this; - - console.log('fetch file', fn); - var module = this.state.module; - - this.setState({ file: null, loadingFile: true }); - _actions2.default.socket.read_file({ module: module, fn: fn }).then(function (file) { - console.log(file); - _this3.setState({ file: file, loadingFile: false }); - }); - } - }, { - key: 'render', - value: function render() { - var _this4 = this; - - var app = this.props.app; - var _state = this.state, - loading = _state.loading, - dir = _state.dir, - module = _state.module, - files = _state.files, - loadingFile = _state.loadingFile, - file = _state.file; - - console.log(this.props, this.state); - return (0, _preact.h)( - 'div', - { className: 'app browser' }, - (0, _preact.h)( - 'h1', - null, - dir, - dir[dir.length - 1] !== '/' && '/' - ), - app.tool, - (0, _preact.h)('br', null), - loading && (0, _preact.h)(_common.Loading, null), - (0, _preact.h)(_common.FileList, { - files: files, - groupDirectories: true, - parentDirectory: dir !== '/', - orderBy: 'name asc', - fields: 'name datetime size', - onClick: function onClick(file, e) { - e.preventDefault(); - e.stopPropagation(); - console.log('picked a result', file); - _this4.handlePick(file); - }, - onClickParent: function onClickParent(e) { - console.log('navigate up'); - _this4.fetch(_this4.state.dir.split('/').slice(0, -1).join('/') || '/'); - } - }), - loadingFile && (0, _preact.h)(_common.Loading, null), - file && (0, _preact.h)(_common.FileViewer, { file: file }) - ); - } - }]); - - return Browser; -}(_preact.Component); - -var mapStateToProps = function mapStateToProps(state) { - return { - app: state.system.app - }; -}; - -var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { - return { - actions: (0, _redux.bindActionCreators)({}, dispatch) - }; -}; - -exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Browser); - -/***/ }), - -/***/ "./app/client/browser/browser.reducer.js": -/*!***********************************************!*\ - !*** ./app/client/browser/browser.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); - -var _moment = __webpack_require__(/*! moment/min/moment.min */ "./node_modules/moment/min/moment.min.js"); - -var _moment2 = _interopRequireDefault(_moment); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var FileSaver = __webpack_require__(/*! file-saver */ "./node_modules/file-saver/FileSaver.js"); - -var browserInitialState = { - loading: false, - progress: null, - error: null, - data: {}, - images: [], - files: [] -}; - -var browserReducer = function browserReducer() { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : browserInitialState; - var action = arguments[1]; - - switch (action.type) { - case _types2.default.app.load_progress: - if (!action.data || action.data.module !== 'browser') { - return state; - } - return _extends({}, state, { - loading: true, - progress: action.progress - }); - case _types2.default.app.load: - return _extends({}, state, { - loading: false, - error: null, - data: action.data - }); - default: - return state; - } -}; - -exports.default = browserReducer; - -/***/ }), - /***/ "./app/client/common/audioPlayer/audioPlayer.actions.js": /*!**************************************************************!*\ !*** ./app/client/common/audioPlayer/audioPlayer.actions.js ***! @@ -3390,6 +3153,176 @@ exports.default = AugmentationGrid; /***/ }), +/***/ "./app/client/common/browser.component.js": +/*!************************************************!*\ + !*** ./app/client/common/browser.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 _reactRouterDom = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/es/index.js"); + +var _common = __webpack_require__(/*! ../common */ "./app/client/common/index.js"); + +var _actions = __webpack_require__(/*! ../actions */ "./app/client/actions.js"); + +var _actions2 = _interopRequireDefault(_actions); + +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 Browser = function (_Component) { + _inherits(Browser, _Component); + + function Browser() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, Browser); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Browser.__proto__ || Object.getPrototypeOf(Browser)).call.apply(_ref, [this].concat(args))), _this), _this.state = { + dir: '/', + files: [], + loading: true + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(Browser, [{ + key: 'componentDidMount', + value: function componentDidMount() { + this.fetch(this.state.dir); + } + }, { + key: 'handlePick', + value: function handlePick(file) { + console.log(file); + if (file.dir) { + this.fetch([this.state.dir, file.name].join('/').replace('//', '/')); + } else { + this.fetchFile([this.state.dir, file.name].join('/').replace('//', '/')); + } + } + }, { + key: 'fetch', + value: function fetch(dir) { + var _this2 = this; + + console.log('fetch', dir); + var module = this.props.app.tool; + + this.setState({ dir: dir, file: null, loading: true }); + _actions2.default.socket.list_directory({ module: module, dir: dir }).then(function (files) { + console.log(files); + _this2.setState({ dir: dir, files: files, loading: false }); + }); + } + }, { + key: 'fetchFile', + value: function fetchFile(fn) { + var _this3 = this; + + console.log('fetch file', fn); + var module = this.props.app.tool; + + this.setState({ file: null, loadingFile: true }); + _actions2.default.socket.read_file({ module: module, fn: fn }).then(function (file) { + console.log(file); + _this3.setState({ file: file, loadingFile: false }); + }); + } + }, { + key: 'render', + value: function render() { + var _this4 = this; + + var app = this.props.app; + var _state = this.state, + loading = _state.loading, + dir = _state.dir, + files = _state.files, + loadingFile = _state.loadingFile, + file = _state.file; + + console.log(this.props, this.state); + return (0, _preact.h)( + 'div', + { className: 'app browser' }, + (0, _preact.h)( + 'h1', + null, + dir, + dir[dir.length - 1] !== '/' && '/' + ), + app.tool, + (0, _preact.h)('br', null), + loading && (0, _preact.h)(_common.Loading, null), + (0, _preact.h)(_common.FileList, { + files: files, + groupDirectories: true, + parentDirectory: dir !== '/', + orderBy: 'name asc', + fields: 'name datetime size', + onClick: function onClick(file, e) { + e.preventDefault(); + e.stopPropagation(); + console.log('picked a result', file); + _this4.handlePick(file); + }, + onClickParent: function onClickParent(e) { + console.log('navigate up'); + _this4.fetch(_this4.state.dir.split('/').slice(0, -1).join('/') || '/'); + } + }), + loadingFile && (0, _preact.h)(_common.Loading, null), + file && (0, _preact.h)(_common.FileViewer, { file: file }) + ); + } + }]); + + return Browser; +}(_preact.Component); + +var mapStateToProps = function mapStateToProps(state) { + return { + app: state.system.app + }; +}; + +var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { + return { + actions: (0, _redux.bindActionCreators)({}, dispatch) + }; +}; + +exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Browser); + +/***/ }), + /***/ "./app/client/common/button.component.js": /*!***********************************************!*\ !*** ./app/client/common/button.component.js ***! @@ -4634,7 +4567,7 @@ exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)( Object.defineProperty(exports, "__esModule", { value: true }); -exports.AugmentationGrid = exports.ButtonGrid = exports.TaskList = exports.CurrentTask = exports.Checkbox = exports.Button = exports.SelectGroup = exports.Select = exports.Slider = exports.NumberInput = exports.TextInput = exports.Param = exports.ParamGroup = exports.Group = exports.Player = exports.Gallery = exports.FileViewer = exports.FileUpload = exports.FileRow = exports.FileList = exports.FolderList = exports.AudioPlayer = exports.Header = exports.Progress = exports.Loading = exports.Views = undefined; +exports.AugmentationGrid = exports.ButtonGrid = exports.TaskList = exports.CurrentTask = exports.Checkbox = exports.Button = exports.SelectGroup = exports.Select = exports.Slider = exports.NumberInput = exports.TextInput = exports.Param = exports.ParamGroup = exports.Group = exports.Browser = exports.Player = exports.Gallery = exports.FileViewer = exports.FileUpload = exports.FileRow = exports.FileList = exports.FolderList = exports.AudioPlayer = exports.Header = exports.Progress = exports.Loading = exports.Views = undefined; var _audioPlayer = __webpack_require__(/*! ./audioPlayer/audioPlayer.component */ "./app/client/common/audioPlayer/audioPlayer.component.js"); @@ -4644,6 +4577,10 @@ var _augmentationGrid = __webpack_require__(/*! ./augmentationGrid.component */ var _augmentationGrid2 = _interopRequireDefault(_augmentationGrid); +var _browser = __webpack_require__(/*! ./browser.component */ "./app/client/common/browser.component.js"); + +var _browser2 = _interopRequireDefault(_browser); + var _button = __webpack_require__(/*! ./button.component */ "./app/client/common/button.component.js"); var _button2 = _interopRequireDefault(_button); @@ -4750,6 +4687,7 @@ exports.FileUpload = _fileUpload2.default; exports.FileViewer = _fileViewer2.default; exports.Gallery = _gallery2.default; exports.Player = _player2.default; +exports.Browser = _browser2.default; exports.Group = _group2.default; exports.ParamGroup = _paramGroup2.default; exports.Param = _param2.default; @@ -7699,10 +7637,6 @@ var _dashboard = __webpack_require__(/*! ./dashboard/dashboard.component */ "./a var _dashboard2 = _interopRequireDefault(_dashboard); -var _browser = __webpack_require__(/*! ./browser/browser.component */ "./app/client/browser/browser.component.js"); - -var _browser2 = _interopRequireDefault(_browser); - var _modules = __webpack_require__(/*! ./modules */ "./app/client/modules/index.js"); var _modules2 = _interopRequireDefault(_modules); @@ -7741,7 +7675,7 @@ var app = (0, _preact.h)( } }), (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/system', component: _system2.default }), (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/dashboard', component: _dashboard2.default }), - (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/browse', component: _browser2.default }), + (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/browse', component: _common.Browser }), (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/logout', component: _auth2.default.Logout }), (0, _preact.h)(_reactRouterDom.Route, { exact: true, path: '/login', component: function component() { (0, _preact.h)(_reactRouterDom.Redirect, { to: '/' }); @@ -12687,6 +12621,34 @@ var Pix2PixHDTrain = function (_Component) { ), (0, _preact.h)( _common.Group, + { title: 'Augmentation Grid' }, + (0, _preact.h)(_common.AugmentationGrid, { + checkpoint: this.props.pix2pixhd.checkpoint, + take: [1, 2, 3, 4, 5, 10, 15, 20, 25, 50, 75, 100, 200, 300, 400, 500, 1000], + make: [1, 2, 3, 4, 5, 10, 15, 20, 25, 50, 75, 100, 200], + onAugment: function onAugment(augment_take, augment_make) { + _this2.props.remote.augment_task(_this2.state.checkpoint_name, _extends({}, _this2.state, { + augment_take: augment_take, + augment_make: augment_make + })); + }, + onTrain: function onTrain() { + _this2.props.remote.train_task(_this2.state.checkpoint_name, pix2pixhd.folder_id, 1); + setTimeout(function () { + // auto-generate epoch demo + _this2.props.remote.augment_task(_this2.state.checkpoint_name, _extends({}, _this2.state, { + augment_take: 10, + augment_make: 150, + no_symlinks: true, + mov: true, + folder_id: _this2.props.pix2pixhd.data.resultsFolder.id + })); + }, 250); + } + }) + ), + (0, _preact.h)( + _common.Group, { title: 'Augment' }, (0, _preact.h)(_common.NumberInput, { name: 'augment_take', @@ -12727,34 +12689,6 @@ var Pix2PixHDTrain = function (_Component) { ), (0, _preact.h)( _common.Group, - { title: 'Augmentation Grid' }, - (0, _preact.h)(_common.AugmentationGrid, { - checkpoint: this.props.pix2pixhd.checkpoint, - take: [1, 2, 3, 4, 5, 10, 15, 20, 25, 50, 75, 100, 200, 300, 400, 500, 1000], - make: [1, 2, 3, 4, 5, 10, 15, 20, 25, 50, 75, 100, 200], - onAugment: function onAugment(augment_take, augment_make) { - _this2.props.remote.augment_task(_this2.state.checkpoint_name, _extends({}, _this2.state, { - augment_take: augment_take, - augment_make: augment_make - })); - }, - onTrain: function onTrain() { - _this2.props.remote.train_task(_this2.state.checkpoint_name, pix2pixhd.folder_id, 1); - setTimeout(function () { - // auto-generate epoch demo - _this2.props.remote.augment_task(_this2.state.checkpoint_name, _extends({}, _this2.state, { - augment_take: 10, - augment_make: 150, - no_symlinks: true, - mov: true, - folder_id: _this2.props.pix2pixhd.data.resultsFolder.id - })); - }, 250); - } - }) - ), - (0, _preact.h)( - _common.Group, { title: 'Status' }, (0, _preact.h)(_common.Button, { title: 'GPU', @@ -16867,10 +16801,6 @@ var _upload = __webpack_require__(/*! ./dataset/upload.reducer */ "./app/client/ var _upload2 = _interopRequireDefault(_upload); -var _browser = __webpack_require__(/*! ./browser/browser.reducer */ "./app/client/browser/browser.reducer.js"); - -var _browser2 = _interopRequireDefault(_browser); - var _dashboard = __webpack_require__(/*! ./dashboard/dashboard.reducer */ "./app/client/dashboard/dashboard.reducer.js"); var _dashboard2 = _interopRequireDefault(_dashboard); @@ -16883,6 +16813,7 @@ 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)({ router: _reactRouterRedux.routerReducer, auth: _auth2.default, @@ -16890,13 +16821,11 @@ var appReducer = (0, _redux.combineReducers)({ queue: _queue2.default, system: _system2.default, upload: _upload2.default, - browser: _browser2.default, dashboard: _dashboard2.default, audioPlayer: _audioPlayer2.default, 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(), |
