feat: update

parent b4f28ca7
......@@ -9,13 +9,13 @@
import {Component, OnInit} from '@angular/core';
import {Logger} from 'angular2-logger/core';
import {AppService, HttpService} from '../../app.service';
import {SearchComponent} from '../search/search.component';
import {DataStore} from '../../globals';
import {version} from '../../../environments/environment';
import * as jQuery from 'jquery/dist/jquery.min.js';
import * as layer from 'layui-layer/src/layer.js';
import * as UUID from 'uuid-js/lib/uuid.js';
import {ElementServerMenuComponent} from '../../elements/server-menu/server-menu.component';
import {NavList, View} from '../control/control.component';
......@@ -119,9 +119,9 @@ export class CleftbarComponent implements OnInit {
Connect(host) {
// console.log(host);
let user: any;
let options = '';
const that = this;
if (host.system_users_granted.length > 1) {
let options = '';
user = this.checkPriority(host.system_users_granted);
if (user) {
this.login(host, user);
......@@ -162,8 +162,8 @@ export class CleftbarComponent implements OnInit {
}
login(host, user) {
const id = NavList.List.length - 1;
if (user) {
const id = NavList.List.length - 1;
NavList.List[id].nick = host.hostname;
NavList.List[id].connected = true;
NavList.List[id].edit = false;
......
div, app-element-term, app-element-guacamole {
height: 100%;
}
div {
display: none;
}
......
<app-controlnav></app-controlnav>
<!--<app-ssh></app-ssh>-->
<!--<app-rdp></app-rdp>-->
<div *ngFor="let m of NavList.List;let i=index"
[ngClass]="{'active':i==NavList.Active}"
>
<app-element-term [host]="m.host"
[userid]="m.user.id"
[index]="i"
[ngClass]="{'active':i==NavList.Active}"
*ngIf="m.type=='ssh'">
</app-element-term>
<app-element-guacamole [host]="m.host"
[userid]="m.user.id"
[index]="i"
[ngClass]="{'active':i==NavList.Active}"
*ngIf="m.type=='rdp'">
</app-element-guacamole>
......
......@@ -65,7 +65,6 @@ export class ControlComponent implements OnInit {
}
static TerminalDisconnect(id) {
console.log(id);
if (NavList.List[id].connected) {
NavList.List[id].connected = false;
NavList.List[id].Term.write('\r\n\x1b[31mBye Bye!\x1b[m\r\n');
......@@ -90,4 +89,7 @@ export class ControlComponent implements OnInit {
ngOnInit() {
}
// trackByFn(index: number, item: View) {
// return item.id;
// }
}
......@@ -42,12 +42,8 @@ export class ControlnavComponent implements OnInit {
NavList.List[index].hide = false;
NavList.Active = index;
if (NavList.List[index].type === 'ssh') {
jQuery('app-ssh').show();
jQuery('app-rdp').hide();
NavList.List[index].Term.focus();
} else if (NavList.List[index].type === 'rdp') {
jQuery('app-ssh').hide();
jQuery('app-rdp').show();
}
}
......
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