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