Update the node modules

pull/62/head
Vasile Popescu 2 years ago committed by Elis Popescu
parent 02af910efe
commit 3994b813bf

File diff suppressed because one or more lines are too long

@ -1,2 +1 @@
12.4.0 v16.13.0

File diff suppressed because it is too large Load Diff

@ -10,13 +10,13 @@
"author": "elisescu", "author": "elisescu",
"license": "elisescu", "license": "elisescu",
"dependencies": { "dependencies": {
"copy-webpack-plugin": "^6.0.0", "copy-webpack-plugin": "^11.0.0",
"css-loader": "^3.6.0", "css-loader": "^6.7.2",
"style-loader": "^0.23.1", "style-loader": "^3.3.1",
"ts-loader": "^6.2.2", "ts-loader": "^9.4.1",
"typescript": "^3.9.7", "typescript": "^4.9.3",
"webpack": "^4.44.2", "webpack": "^5.75.0",
"webpack-cli": "^3.3.12", "webpack-cli": "^5.0.0",
"xterm": "^4.9.0" "xterm": "^5.0.0"
} }
} }

@ -2,7 +2,6 @@ import 'xterm/css/xterm.css';
import './main.css'; import './main.css';
import { Terminal } from 'xterm'; import { Terminal } from 'xterm';
import * as pbkdf2 from 'pbkdf2';
import { TTYReceiver } from './tty-receiver'; import { TTYReceiver } from './tty-receiver';
@ -11,9 +10,6 @@ const term = new Terminal({
macOptionIsMeta: true, macOptionIsMeta: true,
}); });
const derivedKey = pbkdf2.pbkdf2Sync('password', 'salt', 4096, 32, 'sha256');
console.log(derivedKey);
let wsAddress = ""; let wsAddress = "";
if (window.location.protocol === "https:") { if (window.location.protocol === "https:") {
wsAddress = 'wss://'; wsAddress = 'wss://';

@ -31,7 +31,7 @@ class TTYReceiver {
connection.onclose = (evt: CloseEvent) => { connection.onclose = (evt: CloseEvent) => {
this.xterminal.blur(); this.xterminal.blur();
this.xterminal.setOption('cursorBlink', false); this.xterminal.options.cursorBlink = false
this.xterminal.clear(); this.xterminal.clear();
setTimeout(() => { setTimeout(() => {
@ -43,17 +43,16 @@ class TTYReceiver {
const containerPixSize = this.getElementPixelsSize(container); const containerPixSize = this.getElementPixelsSize(container);
const newFontSize = this.guessNewFontSize(this.xterminal.cols, this.xterminal.rows, containerPixSize.width, containerPixSize.height); const newFontSize = this.guessNewFontSize(this.xterminal.cols, this.xterminal.rows, containerPixSize.width, containerPixSize.height);
this.xterminal.setOption('fontSize', newFontSize); this.xterminal.options.fontSize = newFontSize
this.xterminal.options.fontFamily= 'SauceCodePro MonoWindows, courier-new, monospace'
connection.onmessage = (ev: MessageEvent) => { connection.onmessage = (ev: MessageEvent) => {
console.log("Got message: ", ev.data);
let message = JSON.parse(ev.data) let message = JSON.parse(ev.data)
let msgData = base64.decode(message.Data) let msgData = base64.decode(message.Data)
if (message.Type === "Write") { if (message.Type === "Write") {
let writeMsg = JSON.parse(msgData) let writeMsg = JSON.parse(msgData)
this.xterminal.writeUtf8(base64.base64ToArrayBuffer(writeMsg.Data)); this.xterminal.write(base64.base64ToArrayBuffer(writeMsg.Data));
} }
if (message.Type == "WinSize") { if (message.Type == "WinSize") {
@ -61,7 +60,7 @@ class TTYReceiver {
const containerPixSize = this.getElementPixelsSize(container); const containerPixSize = this.getElementPixelsSize(container);
const newFontSize = this.guessNewFontSize(winSizeMsg.Cols, winSizeMsg.Rows, containerPixSize.width, containerPixSize.height); const newFontSize = this.guessNewFontSize(winSizeMsg.Cols, winSizeMsg.Rows, containerPixSize.width, containerPixSize.height);
this.xterminal.setOption('fontSize', newFontSize); this.xterminal.options.fontSize = newFontSize
// Now set the new size. // Now set the new size.
this.xterminal.resize(winSizeMsg.Cols, winSizeMsg.Rows) this.xterminal.resize(winSizeMsg.Cols, winSizeMsg.Rows)
@ -99,7 +98,7 @@ class TTYReceiver {
private guessNewFontSize(newCols: number, newRows: number, targetWidth: number, targetHeight: number): number { private guessNewFontSize(newCols: number, newRows: number, targetWidth: number, targetHeight: number): number {
const cols = this.xterminal.cols; const cols = this.xterminal.cols;
const rows = this.xterminal.rows; const rows = this.xterminal.rows;
const fontSize = this.xterminal.getOption('fontSize'); const fontSize = this.xterminal.options.fontSize
const xtermPixelsSize = this.getElementPixelsSize(this.containerElement.querySelector(".xterm-screen")); const xtermPixelsSize = this.getElementPixelsSize(this.containerElement.querySelector(".xterm-screen"));
const newHFontSizeMultiplier = (cols / newCols) * (targetWidth / xtermPixelsSize.width); const newHFontSizeMultiplier = (cols / newCols) * (targetWidth / xtermPixelsSize.width);

Loading…
Cancel
Save