Skip to content
This repository has been archived by the owner on Feb 27, 2020. It is now read-only.

Commit

Permalink
Redirect to socketError page if socket is fully closed
Browse files Browse the repository at this point in the history
  • Loading branch information
duboisR committed Jun 20, 2017
1 parent 37e4f6e commit 5bd72ac
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
19 changes: 19 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Done
- History
- Connect to unix socket
- Redirection -> NoSocket Page
- Show history
- Restore history
- Error pages
- NoSocket
- NotFound
Expand All @@ -62,6 +64,7 @@ Done
- Remove file
- Remove directory
- Restore file
- Restore history
- ViewSwitcher
- List view
- Grid view
Expand All @@ -73,10 +76,12 @@ Done
- USER_MANIFEST_CREATE_FILE
- USER_MANIFEST_RENAME_FILE
- USER_MANIFEST_DELETE_FILE
- USER_MANIFEST_RESTORE_FILE
- USER_MANIFEST_LIST_DIR
- USER_MANIFEST_MAKE_DIR
- USER_MANIFEST_REMOVE_DIR
- USER_MANIFEST_SHOW_DUSTBIN
- USER_MANIFEST_HISTORY
- USER_MANIFEST_RESTORE
- FILE_READ
- FILE_STAT
Expand All @@ -88,13 +93,27 @@ Done
- Remove file
- Remove directory
- Restore file
- Restore history
- API
- Notify api
- Socket api

Todo
----

23/06/2017
**********************
- Parsec-GUI
- PersonalFiles
- Dropzone
- Search input
- Use new backend API

16/06/2017
**********************
- Parsec-GUI
- Use new backend API [~OK]

09/06/2017
**********************
- Parsec-GUI
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Secure cloud framework

* Free software: GPL v3
* Documentation: https://parsec-cloud.readthedocs.org.
* You need to install `libappindicator1` to get the tray working.

## Credits

Expand Down
7 changes: 7 additions & 0 deletions src/api/socketApi.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import NotifyApi from '../api/notifyApi'

class SocketApi {
static connect(path='/tmp/parsec') {
return new Promise((resolve, reject) => {
Expand All @@ -7,8 +9,13 @@ class SocketApi {
if(this._socket != null) this._socket.end()
this._socket = new net.Socket()
this._socket.on("error", (error) => reject(error))

this._socket.connect({ path }, () => {
this._socket.setEncoding('utf8')
this._socket.on("close", (error) => {
window.location.hash = '/socket-error'
NotifyApi.notify('Error', `Socket is fully closed (${path})`)
})
// TODO: Without identity_load
resolve({ status: 'ok' })
// TODO: With identity_load
Expand Down

0 comments on commit 5bd72ac

Please sign in to comment.