mirror of https://github.com/huashengdun/webssh
Change title when wssh connected
parent
b14b8a9f79
commit
74cdb2d31f
|
@ -8,6 +8,8 @@ jQuery(function($){
|
||||||
var status = $('#status'),
|
var status = $('#status'),
|
||||||
btn = $('.btn-primary'),
|
btn = $('.btn-primary'),
|
||||||
style = {},
|
style = {},
|
||||||
|
title_text = 'WebSSH',
|
||||||
|
title_element = document.querySelector('title'),
|
||||||
DISCONNECTED = 0,
|
DISCONNECTED = 0,
|
||||||
CONNECTING = 1,
|
CONNECTING = 1,
|
||||||
CONNECTED = 2,
|
CONNECTED = 2,
|
||||||
|
@ -253,6 +255,7 @@ jQuery(function($){
|
||||||
term.open(terminal, true);
|
term.open(terminal, true);
|
||||||
term.toggleFullscreen(true);
|
term.toggleFullscreen(true);
|
||||||
state = CONNECTED;
|
state = CONNECTED;
|
||||||
|
title_element.text = title_text;
|
||||||
};
|
};
|
||||||
|
|
||||||
sock.onmessage = function(msg) {
|
sock.onmessage = function(msg) {
|
||||||
|
@ -272,6 +275,8 @@ jQuery(function($){
|
||||||
$('.container').show();
|
$('.container').show();
|
||||||
status.text(e.reason);
|
status.text(e.reason);
|
||||||
state = DISCONNECTED;
|
state = DISCONNECTED;
|
||||||
|
title_text = 'WebSSH';
|
||||||
|
title_element.text = title_text;
|
||||||
};
|
};
|
||||||
|
|
||||||
$(window).resize(function(){
|
$(window).resize(function(){
|
||||||
|
@ -312,6 +317,7 @@ jQuery(function($){
|
||||||
});
|
});
|
||||||
|
|
||||||
state = CONNECTING;
|
state = CONNECTING;
|
||||||
|
title_text = username + '@' + hostname + ':' + port;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hostname || !port || !username) {
|
if (!hostname || !port || !username) {
|
||||||
|
@ -400,6 +406,7 @@ jQuery(function($){
|
||||||
});
|
});
|
||||||
|
|
||||||
state = CONNECTING;
|
state = CONNECTING;
|
||||||
|
title_text = username + '@' + hostname + ':' + port;
|
||||||
}
|
}
|
||||||
|
|
||||||
wssh.connect = function(opts) {
|
wssh.connect = function(opts) {
|
||||||
|
|
Loading…
Reference in New Issue