Skip to content

Commit

Permalink
Merge pull request #257 from jumpserver/dev
Browse files Browse the repository at this point in the history
Merge dev to master
  • Loading branch information
BaiJiangJie authored Sep 8, 2020
2 parents 731fe43 + ffae5be commit 5a7e194
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 224 deletions.
5 changes: 2 additions & 3 deletions src/app/elements/content-window/content-window.component.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<div class="window" [ngClass]="{'active':view.active}" style="height: 100%">
<elements-ssh-term
[view]="view"
[host]="view.host"
[sysUser]="view.user"
[token]="view.token"
[sysUser]="view.user"
[host]="view.host"
[shareroomId] = "view.shareroomId"

*ngIf="view.type=='ssh' || view.type=='database'|| view.type=='k8s'"
>
</elements-ssh-term>
Expand Down
8 changes: 4 additions & 4 deletions src/app/elements/content/content.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
</tr>
</ng-template>

<tr class="basicContext__item basicContext__item--separator"></tr>
<tr class="basicContext__item ">
<td class="basicContext__data" (click)="rDisconnect()"><span class="basicContext__icon fa fa-pause-circle"></span> {{ "Disconnect"| translate }} </td>
</tr>
<!-- <tr class="basicContext__item basicContext__item&#45;&#45;separator"></tr>-->
<!-- <tr class="basicContext__item ">-->
<!-- <td class="basicContext__data" (click)="rDisconnect()"><span class="basicContext__icon fa fa-pause-circle"></span> {{ "Disconnect"| translate }} </td>-->
<!-- </tr>-->
</tbody>
</table>
</div>
25 changes: 3 additions & 22 deletions src/app/elements/content/content.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export class ElementContentComponent implements OnInit {
if (this.viewList[i].type !== 'ssh' || this.viewList[i].connected !== true) {
continue;
}
const d = {'data': cmd, 'room': this.viewList[i].room};
const d = {'data': cmd};

this.viewList[i].termComp.ws.emit('data', d);
this.viewList[i].termComp.sendCommand(d);
}

this.batchCommand = '';
Expand Down Expand Up @@ -162,7 +162,7 @@ export class ElementContentComponent implements OnInit {
const id = this.rIdx + 1;
const host = this.viewList[this.rIdx].host;
const user = this.viewList[this.rIdx].user;
v.nick = host.hostname;
v.nick = host.hostname || host.title;
v.connected = true;
v.editable = false;
v.closed = false;
Expand All @@ -175,24 +175,5 @@ export class ElementContentComponent implements OnInit {
rReconnect() {
this.viewList[this.rIdx].termComp.reconnect();
}
rDisconnect() {
if (!confirm('断开当前连接? (RDP暂不支持)')) {
return;
}
switch (this.viewList[this.rIdx].type) {
case 'ssh': {
this.viewList[this.rIdx].termComp.logout();
break;
}
case 'rdp': {
// statements
break;
}
default: {
// statements;
break;
}
}
}

}
3 changes: 0 additions & 3 deletions src/app/elements/guacamole/guacamole.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ export class ElementGuacamoleComponent implements OnInit {
const nowTime = now.getTime() / 1000;
this._http.getGuacamoleToken(this.token, this.token).subscribe(
data => {
console.log(data);
// /guacamole/client will redirect to http://guacamole/#/client
DataStore.guacamoleToken = data['authToken'];
DataStore.guacamoleTokenTime = nowTime;
action = this._http.guacamoleTokenAddAsset(this.token).subscribe(
data2 => {
console.log(data2);
const base = data2['result'];
this.target = document.location.origin + '/guacamole/#/client/' + base + '?token=' + DataStore.guacamoleToken;
setTimeout(() => this.setIdleTimeout(), 500);
Expand Down Expand Up @@ -118,7 +116,6 @@ export class ElementGuacamoleComponent implements OnInit {
this.resetIdleTimeout();
this.iframeWindow.onclick = () => this.resetIdleTimeout();
this.iframeWindow.onkeyup = () => this.resetIdleTimeout();
console.log(this.iframeWindow);
}

resetIdleTimeout() {
Expand Down
2 changes: 1 addition & 1 deletion src/app/elements/nav/nav.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export class ElementNavComponent implements OnInit {
const dialog = this._dialog.open(
ElementSettingComponent,
{
height: '370px',
height: '410px',
width: '400px',
});
dialog.afterClosed().subscribe(result => {
Expand Down
7 changes: 7 additions & 0 deletions src/app/elements/setting/setting.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ <h1 mat-dialog-title>{{"Setting"| translate}}</h1>
</mat-select>
</mat-form-field>

<mat-form-field>
<mat-select [(value)]="setting.quickPaste"
placeholder="{{'Right mouse quick paste'| translate }}" >
<mat-option *ngFor="let s of boolChoices" value="{{s.value}}">{{s.name| translate}}</mat-option>
</mat-select>
</mat-form-field>

<div style="float: right" [style.padding-top]="globalSetting.WINDOWS_SKIP_ALL_MANUAL_PASSWORD ? '20px' : '0'">
<button mat-raised-button (click)="onNoClick()">{{"Cancel"| translate}}</button>
<button mat-raised-button color="primary" (click)="onSubmit()">{{"Confirm"| translate}}</button>
Expand Down
3 changes: 2 additions & 1 deletion src/app/elements/ssh-term/ssh-term.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<elements-term (winSizeChangeTrigger)="changeWinSize($event)" (contextmenu)="contextMenu($event)" [term]="term"></elements-term>
<!--<elements-term (winSizeChangeTrigger)="changeWinSize($event)" (contextmenu)="contextMenu($event)" [term]="term"></elements-term>-->
<iframe #terminal [src]="target" *ngIf="target" width="100%" height="100%" [id]="terminalID"></iframe>
3 changes: 3 additions & 0 deletions src/app/elements/ssh-term/ssh-term.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
iframe{
border-width: 0;
}
Loading

0 comments on commit 5a7e194

Please sign in to comment.