diff --git a/spug_web/src/pages/ssh/Terminal.js b/spug_web/src/pages/ssh/Terminal.js index 64aee49..539e349 100644 --- a/spug_web/src/pages/ssh/Terminal.js +++ b/spug_web/src/pages/ssh/Terminal.js @@ -20,6 +20,16 @@ function WebSSH(props) { term.loadAddon(fitPlugin); term.setOption('fontFamily', 'Source Code Pro, Courier New, Courier, Monaco, monospace, PingFang SC, Microsoft YaHei') term.setOption('theme', {background: '#2b2b2b', foreground: '#A9B7C6'}) + term.attachCustomKeyEventHandler((arg) => { + if (arg.code === 'PageUp' && arg.type === 'keydown') { + term.scrollPages(-1) + return false + } else if (arg.code === 'PageDown' && arg.type === 'keydown') { + term.scrollPages(1) + return false + } + return true + }) term.open(container.current); term.write('WebSocket connecting ... '); const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; diff --git a/spug_web/src/pages/ssh/index.js b/spug_web/src/pages/ssh/index.js index 91f7ac4..cb92aaa 100644 --- a/spug_web/src/pages/ssh/index.js +++ b/spug_web/src/pages/ssh/index.js @@ -213,7 +213,6 @@ function WebSSH(props) { '/____// .___/ \\__,_/ \\__, / |__/|__/ \\___//_.___/ \\__/ \\___//_/ /_/ /_/ /_//_//_/ /_/ \\__,_//_/ \n' + ' /_/ /____/ \n' - console.log(sshMode) return hasPermission('host.console.view|host.console.list') ? (
posX = 0} onMouseMove={handleMouseMove}>