mirror of https://github.com/openspug/spug
A web终端支持PageUp/PageDown翻页 #485
parent
294e7e2bc9
commit
82696c8770
|
@ -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:';
|
||||
|
|
|
@ -213,7 +213,6 @@ function WebSSH(props) {
|
|||
'/____// .___/ \\__,_/ \\__, / |__/|__/ \\___//_.___/ \\__/ \\___//_/ /_/ /_/ /_//_//_/ /_/ \\__,_//_/ \n' +
|
||||
' /_/ /____/ \n'
|
||||
|
||||
console.log(sshMode)
|
||||
return hasPermission('host.console.view|host.console.list') ? (
|
||||
<div className={styles.container} onMouseUp={() => posX = 0} onMouseMove={handleMouseMove}>
|
||||
<div className={styles.sider} style={{width}}>
|
||||
|
|
Loading…
Reference in New Issue