summaryrefslogtreecommitdiff
path: root/public/bundle.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-05 16:16:24 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-05 16:16:24 +0200
commitb0d534d174def2940287745535726c7e878dcbcc (patch)
tree499f8980f2e29bd36833bb943eacd01e9815759e /public/bundle.js
parente243e4f65cc2c98724a1cfb4d28ac5f1d1bc0a79 (diff)
more sane file naming
Diffstat (limited to 'public/bundle.js')
-rw-r--r--public/bundle.js125
1 files changed, 71 insertions, 54 deletions
diff --git a/public/bundle.js b/public/bundle.js
index 8ce535e..462988b 100644
--- a/public/bundle.js
+++ b/public/bundle.js
@@ -1284,28 +1284,43 @@ var FileRow = exports.FileRow = function FileRow(props) {
var date = file.date || file.created_at;
var epoch = file.epoch || file.epochs || 0;
+ var name = void 0;
+ var key = void 0;
+ if (file.name) {
+ name = file.name;
+ key = name;
+ } else if (file.url) {
+ if (file.opt && file.opt.type) {
+ name = file.opt.type + ': ' + file.opt.title;
+ key = file.opt.token;
+ } else {
+ name = file.url.replace(/^https?:\/\//, '');
+ key = name;
+ }
+ }
+
return (0, _preact.h)(
'div',
- { 'class': className, key: file.name },
+ { 'class': className, key: key },
fields.has('name') && (0, _preact.h)(
'div',
{ className: 'filename', title: file.name || file.url },
file.persisted === false ? (0, _preact.h)(
'span',
{ className: 'unpersisted' },
- file.name || file.url
+ name
) : linkFiles && file.url ? (0, _preact.h)(
'a',
{ target: '_blank', onClick: function onClick(e) {
return _onClick && _onClick(file, e);
}, href: file.url },
- file.name || file.url
+ name
) : (0, _preact.h)(
'span',
{ 'class': 'link', onClick: function onClick(e) {
return _onClick && _onClick(file, e);
} },
- file.name || file.url
+ name
)
),
fields.has('age') && (0, _preact.h)(
@@ -5283,7 +5298,6 @@ var SampleRNNDatasets = function (_Component) {
var _this = _possibleConstructorReturn(this, (SampleRNNDatasets.__proto__ || Object.getPrototypeOf(SampleRNNDatasets)).call(this, props));
- _this.fileOptions = _this.fileOptions.bind(_this);
_this.pickFile = _this.pickFile.bind(_this);
return _this;
}
@@ -5312,46 +5326,6 @@ var SampleRNNDatasets = function (_Component) {
console.log('pick', file);
}
}, {
- key: 'fileOptions',
- value: function fileOptions(file) {
- var _this2 = this;
-
- if (file.activity === 'url' && !file.dataset) {
- if (this.props.runner.cpu.status !== 'IDLE') {
- return (0, _preact.h)(
- 'div',
- { className: 'gray' },
- 'fetching...'
- );
- } else {
- return (0, _preact.h)(
- 'div',
- { className: 'link', onClick: function onClick() {
- return _this2.fetchURL(file.url);
- } },
- 'fetch'
- );
- }
- }
- return (0, _preact.h)(
- 'div',
- null,
- (0, _preact.h)(
- 'div',
- { className: 'link', onClick: function onClick() {
- return _this2.train(file);
- } },
- 'train'
- ),
- file.epoch == 0 && (0, _preact.h)(
- 'div',
- { className: 'epochs' },
- file.epochs,
- ' ep.'
- )
- );
- }
- }, {
key: 'onDeleteFile',
value: function onDeleteFile(file) {
var yes = confirm('Are you sure you want to delete this file?');
@@ -5409,7 +5383,7 @@ var SampleRNNDatasets = function (_Component) {
}, {
key: 'renderGroups',
value: function renderGroups() {
- var _this3 = this;
+ var _this2 = this;
var _props3 = this.props,
samplernn = _props3.samplernn,
@@ -5447,7 +5421,7 @@ var SampleRNNDatasets = function (_Component) {
{ key: dataset.name, className: 'row dataset', onClick: function onClick() {
return onPickDataset && onPickDataset(dataset);
} },
- _this3.props.beforeRow && _this3.props.beforeRow(dataset),
+ _this2.props.beforeRow && _this2.props.beforeRow(dataset),
(0, _preact.h)(
'div',
{ className: 'col' },
@@ -5459,17 +5433,16 @@ var SampleRNNDatasets = function (_Component) {
fileListClassName: '',
rowClassName: 'input_file',
fields: 'name date size delete',
- options: _this3.fileOptions,
onClick: onPickFile,
onDelete: function onDelete(file) {
- return _this3.onDeleteFile(file);
+ return _this2.onDeleteFile(file);
}
})
),
(0, _preact.h)(
'div',
{ className: ['col', 'quiet', dataset.isBuilt ? 'built' : 'not_built', isProcessing ? 'processing' : 'not_processing'].join(' ') },
- _this3.props.datasetActions && _this3.props.datasetActions(dataset, isFetching, isProcessing),
+ _this2.props.datasetActions && _this2.props.datasetActions(dataset, isFetching, isProcessing),
status
),
(0, _preact.h)(
@@ -5492,11 +5465,11 @@ var SampleRNNDatasets = function (_Component) {
fields: 'name date epoch size',
onPickFile: onPickFile,
onDelete: function onDelete(file) {
- return _this3.onDeleteFile(file);
+ return _this2.onDeleteFile(file);
}
})
),
- _this3.props.afterRow && _this3.props.afterRow(dataset)
+ _this2.props.afterRow && _this2.props.afterRow(dataset)
);
});
return datasets;
@@ -6222,6 +6195,7 @@ var samplernnReducer = function samplernnReducer() {
return state;
case _types2.default.file.update:
+ console.log('>>>>>>> file update');
if (action.data.module === 'samplernn') {
var _extends6;
@@ -6246,6 +6220,8 @@ var samplernnReducer = function samplernnReducer() {
output: !action.data.generated ? [] : [action.data.id]
});
}
+ console.log('old_dataset', old_dataset_update.name);
+ console.log('new_dataset', new_dataset_update.name);
return _extends({}, state, {
loading: false,
data: _extends({}, state.data, {
@@ -6794,7 +6770,7 @@ var fetch_task = exports.fetch_task = function fetch_task(url, file_id, dataset)
var task = {
module: 'samplernn',
activity: 'fetch',
- dataset: name,
+ dataset: dataset,
opt: {
url: url,
file_id: file_id,
@@ -7158,6 +7134,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
_socket.socket.on('api_res', function (data) {
// console.log('system response', data)
var type = _types2.default[data.datatype];
+ console.log('api_res', data.type, data.datatype);
if (!type) return console.error('socket:api_res bad datatype', data.datatype);
switch (data.type) {
case 'create':
@@ -7700,6 +7677,46 @@ var enqueue_test_task = exports.enqueue_test_task = function enqueue_test_task(d
};
};
+window.addEventListener('keyDown', function (e) {
+ if (e.altKey) {
+ switch (e.keyCode) {
+ case 192:
+ // tilde - switch tool
+ break;
+ case 49:
+ // 1
+ break;
+ case 50:
+ // 2
+ break;
+ case 51:
+ // 3
+ break;
+ case 52:
+ // 4
+ break;
+ case 53:
+ // 5
+ break;
+ case 54:
+ // 6
+ break;
+ case 55:
+ // 7
+ break;
+ case 56:
+ // 8
+ break;
+ case 57:
+ // 9
+ break;
+ case 48:
+ // 0
+ break;
+ }
+ }
+});
+
/***/ }),
/***/ "./app/client/system/system.component.js":
@@ -8311,7 +8328,7 @@ var systemReducer = function systemReducer() {
case _types2.default.task.task_finish:
if (action.task === 'cpu' || state.runner.cpu.task && action.task && state.runner.cpu.task.uuid === action.task.uuid) {
processor = 'cpu';
- } else if (action.task === 'gpu' || state.runner.cpu.task && action.task && state.runner.gpu.task.uuid === action.task.uuid) {
+ } else if (action.task === 'gpu' || state.runner.gpu.task && action.task && state.runner.gpu.task.uuid === action.task.uuid) {
processor = 'gpu';
} else {
processor = null;