File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
resource/template/dashboard-default Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
{{define "dashboard-default/terminal"}}
2
2
<!DOCTYPE html>
3
3
< html lang ="{{.Conf.Language}} ">
4
+
4
5
< head >
5
6
< meta charset ="UTF-8 ">
6
7
< meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
23
24
background-color : black;
24
25
}
25
26
</ style >
27
+
26
28
< body onresize ="onResize() ">
27
29
< div id ="terminal-container "> </ div >
28
30
< script src ="https://unpkg.com/xterm@5.3.0/lib/xterm.js "> </ script >
29
- < script src ="https://unpkg.com/@xterm/addon-attach@0.11.0/lib/addon-attach.js "> </ script >
30
31
< script src ="https://unpkg.com/@xterm/addon-fit@0.10.0/lib/addon-fit.js "> </ script >
32
+ < script src ="https://unpkg.com/@xterm/addon-web-links@0.11.0/lib/addon-web-links.js "> </ script >
33
+ < script src ="https://unpkg.com/trzsz@1.1.5/lib/trzsz.js "> </ script >
31
34
< script >
32
35
let sendResizing = false ;
33
36
34
37
function doResize ( ) {
35
38
fitAddon . fit ( )
39
+
36
40
const w = fitAddon . proposeDimensions ( ) ;
37
41
const prefix = new Int8Array ( [ 1 ] ) ;
38
42
const resizeMessage = new TextEncoder ( ) . encode ( JSON . stringify ( {
70
74
cursorBlink : true ,
71
75
} ) ;
72
76
const socket = new WebSocket ( ( window . location . protocol == 'https:' ? 'wss' : 'ws' ) + '://' + window . location . host + '/terminal/' + '{{.SessionID}}' ) ;
73
- const attachAddon = new AttachAddon . AttachAddon ( socket ) ;
77
+ const trzszAddon = new TrzszAddon ( socket ) ;
78
+ term . loadAddon ( trzszAddon ) ;
74
79
const fitAddon = new FitAddon . FitAddon ( ) ;
75
- term . loadAddon ( attachAddon ) ;
76
80
term . loadAddon ( fitAddon ) ;
81
+
77
82
term . open ( document . getElementById ( 'terminal-container' ) ) ;
78
83
79
84
socket . onopen = ( ) => {
90
95
}
91
96
</ script >
92
97
</ body >
98
+
93
99
</ html >
94
100
{{end}}
You can’t perform that action at this time.
0 commit comments