diff --git a/webadmin/src/theme.scss b/webadmin/src/theme.scss index 3035f60bc..9018f3c3d 100644 --- a/webadmin/src/theme.scss +++ b/webadmin/src/theme.scss @@ -1137,3 +1137,12 @@ footer { } } } + +.contextMenuBackdrop { + display: none; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/webadmin/src/views/debug.html b/webadmin/src/views/debug.html index 5f5f796cd..1db94a174 100644 --- a/webadmin/src/views/debug.html +++ b/webadmin/src/views/debug.html @@ -76,3 +76,11 @@
+ +
+ +
diff --git a/webadmin/src/views/debug.js b/webadmin/src/views/debug.js index 9f4e534b0..0d6652f5f 100644 --- a/webadmin/src/views/debug.js +++ b/webadmin/src/views/debug.js @@ -289,6 +289,43 @@ angular.module('Application').controller('DebugController', ['$scope', '$locatio } }); + // terminal right click handling + $scope.terminalClear = function () { + if (!$scope.terminal) return; + $scope.terminal.clear(); + $scope.terminal.focus(); + }; + + $scope.terminalCopy = function () { + if (!$scope.terminal) return; + + // execCommand('copy') would copy any selection from the page, so do this only if terminal has a selection + if (!$scope.terminal.getSelection()) return; + + document.execCommand('copy'); + $scope.terminal.focus(); + }; + + $('.contextMenuBackdrop').on('click', function (e) { + $('#terminalContextMenu').hide(); + $('.contextMenuBackdrop').hide(); + }); + + $('.logs-and-term-container').on('contextmenu', function (e) { + if (!$scope.terminal) return true; + + e.preventDefault(); + + $('.contextMenuBackdrop').show(); + $('#terminalContextMenu').css({ + display: 'block', + left: e.pageX, + top: e.pageY + }); + + return false; + }); + // setup all the dialog focus handling ['downloadFileModal'].forEach(function (id) { $('#' + id).on('shown.bs.modal', function () {