Search working

Former-commit-id: 968264159ae078bee3ad9be3d5996b7760d28378 [formerly 7f1c96ac435ca9e8c53568c833acefd88e25c1b8] [formerly 2cfc462e4bea9110429add93121e12479c39d0e6 [formerly da3f043cfd]]
Former-commit-id: 1074083560c0f7d451011617d39350b754516dfa [formerly 0edd1dc392bb57295d47219da9c1acc7eead4761]
Former-commit-id: a651c40fd4a4892c9dd2f72cbe6653b53809be38
This commit is contained in:
Henrique Dias committed 2017-07-03 18:07:14 +01:00
1 parent 009916d954
commit 869cd562e7
2 files changed
+52 -35

No files matched your search

+25 -1
View File
@@ -119,10 +119,34 @@ function checksum (url, algo) {
})
}
function command (url, command, onmessage, onclose) {
let protocol = (store.state.ssl ? 'wss:' : 'ws:')
url = removePrefix(url)
url = `${protocol}//${window.location.hostname}${store.state.baseURL}/api/command${url}?token=${store.state.jwt}`
let conn = new window.WebSocket(url)
conn.onopen = () => conn.send(command)
conn.onmessage = onmessage
conn.onclose = onclose
}
function search (url, search, onmessage, onclose) {
let protocol = (store.state.ssl ? 'wss:' : 'ws:')
url = removePrefix(url)
url = `${protocol}//${window.location.hostname}${store.state.baseURL}/api/search${url}?token=${store.state.jwt}`
let conn = new window.WebSocket(url)
conn.onopen = () => conn.send(search)
conn.onmessage = onmessage
conn.onclose = onclose
}
export default {
delete: rm,
fetch,
checksum,
move,
put
put,
command,
search
}