publish

parent e439b6f7
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {Logger} from 'angular2-logger/core'; import {Logger} from 'angular2-logger/core';
import {AppService, HttpService} from '../../app.service'; import {AppService, HttpService} from '../../app.service';
import {SearchComponent} from '../search/search.component'; import {SearchComponent} from '../search/search.component';
import {DataStore} from '../../globals'; import {DataStore} from '../../globals';
import {version} from '../../../environments/environment'; import {version} from '../../../environments/environment';
import * as jQuery from 'jquery/dist/jquery.min.js'; import * as jQuery from 'jquery/dist/jquery.min.js';
import * as layer from 'layui-layer/src/layer.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 {ElementServerMenuComponent} from '../../elements/server-menu/server-menu.component';
import {NavList, View} from '../control/control.component'; import {NavList, View} from '../control/control.component';
...@@ -119,9 +119,9 @@ export class CleftbarComponent implements OnInit { ...@@ -119,9 +119,9 @@ export class CleftbarComponent implements OnInit {
Connect(host) { Connect(host) {
// console.log(host); // console.log(host);
let user: any; let user: any;
let options = '';
const that = this; const that = this;
if (host.system_users_granted.length > 1) { if (host.system_users_granted.length > 1) {
let options = '';
user = this.checkPriority(host.system_users_granted); user = this.checkPriority(host.system_users_granted);
if (user) { if (user) {
this.login(host, user); this.login(host, user);
...@@ -162,8 +162,8 @@ export class CleftbarComponent implements OnInit { ...@@ -162,8 +162,8 @@ export class CleftbarComponent implements OnInit {
} }
login(host, user) { login(host, user) {
const id = NavList.List.length - 1;
if (user) { if (user) {
const id = NavList.List.length - 1;
NavList.List[id].nick = host.hostname; NavList.List[id].nick = host.hostname;
NavList.List[id].connected = true; NavList.List[id].connected = true;
NavList.List[id].edit = false; NavList.List[id].edit = false;
......
app-element-term, div { div, app-element-term, app-element-guacamole {
height: 100%; height: 100%;
}
div {
display: none; display: none;
} }
......
<app-controlnav></app-controlnav> <app-controlnav></app-controlnav>
<!--<app-ssh></app-ssh>-->
<!--<app-rdp></app-rdp>-->
<div *ngFor="let m of NavList.List;let i=index" <div *ngFor="let m of NavList.List;let i=index"
[ngClass]="{'active':i==NavList.Active}" [ngClass]="{'active':i==NavList.Active}"
> >
<app-element-term [host]="m.host" <app-element-term [host]="m.host"
[userid]="m.user.id" [userid]="m.user.id"
[index]="i" [index]="i"
[ngClass]="{'active':i==NavList.Active}"
*ngIf="m.type=='ssh'"> *ngIf="m.type=='ssh'">
</app-element-term> </app-element-term>
<app-element-iframe [host]="m.host"
[userid]="m.user.id"
[index]="i"
*ngIf="m.type=='rdp'">
</app-element-iframe>
</div> </div>
...@@ -65,7 +65,6 @@ export class ControlComponent implements OnInit { ...@@ -65,7 +65,6 @@ export class ControlComponent implements OnInit {
} }
static TerminalDisconnect(id) { static TerminalDisconnect(id) {
console.log(id);
if (NavList.List[id].connected) { if (NavList.List[id].connected) {
NavList.List[id].connected = false; NavList.List[id].connected = false;
NavList.List[id].Term.write('\r\n\x1b[31mBye Bye!\x1b[m\r\n'); NavList.List[id].Term.write('\r\n\x1b[31mBye Bye!\x1b[m\r\n');
...@@ -90,4 +89,7 @@ export class ControlComponent implements OnInit { ...@@ -90,4 +89,7 @@ export class ControlComponent implements OnInit {
ngOnInit() { ngOnInit() {
} }
// trackByFn(index: number, item: View) {
// return item.id;
// }
} }
...@@ -81,3 +81,19 @@ ...@@ -81,3 +81,19 @@
padding: 5px 20px 4px 15px; padding: 5px 20px 4px 15px;
height: 18px; height: 18px;
} }
/*
* scrollbar
*/
.tabs::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
background-color: #F5F5F5;
}
.tabs::-webkit-scrollbar {
height: 1px;
}
.tabs::-webkit-scrollbar-thumb {
background-color: #19aa8d;
}
...@@ -42,12 +42,8 @@ export class ControlnavComponent implements OnInit { ...@@ -42,12 +42,8 @@ export class ControlnavComponent implements OnInit {
NavList.List[index].hide = false; NavList.List[index].hide = false;
NavList.Active = index; NavList.Active = index;
if (NavList.List[index].type === 'ssh') { if (NavList.List[index].type === 'ssh') {
jQuery('app-ssh').show();
jQuery('app-rdp').hide();
NavList.List[index].Term.focus(); NavList.List[index].Term.focus();
} else if (NavList.List[index].type === 'rdp') { } else if (NavList.List[index].type === 'rdp') {
jQuery('app-ssh').hide();
jQuery('app-rdp').show();
} }
} }
......
...@@ -27,7 +27,7 @@ import {LoginComponent} from './BasicPage/login/login.component'; ...@@ -27,7 +27,7 @@ import {LoginComponent} from './BasicPage/login/login.component';
import {ElementPopupComponent} from './elements/popup/popup.component'; import {ElementPopupComponent} from './elements/popup/popup.component';
import {ElementRdpComponent} from './elements/rdp/rdp.component'; import {ElementRdpComponent} from './elements/rdp/rdp.component';
import {ElementServerMenuComponent} from './elements/server-menu/server-menu.component'; import {ElementServerMenuComponent} from './elements/server-menu/server-menu.component';
import {ElementGuacamoleComponent} from './elements/guacamole/guacamole.component'; import {ElementIframeComponent} from './elements/iframe/iframe.component';
// pages // pages
import {IleftbarComponent} from './IndexPage/ileftbar/ileftbar.component'; import {IleftbarComponent} from './IndexPage/ileftbar/ileftbar.component';
import {SearchComponent, SearchFilter} from './ControlPage/search/search.component'; import {SearchComponent, SearchFilter} from './ControlPage/search/search.component';
...@@ -63,7 +63,7 @@ import {WindowsComponent} from './monitor-page/windows/windows.component'; ...@@ -63,7 +63,7 @@ import {WindowsComponent} from './monitor-page/windows/windows.component';
ElementInteractiveComponent, ElementInteractiveComponent,
ElementRdpComponent, ElementRdpComponent,
ElementServerMenuComponent, ElementServerMenuComponent,
ElementGuacamoleComponent, ElementIframeComponent,
LoginComponent, LoginComponent,
SearchComponent, SearchComponent,
SearchFilter, SearchFilter,
......
<div>
<iframe src="{{target}}"></iframe>
</div>
import {Component, Input, OnInit} from '@angular/core';
@Component({
selector: 'app-element-guacamole',
templateUrl: './guacamole.component.html',
styleUrls: ['./guacamole.component.scss']
})
export class ElementGuacamoleComponent implements OnInit {
@Input() target: string;
constructor() {
}
ngOnInit() {
this.target = '/guacamole/?asset_id=' + '&system_user_id=' + '';
}
}
<iframe [src]="trust(target)"></iframe>
iframe {
width: 100%;
height: 100%;
border: none;
background-color: white;
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ElementGuacamoleComponent } from './guacamole.component'; import { ElementIframeComponent } from './iframe.component';
describe('ElementGuacamoleComponent', () => { describe('ElementIframeComponent', () => {
let component: ElementGuacamoleComponent; let component: ElementIframeComponent;
let fixture: ComponentFixture<ElementGuacamoleComponent>; let fixture: ComponentFixture<ElementIframeComponent>;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [ ElementGuacamoleComponent ] declarations: [ ElementIframeComponent ]
}) })
.compileComponents(); .compileComponents();
})); }));
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(ElementGuacamoleComponent); fixture = TestBed.createComponent(ElementIframeComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });
......
import {Component, Input, OnInit} from '@angular/core';
import {DomSanitizer} from '@angular/platform-browser';
import {NavList} from '../../ControlPage/control/control.component';
@Component({
selector: 'app-element-iframe',
templateUrl: './iframe.component.html',
styleUrls: ['./iframe.component.scss']
})
export class ElementIframeComponent implements OnInit {
@Input() host: any;
@Input() userid: any;
@Input() index: number;
target: string;
constructor(private sanitizer: DomSanitizer) {
}
ngOnInit() {
this.target = 'http://ilz.me/';
}
trust(url) {
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
}
Disconnect() {
NavList.List[this.index].connected = false;
}
}
#!/bin/bash
set -ex
npm run-script build
rm -fr luna*
mv dist luna
tar czf luna.tar.gz luna
md5 luna.tar.gz
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