diff options
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) => { |
