Unverified Commit d58c38bb authored by liuzheng712's avatar liuzheng712

Merge branch 'dev' of bitbucket.org:jumpserver/luna into dev

parents 527735a2 9bac5c10
......@@ -20,12 +20,10 @@
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"../node_modules/font-awesome/css/font-awesome.css",
"../node_modules/xterm/dist/xterm.css",
"../node_modules/layui-layer/dist/theme/default/layer.css",
"../node_modules/animate.css/animate.min.css",
"assets/inspinia/style.scss",
"sass/style.scss",
"styles.css"
],
"scripts": [
......
......@@ -1075,13 +1075,9 @@
}
},
"bootstrap": {
"version": "4.0.0-alpha.6",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.0.0-alpha.6.tgz",
"integrity": "sha1-T1TdM6wN6sOyhAe8LffsYIhpycg=",
"requires": {
"jquery": "3.2.1",
"tether": "1.4.0"
}
"version": "4.0.0-beta.3",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.0.0-beta.3.tgz",
"integrity": "sha512-/Qe1Q2d1muLEZRX2iCteMQHZBBAm6ZIjJ9FcBYK/xLr05+HvDtBOVBN+Cz7mCNZuy0zr+y5artZHM05W7mIz6g=="
},
"brace-expansion": {
"version": "1.1.8",
......@@ -5311,9 +5307,9 @@
}
},
"is-my-json-valid": {
"version": "2.16.1",
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz",
"integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==",
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz",
"integrity": "sha512-Q2khNw+oBlWuaYvEEHtKSw/pCxD2L5Rc1C+UQme9X6JdRDh7m5D7HkozA0qa3DUkQ6VzCnEm8mVIQPyIRkI5sQ==",
"dev": true,
"requires": {
"generate-function": "2.0.0",
......@@ -6818,6 +6814,19 @@
"lower-case": "1.1.4"
}
},
"node": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/node/-/node-9.3.0.tgz",
"integrity": "sha512-mzd/bye/4HE8QbguOcpk7x38h9+ULo3WesRps8g+C89j/KLJgQs0FBQ2TPHR6SDf1+rWNJ/klaE22FDRpw2ddQ==",
"requires": {
"node-bin-setup": "1.0.6"
}
},
"node-bin-setup": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/node-bin-setup/-/node-bin-setup-1.0.6.tgz",
"integrity": "sha512-uPIxXNis1CRbv1DwqAxkgBk5NFV3s7cMN/Gf556jSw6jBvV7ca4F9lRL/8cALcZecRibeqU+5dFYqFFmzv5a0Q=="
},
"node-dir": {
"version": "0.1.17",
"resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz",
......@@ -6994,7 +7003,7 @@
"requires": {
"chalk": "1.1.3",
"commander": "2.11.0",
"is-my-json-valid": "2.16.1",
"is-my-json-valid": "2.17.1",
"pinkie-promise": "2.0.1"
}
},
......@@ -11045,6 +11054,11 @@
"resolved": "https://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz",
"integrity": "sha1-1rgurZiueeviKOLa9ZAzEeyYLk0="
},
"popper.js": {
"version": "1.12.9",
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.12.9.tgz",
"integrity": "sha1-DfvC3/lsRRuzMu3Pz6r1ZtMx1bM="
},
"portfinder": {
"version": "1.0.13",
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.13.tgz",
......
......@@ -24,7 +24,7 @@
"angular2-logger": "^0.6.0",
"animate.css": "^3.5.2",
"body-parser": "^1.18.2",
"bootstrap": "^4.0.0-alpha.6",
"bootstrap": "^4.0.0-beta.3",
"clipboard": "^1.7.1",
"compass-mixins": "^0.12.10",
"core-js": "^2.4.1",
......@@ -42,8 +42,10 @@
"ng2-charts": "^1.5.0",
"ng2-cookies": "^1.0.12",
"ngx-bootstrap": "^1.6.6",
"node": "^9.3.0",
"npm": "^5.6.0",
"peity": "^3.2.1",
"popper.js": "^1.12.9",
"roboto-fontface": "^0.8.0",
"rxjs": "^5.4.2",
"sass-math": "^1.0.0",
......
......@@ -11,8 +11,8 @@ import {AppService, HttpService} from '../../app.service';
import {NgForm} from '@angular/forms';
import {Router} from '@angular/router';
import {DataStore, User} from '../../globals';
import * as jQuery from 'jquery/dist/jquery.min.js';
declare let jQuery: any;
@Component({
selector: 'app-login',
......
......@@ -16,8 +16,10 @@ import {RdpComponent} from '../control/rdp/rdp.component';
import {SearchComponent} from '../search/search.component';
import {DataStore} from '../../globals';
import * as jQuery from 'jquery/dist/jquery.min.js';
// import * as layer from 'layui-layer/src/layer.js';
declare let layer: any;
declare let jQuery: any;
export class HostGroup {
name: string;
......
......@@ -8,11 +8,10 @@
*/
import {Component, OnInit} from '@angular/core';
import {NavList} from '../control.component'
import {SshComponent} from '../ssh/ssh.component'
import {RdpComponent} from '../rdp/rdp.component'
declare let jQuery: any;
import {NavList} from '../control.component';
import {SshComponent} from '../ssh/ssh.component';
import {RdpComponent} from '../rdp/rdp.component';
import * as jQuery from 'jquery/dist/jquery.min.js';
@Component({
......@@ -24,18 +23,12 @@ export class ControlnavComponent implements OnInit {
setActive = ControlnavComponent.setActive;
NavList = NavList;
constructor() {
}
ngOnInit() {
}
static checkActive(index) {
let len = NavList.List.length;
if (len == 1) {
const len = NavList.List.length;
if (len === 1) {
// 唯一一个
NavList.Active = 0;
} else if (len - 1 == index) {
} else if (len - 1 === index) {
// 删了最后一个
NavList.Active = len - 2;
} else {
......@@ -50,23 +43,30 @@ 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()
if (NavList.List[index].type === 'ssh') {
jQuery('app-ssh').show();
jQuery('app-rdp').hide();
} else if (NavList.List[index].type === 'rdp') {
jQuery("app-ssh").hide();
jQuery("app-rdp").show();
jQuery('app-ssh').hide();
jQuery('app-rdp').show();
}
}
constructor() {
}
ngOnInit() {
}
close(host, index) {
if (host.type === 'rdp') {
RdpComponent.Disconnect(host)
RdpComponent.Disconnect(host);
} else if (host.type === 'ssh') {
SshComponent.TerminalDisconnect(host)
SshComponent.TerminalDisconnect(host);
}
NavList.List.splice(index, 1);
ControlnavComponent.checkActive(index)
ControlnavComponent.checkActive(index);
}
}
......@@ -18,6 +18,18 @@ declare let Mstsc: any;
export class RdpComponent implements OnInit {
NavList = NavList;
static Disconnect(host) {
host.connected = false;
// document.getElementById("templatesrc").remove();
}
static DisconnectAll() {
}
constructor() {
}
......@@ -25,9 +37,9 @@ export class RdpComponent implements OnInit {
}
Connect(host, username) {
let id = NavList.List.length - 1;
const id = NavList.List.length - 1;
let canvas = Mstsc.$("canvas-" + id);
const canvas = Mstsc.$('canvas-' + id);
canvas.style.display = 'inline';
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
......@@ -36,12 +48,12 @@ export class RdpComponent implements OnInit {
NavList.List[id].connected = true;
NavList.List[id].edit = false;
NavList.List[id].closed = false;
NavList.List[id].type = "rdp";
NavList.List[id].type = 'rdp';
NavList.List[id].Rdp = new Rdp;
NavList.List[id].Rdp.token = host.token;
NavList.List[id].Rdp.machine = host.uuid;
NavList.List[id].Rdp.client = Mstsc.client.create(Mstsc.$("canvas-" + id));
NavList.List[id].Rdp.client.connect(host.token, "rdp/socket.io");
NavList.List[id].Rdp.client = Mstsc.client.create(Mstsc.$('canvas-' + id));
NavList.List[id].Rdp.client.connect(host.token, 'rdp/socket.io');
NavList.List.push(new View());
......@@ -54,15 +66,4 @@ export class RdpComponent implements OnInit {
}
static Disconnect(host) {
host.connected = false;
// document.getElementById("templatesrc").remove();
}
static DisconnectAll() {
}
}
......@@ -7,13 +7,12 @@
import {Component, OnInit} from '@angular/core';
import {Logger} from 'angular2-logger/core';
import * as io from 'socket.io-client';
import {Cookie} from 'ng2-cookies/ng2-cookies';
declare let jQuery: any;
declare let Terminal: any;
import {AppService} from '../../../app.service';
import {NavList, View, Term} from '../control.component';
import {Terminal} from '../../../globals';
import * as io from 'socket.io-client';
import * as jQuery from 'jquery/dist/jquery.min.js';
@Component({
selector: 'app-ssh',
......@@ -71,7 +70,7 @@ export class SshComponent implements OnInit {
NavList.List[id].Term = new Term;
NavList.List[id].Term.machine = host.id;
NavList.List[id].Term.socket = socket;
NavList.List[id].Term.term = new Terminal({
NavList.List[id].Term.term = Terminal({
cols: cols,
rows: rows,
useStyle: true,
......
......@@ -14,9 +14,6 @@ import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import {DataStore, User, Browser} from './globals';
declare let jQuery: any;
@Injectable()
export class HttpService {
headers = new Headers();
......
......@@ -14,9 +14,9 @@ import {SshComponent} from '../../ControlPage/control/ssh/ssh.component';
import {RdpComponent} from '../../ControlPage/control/rdp/rdp.component';
import {NavList} from '../../ControlPage/control/control.component';
import {DataStore} from '../../globals';
import * as jQuery from 'jquery/dist/jquery.min.js';
// import * as layer from 'layui-layer/src/layer.js';
declare let layer: any;
declare let jQuery: any;
@Component({
selector: 'app-element-nav',
......
import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core';
import {ElementRef, Renderer2} from '@angular/core';
import {term} from '../../globals';
declare let jQuery: any;
declare let Terminal: any;
import {Terminal} from '../../globals';
import * as jQuery from 'jquery/dist/jquery.min.js';
@Component({
selector: 'app-element-term',
......@@ -24,7 +23,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
ngAfterViewInit() {
term.col = Math.floor(jQuery(this.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3;
term.row = Math.floor(jQuery(this.el.nativeElement).height() / jQuery('#liuzheng').height()) - 5;
term.term = new Terminal({
term.term = Terminal({
cols: term.col,
rows: term.row,
useStyle: true,
......
'use strict';
import * as terminal from 'term.js/src/term.js';
import * as io from 'socket.io-client';
declare let Terminal: any;
export function Terminal(xargs: any) {
return terminal(xargs);
}
export let term: {
term: any;
col: number;
row: number;
} = {
term: Terminal(),
term: Terminal({}),
col: 80,
row: 24,
};
......
......@@ -2,7 +2,7 @@ import {Component, OnInit} from '@angular/core';
import {Monitor, term} from '../../globals';
import * as io from 'socket.io-client';
declare let jQuery: any;
import * as jQuery from 'jquery/dist/jquery.min.js';
@Component({
selector: 'app-monitor-linux',
......
......@@ -27,13 +27,13 @@ export class RdppageComponent implements OnInit {
token = params['token'];
});
let canvas = Mstsc.$("canvas");
const canvas = Mstsc.$('canvas');
canvas.style.display = 'inline';
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
let client = Mstsc.client.create(Mstsc.$("canvas"));
client.connect(token, "socket.io");
const client = Mstsc.client.create(Mstsc.$('canvas'));
client.connect(token, 'socket.io');
}
}
......@@ -2,7 +2,7 @@ import {Component, OnInit} from '@angular/core';
import {Video} from '../../globals';
import {term} from '../../globals';
declare let jQuery: any;
import * as jQuery from 'jquery/dist/jquery.min.js';
@Component({
selector: 'app-json',
......
......@@ -2,9 +2,7 @@ import {Component, OnInit} from '@angular/core';
import {ActivatedRoute, Params} from '@angular/router';
import {DataStore} from '../globals';
import * as io from 'socket.io-client';
declare let jQuery: any;
declare let Terminal: any;
import * as Terminal from 'term.js/src/term.js';
@Component({
selector: 'app-termpage',
......
This diff is collapsed.
This diff is collapsed.
// font-awesome
$fa-font-path: "~font-awesome/fonts";
@import '~font-awesome/scss/font-awesome';
// bootstrap
@import "~bootstrap/scss/bootstrap";
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