Commit a43771f8 authored by ibuler's avatar ibuler

[Update] 修改ssh term

parent f3271909
This diff is collapsed.
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
"material-design-icons": "^3.0.1", "material-design-icons": "^3.0.1",
"materialize-css": "^0.100.2", "materialize-css": "^0.100.2",
"metismenu": "^2.7.9", "metismenu": "^2.7.9",
"mstsc.js": "^0.2.4",
"ng2-charts": "^1.5.0", "ng2-charts": "^1.5.0",
"ngx-bootstrap": "^1.6.6", "ngx-bootstrap": "^1.6.6",
"ngx-cookie-service": "^1.0.10", "ngx-cookie-service": "^1.0.10",
...@@ -71,7 +70,7 @@ ...@@ -71,7 +70,7 @@
"tslib": "^1.9.0", "tslib": "^1.9.0",
"utf-8-validate": "^5.0.2", "utf-8-validate": "^5.0.2",
"uuid-js": "^0.7.5", "uuid-js": "^0.7.5",
"xterm": "^3.11.0", "xterm": "^3.3.0",
"zone.js": "0.8.20" "zone.js": "0.8.20"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -27,7 +27,7 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit { ...@@ -27,7 +27,7 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit {
ngOnInit() { ngOnInit() {
this.secret = this._uuid.gen(); this.secret = this._uuid.gen();
this.term = new Terminal({ this.term = new Terminal({
fontFamily: '"Monaco", "Consolas", "monospace"', fontFamily: '"Consolas", "monospace"',
fontSize: 16, fontSize: 16,
rightClickSelectsWord: true, rightClickSelectsWord: true,
theme: { theme: {
......
...@@ -57,10 +57,10 @@ export class ElementTermComponent implements OnInit, AfterViewInit { ...@@ -57,10 +57,10 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
const elementPaddingVer = elementPadding.top + elementPadding.bottom; const elementPaddingVer = elementPadding.top + elementPadding.bottom;
const elementPaddingHor = elementPadding.right + elementPadding.left; const elementPaddingHor = elementPadding.right + elementPadding.left;
const availableHeight = activeEle.height() - elementPaddingVer; const availableHeight = activeEle.height() - elementPaddingVer;
const availableWidth = activeEle.width() - elementPaddingHor - (<any>this.term)._core.viewport.scrollBarWidth; const availableWidth = activeEle.width() - elementPaddingHor - (<any>this.term).viewport.scrollBarWidth;
const geometry = [ const geometry = [
Math.floor(availableWidth / (<any>this.term)._core.renderer.dimensions.actualCellWidth) - 1, Math.floor(availableWidth / (<any>this.term).renderer.dimensions.actualCellWidth) - 1,
Math.floor(availableHeight / (<any>this.term)._core.renderer.dimensions.actualCellHeight) - 1 Math.floor(availableHeight / (<any>this.term).renderer.dimensions.actualCellHeight) - 1
]; ];
return geometry; return geometry;
} }
...@@ -70,7 +70,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit { ...@@ -70,7 +70,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
if (isNaN(size[0]) || isNaN(size[1])) { if (isNaN(size[0]) || isNaN(size[1])) {
fit(this.term); fit(this.term);
} else { } else {
(<any>this.term)._core.renderer.clear(); (<any>this.term).renderer.clear();
this.term.resize(size[0], size[1]); this.term.resize(size[0], size[1]);
} }
this.winSizeChangeTrigger.emit([this.term.cols, this.term.rows]); this.winSizeChangeTrigger.emit([this.term.cols, this.term.rows]);
......
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