diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-09-22 19:12:20 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-09-22 19:12:20 +0200 |
| commit | 89a3b6bb4a6d6a7ef936e8ec1d4afefd4a8385fd (patch) | |
| tree | c7d9b9f3a0f6ed1a36e616b0fdeca5dce4d448d6 /app | |
| parent | bab7a5431b2255851034b19fb1e5cba641882131 (diff) | |
thumbnail method
Diffstat (limited to 'app')
| -rw-r--r-- | app/client/common/fileViewer.component.js | 1 | ||||
| -rw-r--r-- | app/client/modules/pix2pixhd/views/sequence.editor.js | 4 | ||||
| -rw-r--r-- | app/client/socket/socket.actions.js | 1 | ||||
| -rw-r--r-- | app/relay/remote.js | 10 | ||||
| -rw-r--r-- | app/relay/runner.js | 7 | ||||
| -rw-r--r-- | app/relay/system.js | 7 |
6 files changed, 21 insertions, 9 deletions
diff --git a/app/client/common/fileViewer.component.js b/app/client/common/fileViewer.component.js index b1cabd4..fcc4e9c 100644 --- a/app/client/common/fileViewer.component.js +++ b/app/client/common/fileViewer.component.js @@ -39,6 +39,7 @@ class FileViewer extends Component { console.log('fetch file', fn) const { tool: module } = this.props.app this.setState({ buffer: null, loading: true }) + actions.socket.read_file({ module, fn }).then(buffer => { console.log('fetched buffer') const { stale } = this.state diff --git a/app/client/modules/pix2pixhd/views/sequence.editor.js b/app/client/modules/pix2pixhd/views/sequence.editor.js index 6a5da39..e66aebf 100644 --- a/app/client/modules/pix2pixhd/views/sequence.editor.js +++ b/app/client/modules/pix2pixhd/views/sequence.editor.js @@ -130,8 +130,8 @@ class SequenceEditor extends Component { > {selection && <div className='selection' style={selection}></div>} </div> - <FileViewer path={path} file={this.state.frameA} /> - <FileViewer path={path} file={this.state.frameB} /> + <FileViewer thumbnail path={path} file={this.state.frameA} /> + <FileViewer thumbnail path={path} file={this.state.frameB} /> </div> ) } diff --git a/app/client/socket/socket.actions.js b/app/client/socket/socket.actions.js index 31d73cc..b83c9cf 100644 --- a/app/client/socket/socket.actions.js +++ b/app/client/socket/socket.actions.js @@ -9,6 +9,7 @@ export const list_sequences = opt => syscall_async('list_sequences', opt).th export const run_script = opt => syscall_async('run_script', opt) export const upload_file = opt => syscall_async('upload_file', opt) export const read_file = opt => syscall_async('read_file', opt).then(res => res.file) +export const thumbnail = opt => syscall_async('thumbnail', opt).then(res => res.file) export const syscall_async = (tag, payload, ttl=10000) => { ttl = payload.ttl || ttl diff --git a/app/relay/remote.js b/app/relay/remote.js index 7cb7455..9c59749 100644 --- a/app/relay/remote.js +++ b/app/relay/remote.js @@ -157,6 +157,16 @@ remote.on('system', (data) => { }) }) break + case 'thumbnail': + system.thumbnail(data.payload, (file) => { + remote.emit('system_res', { + type: 'thumbnail', + query: data.payload, + uuid: data.uuid, + file, + }) + }) + break case 'get_status': remote.emit('system_res', { type: 'relay_status', diff --git a/app/relay/runner.js b/app/relay/runner.js index 70988b0..7203956 100644 --- a/app/relay/runner.js +++ b/app/relay/runner.js @@ -15,6 +15,13 @@ export const state = { current_gpu_task: idle_state, } +export function status() { + return { + cpu: serialize_task(state.current_cpu_task), + gpu: serialize_task(state.current_gpu_task), + } +} + export function get_current_cpu_task(){ return state.current_cpu_task } diff --git a/app/relay/system.js b/app/relay/system.js index 90dbf66..49b8c33 100644 --- a/app/relay/system.js +++ b/app/relay/system.js @@ -37,13 +37,6 @@ export function upload_file(task, cb) { // localhost:7013/api/folder/1/upload/ } -export function status () { - return { - cpu: serialize_task(state.current_cpu_task), - gpu: serialize_task(state.current_gpu_task), - } -} - export function run_system_command(opt, cb) { console.log('running system command:', opt.cmd) switch(opt.cmd) { |
