Better handling of connection errors

This commit is contained in:
Dane Everitt 2018-08-06 21:33:43 -07:00
parent f1ec968f38
commit f20d40460e
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 28 additions and 11 deletions

View file

@ -45,9 +45,15 @@
*/
connected: function (state) {
if (state) {
this.terminal.open(this.$refs.terminal);
this.terminal.fit();
this.terminal.clear();
this.$socket.emit('send server log');
} else {
this.terminal.dispose();
}
}
},
},
/**
@ -64,7 +70,7 @@
data.line.split(/\n/g).forEach(line => {
this.terminal.writeln(line + '\u001b[0m');
});
}
},
},
/**
@ -73,10 +79,6 @@
* socket is not connected this will occur automatically when it connects.
*/
mounted: function () {
this.terminal.open(this.$refs.terminal);
this.terminal.fit();
this.terminal.clear();
if (this.connected) {
this.$socket.emit('send server log');
}