fix: windows focus

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