Commit 6a037578 authored by ibuler's avatar ibuler

[Update] Merge with dev

parents 48dee5e8 70393df3
...@@ -39,8 +39,9 @@ li span { ...@@ -39,8 +39,9 @@ li span {
padding-right: 14px; padding-right: 14px;
line-height: 26px; line-height: 26px;
cursor: default; cursor: default;
width: 115px; /*width: 145px;*/
height: 21px; height: 26px;
display: block;
} }
li a.close { li a.close {
...@@ -63,17 +64,17 @@ li.active span { ...@@ -63,17 +64,17 @@ li.active span {
padding-left: 12px; padding-left: 12px;
line-height: 26px; line-height: 26px;
color: white; color: white;
height: 18px; height: 26px;
} }
li input { li input {
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;
font-size: 13px; font-size: 13px;
width: 115px; width: 120px;
border: none; border: none;
background-color: inherit; background-color: inherit;
color: white; color: white;
padding: 5px 20px 4px 15px; padding: 5px 20px 4px 15px;
height: 18px; height: 26px;
} }
...@@ -99,3 +99,12 @@ ...@@ -99,3 +99,12 @@
cursor: default; cursor: default;
color: #c5babc; color: #c5babc;
} }
.nav ul li.disconnected {
background-color: darkgray;
}
.nav ul li.active {
box-sizing: border-box;
border-bottom: 3px solid #19aa8d !important;
}
...@@ -92,6 +92,14 @@ export class ElementNavComponent implements OnInit { ...@@ -92,6 +92,14 @@ export class ElementNavComponent implements OnInit {
} }
case'Disconnect': { case'Disconnect': {
if (!confirm('断开当前连接?')) { if (!confirm('断开当前连接?')) {
return
}
}
case 'Reconnect': {
break;
}
case 'Disconnect': {
if (!confirm('断开当前连接? (RDP暂不支持)')) {
break; break;
} }
this._navSvc.disconnectConnection(); this._navSvc.disconnectConnection();
...@@ -220,6 +228,11 @@ export class ElementNavComponent implements OnInit { ...@@ -220,6 +228,11 @@ export class ElementNavComponent implements OnInit {
'click': 'DisconnectAll', 'click': 'DisconnectAll',
'name': 'Disconnect all' 'name': 'Disconnect all'
}, },
{
'id': 'Reconnect',
'click': 'Reconnect',
'name': 'Reconnect'
},
] ]
}, { }, {
'id': 'FileManager', 'id': 'FileManager',
......
...@@ -3,7 +3,7 @@ import {Terminal} from 'xterm'; ...@@ -3,7 +3,7 @@ import {Terminal} from 'xterm';
import {View} from '../content/model'; import {View} from '../content/model';
import {LogService, UUIDService} from '../../app.service'; import {LogService, UUIDService} from '../../app.service';
import {Socket} from '../../utils/socket'; import {Socket} from '../../utils/socket';
import {getWsSocket} from '../../globals'; import {getWsSocket, translate} from '../../globals';
@Component({ @Component({
...@@ -55,7 +55,17 @@ export class ElementSshTermComponent implements OnInit, OnDestroy { ...@@ -55,7 +55,17 @@ export class ElementSshTermComponent implements OnInit, OnDestroy {
} }
} }
connectHost() { reconnect() {
if (this.view.connected === true) {
if (!confirm(translate('Are you sure to reconnect it?(RDP not support)'))) {
return;
}
}
this.secret = this._uuid.gen();
this.emitHostAndTokenData();
}
emitHostAndTokenData() {
if (this.host) { if (this.host) {
const data = { const data = {
uuid: this.host.id, uuid: this.host.id,
...@@ -73,6 +83,10 @@ export class ElementSshTermComponent implements OnInit, OnDestroy { ...@@ -73,6 +83,10 @@ export class ElementSshTermComponent implements OnInit, OnDestroy {
this._logger.debug('On token event trigger'); this._logger.debug('On token event trigger');
this.ws.emit('token', data); this.ws.emit('token', data);
} }
}
connectHost() {
this.emitHostAndTokenData();
this.term.on('data', data => { this.term.on('data', data => {
const d = {'data': data, 'room': this.roomID}; const d = {'data': data, 'room': this.roomID};
...@@ -103,6 +117,7 @@ export class ElementSshTermComponent implements OnInit, OnDestroy { ...@@ -103,6 +117,7 @@ export class ElementSshTermComponent implements OnInit, OnDestroy {
this._logger.debug('On room', data); this._logger.debug('On room', data);
this.roomID = data.room; this.roomID = data.room;
this.view.room = data.room; this.view.room = data.room;
this.view.connected = true;
} }
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment