Skip to content

Commit

Permalink
recreate pr 9831 + fix e2e tests (rancher#10245)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandre Alves <[email protected]>
  • Loading branch information
aalves08 and Alexandre Alves authored Jan 10, 2024
1 parent 7acae2b commit 0b1a331
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 35 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/po/components/kubectl.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default class Kubectl extends ComponentPo {
}

readonly kubeCommand: string = 'kubectl'
readonly terminalRow: string = '.xterm-rows'
readonly terminalRow: string = '.xterm-link-layer'

openTerminal() {
cy.get('#btn-kubectl').click();
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/po/components/shell.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ export default class Shell extends ComponentPo {
super('#windowmanager');
}

readonly terminalRow: string = '.xterm-rows'

openTerminal() {
// get and click on the first row's action menu button
cy.get(`button[data-testid="sortable-table-0-action-button"]`).first().click();
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@
"vue-virtual-scroll-list": "^2.3.4",
"vuedraggable": "2.24.3",
"vuex": "3.6.2",
"xterm": "5.0.0",
"xterm-addon-fit": "0.6.0",
"xterm-addon-search": "0.10.0",
"xterm-addon-web-links": "0.7.0",
"xterm-addon-webgl": "0.13.0",
"xterm": "5.2.1",
"xterm-addon-canvas": "^0.5.0",
"xterm-addon-fit": "0.8.0",
"xterm-addon-search": "0.13.0",
"xterm-addon-web-links": "0.9.0",
"xterm-addon-webgl": "0.16.0",
"yaml": "2.0.0"
},
"devDependencies": {
Expand Down
7 changes: 6 additions & 1 deletion pkg/harvester/components/SerialConsole/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default {
fitAddon: null,
searchAddon: null,
webglAddon: null,
canvasAddon: null,
isOpen: false,
isOpening: false,
backlog: [],
Expand Down Expand Up @@ -81,6 +82,7 @@ export default {
webgl: import(/* webpackChunkName: "xterm" */ 'xterm-addon-webgl'),
weblinks: import(/* webpackChunkName: "xterm" */ 'xterm-addon-web-links'),
search: import(/* webpackChunkName: "xterm" */ 'xterm-addon-search'),
canvas: import(/* webpackChunkName: "xterm" */ 'xterm-addon-canvas')
});
const terminal = new xterm.Terminal({
Expand All @@ -96,10 +98,11 @@ export default {
this.searchAddon = new addons.search.SearchAddon();
try {
this.webglAddon = new addons.webgl.WebGlAddon();
this.webglAddon = new addons.webgl.WebglAddon();
} catch (e) {
// Some browsers (Safari) don't support the webgl renderer, so don't use it.
this.webglAddon = null;
this.canvasAddon = new addons.canvas.CanvasAddon();
}
terminal.loadAddon(this.fitAddon);
Expand All @@ -109,6 +112,8 @@ export default {
if ( this.webglAddon ) {
terminal.loadAddon(this.webglAddon);
} else {
terminal.loadAddon(this.canvasAddon);
}
this.fit();
Expand Down
7 changes: 6 additions & 1 deletion shell/components/nav/WindowManager/ContainerShell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default {
fitAddon: null,
searchAddon: null,
webglAddon: null,
canvasAddon: null,
isOpen: false,
isOpening: false,
backlog: [],
Expand Down Expand Up @@ -155,6 +156,7 @@ export default {
webgl: import(/* webpackChunkName: "xterm" */ 'xterm-addon-webgl'),
weblinks: import(/* webpackChunkName: "xterm" */ 'xterm-addon-web-links'),
search: import(/* webpackChunkName: "xterm" */ 'xterm-addon-search'),
canvas: import(/* webpackChunkName: "xterm" */ 'xterm-addon-canvas')
});
const terminal = new xterm.Terminal({
Expand All @@ -171,10 +173,11 @@ export default {
this.searchAddon = new addons.search.SearchAddon();
try {
this.webglAddon = new addons.webgl.WebGlAddon();
this.webglAddon = new addons.webgl.WebglAddon();
} catch (e) {
// Some browsers (Safari) don't support the webgl renderer, so don't use it.
this.webglAddon = null;
this.canvasAddon = new addons.canvas.CanvasAddon();
}
terminal.loadAddon(this.fitAddon);
Expand All @@ -184,6 +187,8 @@ export default {
if (this.webglAddon) {
terminal.loadAddon(this.webglAddon);
} else {
terminal.loadAddon(this.canvasAddon);
}
this.fit();
Expand Down
11 changes: 6 additions & 5 deletions shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@
"vuex": "3.6.2",
"webpack-bundle-analyzer": "4.5.0",
"webpack-virtual-modules": "0.4.3",
"xterm": "5.0.0",
"xterm-addon-fit": "0.6.0",
"xterm-addon-search": "0.10.0",
"xterm-addon-web-links": "0.7.0",
"xterm-addon-webgl": "0.13.0",
"xterm": "5.2.1",
"xterm-addon-canvas": "^0.5.0",
"xterm-addon-fit": "0.8.0",
"xterm-addon-search": "0.13.0",
"xterm-addon-web-links": "0.9.0",
"xterm-addon-webgl": "0.16.0",
"worker-loader": "3.0.8",
"yarn": "1.22.18"
},
Expand Down
45 changes: 25 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16006,30 +16006,35 @@ xtend@^4.0.0, xtend@~4.0.1:
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==

[email protected]:
version "0.6.0"
resolved "https://registry.yarnpkg.com/xterm-addon-fit/-/xterm-addon-fit-0.6.0.tgz#142e1ce181da48763668332593fc440349c88c34"
integrity sha512-9/7A+1KEjkFam0yxTaHfuk9LEvvTSBi0PZmEkzJqgafXPEXL9pCMAVV7rB09sX6ATRDXAdBpQhZkhKj7CGvYeg==

[email protected]:
version "0.10.0"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.10.0.tgz#b6a5e859c0bfd83ad534233f93376640c0e0c652"
integrity sha512-l+kjDxNDQbkniU5OUo9BHknxUEPZGM0OFpVpc2sMmrb97S0FKJVJO4wAZPJvSGVJ8ZEG6KuDyzXluvnb08t71Q==
xterm-addon-canvas@^0.5.0:
version "0.5.0"
resolved "https://registry.npmjs.org/xterm-addon-canvas/-/xterm-addon-canvas-0.5.0.tgz#95d056cec6da42a51b2c47746a011409020c388c"
integrity sha512-QOo/eZCMrCleAgMimfdbaZCgmQRWOml63Ued6RwQ+UTPvQj3Av9QKx3xksmyYrDGRO/AVRXa9oNuzlYvLdmoLQ==

xterm-addon-web-links@0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.7.0.tgz#dceac36170605f9db10a01d716bd83ee38f65c17"
integrity sha512-6PqoqzzPwaeSq22skzbvyboDvSnYk5teUYEoKBwMYvhbkwOQkemZccjWHT5FnNA8o1aInTc4PRYAl4jjPucCKA==
xterm-addon-fit@0.8.0:
version "0.8.0"
resolved "https://registry.npmjs.org/xterm-addon-fit/-/xterm-addon-fit-0.8.0.tgz#48ca99015385141918f955ca7819e85f3691d35f"
integrity sha512-yj3Np7XlvxxhYF/EJ7p3KHaMt6OdwQ+HDu573Vx1lRXsVxOcnVJs51RgjZOouIZOczTsskaS+CpXspK81/DLqw==

xterm-addon-webgl@0.13.0:
xterm-addon-search@0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.13.0.tgz#b1d42ec454390ad8595aa8c8dde714b98a5eb896"
integrity sha512-xL4qBQWUHjFR620/8VHCtrTMVQsnZaAtd1IxFoiKPhC63wKp6b+73a45s97lb34yeo57PoqZhE9Jq5pB++ksPQ==
resolved "https://registry.npmjs.org/xterm-addon-search/-/xterm-addon-search-0.13.0.tgz#21286f4db48aa949fbefce34bb8bc0c9d3cec627"
integrity sha512-sDUwG4CnqxUjSEFh676DlS3gsh3XYCzAvBPSvJ5OPgF3MRL3iHLPfsb06doRicLC2xXNpeG2cWk8x1qpESWJMA==

[email protected]:
version "5.0.0"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.0.0.tgz#0af50509b33d0dc62fde7a4ec17750b8e453cc5c"
integrity sha512-tmVsKzZovAYNDIaUinfz+VDclraQpPUnAME+JawosgWRMphInDded/PuY0xmU5dOhyeYZsI0nz5yd8dPYsdLTA==
[email protected]:
version "0.9.0"
resolved "https://registry.npmjs.org/xterm-addon-web-links/-/xterm-addon-web-links-0.9.0.tgz#c65b18588d1f613e703eb6feb7f129e7ff1c63e7"
integrity sha512-LIzi4jBbPlrKMZF3ihoyqayWyTXAwGfu4yprz1aK2p71e9UKXN6RRzVONR0L+Zd+Ik5tPVI9bwp9e8fDTQh49Q==

[email protected]:
version "0.16.0"
resolved "https://registry.npmjs.org/xterm-addon-webgl/-/xterm-addon-webgl-0.16.0.tgz#9872d08a64136f893b27ef9a6412136d3bf563c4"
integrity sha512-E8cq1AiqNOv0M/FghPT+zPAEnvIQRDbAbkb04rRYSxUym69elPWVJ4sv22FCLBqM/3LcrmBLl/pELnBebVFKgA==

[email protected]:
version "5.2.1"
resolved "https://registry.npmjs.org/xterm/-/xterm-5.2.1.tgz#b3fea7bdb55b9be1d4b31f4cd1091f26ac42afb8"
integrity sha512-cs5Y1fFevgcdoh2hJROMVIWwoBHD80P1fIP79gopLHJIE4kTzzblanoivxTiQ4+92YM9IxS36H1q0MxIJXQBcA==

y18n@^4.0.0:
version "4.0.3"
Expand Down

0 comments on commit 0b1a331

Please sign in to comment.