fix: windows focus

parent 28767ea6
......@@ -20,6 +20,7 @@ export class Rdp {
machine: string;
token: string;
client: any;
iframe: any;
}
export class View {
......
......@@ -7,7 +7,7 @@
* @author liuzheng <liuzheng712@gmail.com>
*/
import {Component, OnInit} from '@angular/core';
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
import {ControlComponent, NavList} from '../control.component';
import * as jQuery from 'jquery/dist/jquery.min.js';
......@@ -44,6 +44,7 @@ export class ControlnavComponent implements OnInit {
if (NavList.List[index].type === 'ssh') {
NavList.List[index].Term.focus();
} else if (NavList.List[index].type === 'rdp') {
NavList.List[index].Rdp.iframe.focus();
}
} else {
......
<iframe [src]="trust(target)"></iframe>
<iframe #rdp [src]="trust(target)"></iframe>
import {Component, Input, OnInit} from '@angular/core';
import {Component, ElementRef, Input, OnInit, ViewChild} from '@angular/core';
import {CookieService} from 'ngx-cookie-service';
import {HttpService, LogService} from '../../app.service';
import {DataStore, User} from '../../globals';
......@@ -16,6 +16,7 @@ export class ElementGuacamoleComponent implements OnInit {
@Input() userid: any;
@Input() index: number;
target: string;
@ViewChild('rdp') el: ElementRef;
constructor(private sanitizer: DomSanitizer,
private _http: HttpService,
......@@ -45,6 +46,7 @@ export class ElementGuacamoleComponent implements OnInit {
} else {
this.target = this._cookie.get('guacamole');
}
NavList.List[this.index].Rdp.iframe = this.el.nativeElement;
}
trust(url) {
......
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