mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-07 05:05:26 +02:00
* Rewrite SSH authentication - now works with PuTTY (thoguh there are some issues) and standard ssh. WIP still!
* Idle monitor not started until 'ready' signal
This commit is contained in:
parent
6a2d283fad
commit
e7e9746a85
4 changed files with 105 additions and 120 deletions
|
@ -94,17 +94,6 @@ function Client(input, output) {
|
|||
this.currentTheme = { info : { name : 'N/A', description : 'None' } };
|
||||
this.lastKeyPressMs = Date.now();
|
||||
|
||||
//
|
||||
// Every 1m, check for idle.
|
||||
//
|
||||
this.idleCheck = setInterval(function checkForIdle() {
|
||||
var nowMs = Date.now();
|
||||
|
||||
if(nowMs - self.lastKeyPressMs >= (Config.misc.idleLogoutSeconds * 1000)) {
|
||||
self.emit('idle timeout');
|
||||
}
|
||||
}, 1000 * 60);
|
||||
|
||||
Object.defineProperty(this, 'node', {
|
||||
get : function() {
|
||||
return self.session.id + 1;
|
||||
|
@ -112,7 +101,6 @@ function Client(input, output) {
|
|||
});
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Peek at incoming |data| and emit events for any special
|
||||
// handling that may include:
|
||||
|
@ -408,6 +396,30 @@ Client.prototype.setInputOutput = function(input, output) {
|
|||
this.term = new term.ClientTerminal(this.output);
|
||||
};
|
||||
|
||||
Client.prototype.setTermType = function(termType) {
|
||||
this.term.env.TERM = termType;
|
||||
this.term.termType = termType;
|
||||
|
||||
this.log.debug( { termType : termType }, 'Set terminal type');
|
||||
};
|
||||
|
||||
Client.prototype.startIdleMonitor = function() {
|
||||
var self = this;
|
||||
|
||||
self.lastKeyPressMs = Date.now();
|
||||
|
||||
//
|
||||
// Every 1m, check for idle.
|
||||
//
|
||||
self.idleCheck = setInterval(function checkForIdle() {
|
||||
var nowMs = Date.now();
|
||||
|
||||
if(nowMs - self.lastKeyPressMs >= (Config.misc.idleLogoutSeconds * 1000)) {
|
||||
self.emit('idle timeout');
|
||||
}
|
||||
}, 1000 * 60);
|
||||
};
|
||||
|
||||
Client.prototype.end = function () {
|
||||
this.detachCurrentMenuModule();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue