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

@ -16,7 +16,7 @@ require('../css/style.css')
var geometrySent = false var geometrySent = false
var sessionLogEnable = false var sessionLogEnable = false
var loggedData = false var loggedData = false
var allowreplay = false var allowreplay = false
var allowreauth = false var allowreauth = false
var sessionLog, sessionFooter, logDate, currentDate, myFile, errorExists var sessionLog, sessionFooter, logDate, currentDate, myFile, errorExists
var termid // eslint-disable-line var termid // eslint-disable-line
@ -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) {