Skip to content

Commit

Permalink
chore: back to attach addon
Browse files Browse the repository at this point in the history
  • Loading branch information
naiba committed Aug 21, 2024
1 parent fd85f59 commit 64da3c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion resource/template/dashboard-default/terminal.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<script src="https://unpkg.com/[email protected]/lib/xterm.js"></script>
<script src="https://unpkg.com/@xterm/[email protected]/lib/addon-fit.js"></script>
<script src="https://unpkg.com/@xterm/[email protected]/lib/addon-web-links.js"></script>
<script src="https://unpkg.com/@xterm/[email protected]/lib/addon-attach.js"></script>
<script>
let sendResizing = false;

Expand Down Expand Up @@ -106,7 +107,9 @@
cursorBlink: true,
});
const socket = new WebSocket((window.location.protocol == 'https:' ? 'wss' : 'ws') + '://' + window.location.host + '/terminal/' + '{{.SessionID}}');
socket.binaryType = 'arraybuffer';

const attachAddon = new AttachAddon.AttachAddon(socket);
term.loadAddon(attachAddon);

const fitAddon = new FitAddon.FitAddon();
term.loadAddon(fitAddon);
Expand Down

0 comments on commit 64da3c7

Please sign in to comment.