Unverified Commit 79d8cb2a authored by BaiJiangJie's avatar BaiJiangJie Committed by GitHub

Merge pull request #70 from jumpserver/dev

Dev
parents 569ed60b 82a1f7d4
...@@ -59,5 +59,6 @@ ...@@ -59,5 +59,6 @@
"select a solution": "选择分辨率", "select a solution": "选择分辨率",
"set font": "设置字体", "set font": "设置字体",
"font": "字体", "font": "字体",
"font size": "字体大小" "font size": "字体大小",
"full screen": "全屏显示"
} }
...@@ -59,5 +59,6 @@ ...@@ -59,5 +59,6 @@
"select a solution": "选择分辨率", "select a solution": "选择分辨率",
"set font": "设置字体", "set font": "设置字体",
"font": "字体", "font": "字体",
"font size": "字体大小" "font size": "字体大小",
"full screen": "全屏显示"
} }
...@@ -59,5 +59,6 @@ ...@@ -59,5 +59,6 @@
"select a solution": "选择分辨率", "select a solution": "选择分辨率",
"set font": "设置字体", "set font": "设置字体",
"font": "字体", "font": "字体",
"font size": "字体大小" "font size": "字体大小",
"full screen": "全屏显示"
} }
...@@ -66,6 +66,11 @@ export class ElementNavComponent implements OnInit { ...@@ -66,6 +66,11 @@ export class ElementNavComponent implements OnInit {
// this._appService.copy(); // this._appService.copy();
break; break;
} }
case 'FullScreen': {
document.getElementsByClassName('window active ')[0].requestFullscreen();
window.dispatchEvent(new Event('resize'));
break;
}
case'Disconnect': { case'Disconnect': {
if (!confirm('断开当前连接? (RDP暂不支持)')) { if (!confirm('断开当前连接? (RDP暂不支持)')) {
break; break;
...@@ -264,6 +269,11 @@ export class ElementNavComponent implements OnInit { ...@@ -264,6 +269,11 @@ export class ElementNavComponent implements OnInit {
'href': '', 'href': '',
'name': 'Share session (read/write)', 'name': 'Share session (read/write)',
'disable': true 'disable': true
},
{
'id': 'FullScreen',
'click': 'FullScreen',
'name': 'Full Screen'
} }
] ]
}, { }, {
......
...@@ -46,18 +46,26 @@ export class ElementTermComponent implements OnInit, AfterViewInit { ...@@ -46,18 +46,26 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
} }
getWinSize() { getWinSize() {
const activeEle = $('#winContainer'); let availableHeight = 0;
const elementStyle = window.getComputedStyle(this.term.element); let availableWidth = 0;
const elementPadding = { if (document.fullscreenElement) {
top: parseInt(elementStyle.getPropertyValue('padding-top'), 10), availableWidth = document.body.clientWidth - 10;
bottom: parseInt(elementStyle.getPropertyValue('padding-bottom'), 10), availableHeight = document.body.clientHeight;
right: parseInt(elementStyle.getPropertyValue('padding-right'), 10), } else {
left: parseInt(elementStyle.getPropertyValue('padding-left'), 10) const activeEle = $('#winContainer');
}; const elementStyle = window.getComputedStyle(this.term.element);
const elementPaddingVer = elementPadding.top + elementPadding.bottom; const elementPadding = {
const elementPaddingHor = elementPadding.right + elementPadding.left; top: parseInt(elementStyle.getPropertyValue('padding-top'), 10),
const availableHeight = activeEle.height() - elementPaddingVer; bottom: parseInt(elementStyle.getPropertyValue('padding-bottom'), 10),
const availableWidth = activeEle.width() - elementPaddingHor - (<any>this.term).viewport.scrollBarWidth; right: parseInt(elementStyle.getPropertyValue('padding-right'), 10),
left: parseInt(elementStyle.getPropertyValue('padding-left'), 10)
};
const elementPaddingVer = elementPadding.top + elementPadding.bottom;
const elementPaddingHor = elementPadding.right + elementPadding.left;
availableHeight = activeEle.height() - elementPaddingVer;
availableWidth = activeEle.width() - elementPaddingHor - (<any>this.term).viewport.scrollBarWidth;
}
const geometry = [ const geometry = [
Math.floor(availableWidth / (<any>this.term).renderer.dimensions.actualCellWidth) - 1, Math.floor(availableWidth / (<any>this.term).renderer.dimensions.actualCellWidth) - 1,
Math.floor(availableHeight / (<any>this.term).renderer.dimensions.actualCellHeight) - 1 Math.floor(availableHeight / (<any>this.term).renderer.dimensions.actualCellHeight) - 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