summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/api/index.js2
-rw-r--r--app/client/modules/samplernn/samplernn.actions.js9
-rw-r--r--app/client/types.js27
-rw-r--r--app/server/site.js2
4 files changed, 37 insertions, 3 deletions
diff --git a/app/api/index.js b/app/api/index.js
index 7562db7..9ee943f 100644
--- a/app/api/index.js
+++ b/app/api/index.js
@@ -10,7 +10,7 @@ folder.upload = (folder_id, files) => {
for (var i = 0; i < files.length; i++) {
data.append('file', files[i])
}
- return fetch('/folders/' + folder_id, postBody(data))
+ return fetch('/api/folders/' + folder_id, postBody(data))
.then(req => req.json())
.catch(error)
}
diff --git a/app/client/modules/samplernn/samplernn.actions.js b/app/client/modules/samplernn/samplernn.actions.js
new file mode 100644
index 0000000..95fef8e
--- /dev/null
+++ b/app/client/modules/samplernn/samplernn.actions.js
@@ -0,0 +1,9 @@
+import socket from '../../socket'
+import types from '../../types'
+
+export const uploadFiles = (files) => {
+ return { type: types.samplernn.upload_files }
+}
+export const fetchURL = (url) => {
+ return { type: types.samplernn.fetch_url }
+}
diff --git a/app/client/types.js b/app/client/types.js
index 6f4a0b2..25e5fb2 100644
--- a/app/client/types.js
+++ b/app/client/types.js
@@ -56,5 +56,30 @@ export default {
save_frame: 'SAVE_FRAME',
saving_video: 'SAVING_VIDEO',
save_video: 'SAVE_VIDEO',
- }
+ },
+ folder: crud('folder', ['']),
+ file: crud('file', []),
+ task: crud('task', []),
+ 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
+ //
+ },
+}
+
+const standard_actions = ['index','show','create','update','destroy','sort']
+function crud(type, actions=[]){
+ return actions
+ .concat(standard_actions)
+ .reduce((lookup, action) => {
+ (lookup[action] = [type, action].join('_').toUpperCase()) && lookup
+ }, {})
} \ No newline at end of file
diff --git a/app/server/site.js b/app/server/site.js
index 9fd77d5..f75c644 100644
--- a/app/server/site.js
+++ b/app/server/site.js
@@ -17,7 +17,7 @@ app.use(express.query())
app.use(express.static(path.join(__dirname, '../../public')))
export const io = require('socket.io').listen(server)
-console.log(io)
+
import { api } from './util/api'
constĀ api_folders = api(app, 'folder')