Added teardown control command to capture the reason for the error

teardown control message will be sent from Webssh Plugin when plugin encounters an error and would like to display that error message along with the status message. Following are the error reasons currently we are supporting:
1. "Hostname unresolved"
2. "Inactivity timeout"
3. "Authentication failed"
4. "User exited"
This commit is contained in:
vijay-kumar-b 2019-11-25 16:40:20 +05:30
parent 633184df39
commit 0cbd140f66
2 changed files with 9 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -135,7 +135,13 @@ socket.on('disconnect', function (err) {
status.innerHTML = status.innerHTML =
'WEBSOCKET SERVER DISCONNECTED: ' + err 'WEBSOCKET SERVER DISCONNECTED: ' + err
} }
socket.io.reconnection(false) socket.io.reconnection(false);
})
socket.on('teardown', function (teardown_reason) {
reason.style.backgroundColor = 'red'
reason.innerHTML = teardown_reason
socket.io.disconnect();
}) })
socket.on('error', function (err) { socket.on('error', function (err) {