diff options
| author | jules@lens <julescarbon@gmail.com> | 2018-09-05 12:00:28 +0200 |
|---|---|---|
| committer | jules@lens <julescarbon@gmail.com> | 2018-09-05 12:00:28 +0200 |
| commit | 9abfa16dc059d042c21f1636ecc8797ef29a030d (patch) | |
| tree | d0583cb5dae01de1abc57ed8f7587d23242ed6f0 /app/client/socket/socket.actions.js | |
| parent | 0a3c6743543dd3dfcb876f5ce735b72d050e981d (diff) | |
| parent | 15eb6806b6e216255f33abcb885f6cdbc38a7663 (diff) | |
Merge branch 'master' of asdf.us:live-cortex
Diffstat (limited to 'app/client/socket/socket.actions.js')
| -rw-r--r-- | app/client/socket/socket.actions.js | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/app/client/socket/socket.actions.js b/app/client/socket/socket.actions.js index e15dda2..78b0517 100644 --- a/app/client/socket/socket.actions.js +++ b/app/client/socket/socket.actions.js @@ -1,24 +1,13 @@ import uuidv1 from 'uuid/v1' import { socket } from './socket.connection' -export function run_system_command(opt) { - return syscall_async('run_system_command', opt) -} -export function disk_usage(opt) { - return syscall_async('run_system_command', { cmd: 'du', ...opt }) -} -export function list_directory(opt) { - return syscall_async('list_directory', opt).then(res => res.files) -} -export function list_sequences(opt) { - return syscall_async('list_sequences', opt).then(res => res.sequences) -} -export function run_script(opt) { - return syscall_async('run_script', opt) -} -export function upload_file(opt) { - return syscall_async('upload_file', opt) -} +export const run_system_command = opt => syscall_async('run_system_command', opt) +export const disk_usage = opt => syscall_async('run_system_command', { cmd: 'du', ...opt }) +export const list_directory = opt => syscall_async('list_directory', opt).then(res => res.files) +export const list_sequences = opt => syscall_async('list_sequences', opt).then(res => res.sequences) +export const run_script = opt => syscall_async('run_script', opt) +export const upload_file = opt => syscall_async('upload_file', opt) + export const syscall_async = (tag, payload, ttl=10000) => { ttl = payload.ttl || ttl return new Promise( (resolve, reject) => { |
