Commit edb9cf10 authored by zheng liu's avatar zheng liu

Merged in test (pull request #31)

Test
Approved-by: 's avatarzheng liu <liuzheng712@gmail.com>
parents bc1558c6 e3653f1d
......@@ -23,7 +23,6 @@
"../node_modules/layui-layer/dist/theme/default/layer.css",
"../node_modules/animate.css/animate.min.css",
"assets/inspinia/style.scss",
"../node_modules/xterm/dist/xterm.css",
"sass/style.scss",
"styles.css"
],
......@@ -33,7 +32,7 @@
"../node_modules/jquery-sparkline/jquery.sparkline.js",
"../node_modules/tether/dist/js/tether.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js",
"../node_modules/xterm/dist/xterm.js",
"../node_modules/term.js/src/term.js",
"../node_modules/layui-layer/dist/layer.js",
"../node_modules/socket.io-client/dist/socket.io.js",
"./assets/js/mstsc.js",
......
Subproject commit 9e8f949f64479cbfc4551dd81a20897de6121da5
......@@ -34,7 +34,7 @@ label {
overflow: hidden;
}
.filetree > li input:checked ~ ul , .filetree > li ul.insearch{
.filetree > li input:checked ~ ul, .filetree > li ul.insearch {
height: auto;
}
......@@ -67,7 +67,7 @@ label {
background: #2f2a2a;
font-size: 9pt;
border-top-width: 1px;
left: 0;
left: 0px;
padding: 1px 20px 0 20px;
position: absolute;
}
......
......@@ -7,8 +7,8 @@ div, term-leftbar, term-body {
div {
background-color: black;
margin: 0;
top:30px;
position: absolute;
padding-top: 30px;
position: initial;
}
app-cleftbar {
......
import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core';
import {ElementRef, Renderer2} from '@angular/core';
import {ElementRef} from '@angular/core';
import {term} from '../../globals';
import {Terminal} from '../../globals';
import * as jQuery from 'jquery/dist/jquery.min.js';
@Component({
selector: 'app-element-term',
......@@ -12,7 +12,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
@ViewChild('term') el: ElementRef;
constructor(private rd: Renderer2) {
constructor() {
}
ngOnInit() {
......@@ -20,30 +20,29 @@ 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.col = 90;
term.row = 90;
term.term = Terminal({
cols: term.col,
rows: term.row,
useStyle: true,
screenKeys: true,
});
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;
console.log(term);
// term.term = Terminal({
// cols: term.col,
// rows: term.row,
// useStyle: true,
// screenKeys: true,
// });
term.term.open(this.el.nativeElement, true);
// const that = this;
// window.onresize = function () {
// term.col = Math.floor(jQuery(that.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3;
// term.row = Math.floor(jQuery(that.el.nativeElement).height() / jQuery('#liuzheng').height()) - 5;
//
// if (term.col < 80) {
// term.col = 80;
// }
// if (term.row < 24) {
// term.row = 24;
// }
// term.term.resize(term.col, term.row);
// };
const that = this;
window.onresize = function () {
term.col = Math.floor(jQuery(that.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3;
term.row = Math.floor(jQuery(that.el.nativeElement).height() / jQuery('#liuzheng').height()) - 5;
if (term.col < 80) {
term.col = 80;
}
if (term.row < 24) {
term.row = 24;
}
term.term.resize(term.col, term.row);
};
}
}
......@@ -11,7 +11,12 @@ export let term: {
col: number;
row: number;
} = {
term: Terminal({}),
term: Terminal({
cols: 80,
rows: 24,
useStyle: true,
screenKeys: true,
}),
col: 80,
row: 24,
};
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>JumpServer</title>
<title>Jumpserver</title>
<base href="/luna">
<meta name="viewport" content="width=device-width, initial-scale=1">
......
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