Skip to content

Commit

Permalink
feat(web-core): focus on console (#8235)
Browse files Browse the repository at this point in the history
  • Loading branch information
S3bastianCZ authored Jan 22, 2025
1 parent 42f205e commit 300bb18
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions @xen-orchestra/lite/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fix persistent scrollbar on the right (PR [#8191](https://github.com/vatesfr/xen-orchestra/pull/8191))
- [Console]: Displays a loader when the console is loading (PR [#8226](https://github.com/vatesfr/xen-orchestra/pull/8226))
- [i18n] Add Spanish translation (contribution made by [@DSJ2](https://github.com/DSJ2)) (PR [#8220](https://github.com/vatesfr/xen-orchestra/pull/8220))
- [Console]: Adding a border when console is focused (PR [#8235](https://github.com/vatesfr/xen-orchestra/pull/8235))

## **0.6.0** (2024-11-29)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ async function createVncConnection() {
vncClient.addEventListener('disconnect', handleDisconnectionEvent)
vncClient.addEventListener('connect', handleConnectionEvent)
const canvas = consoleContainer.value?.querySelector('canvas') as HTMLCanvasElement | null
if (canvas !== null) {
// Todo: See with Clémence to specify the desired focus behavior
canvas.setAttribute('tabindex', '0')
canvas.addEventListener('focus', () => {
canvas.classList.add('focused')
})
canvas.addEventListener('blur', () => {
canvas.classList.remove('focused')
})
}
}
watchEffect(() => {
Expand Down Expand Up @@ -124,6 +136,12 @@ defineExpose({
/* Required because the library adds "margin: auto" to the canvas which makes the canvas centered in space and not aligned to the rest of the layout */
:deep(canvas) {
margin: 0 auto !important;
cursor: default !important;
border: 6px solid transparent;
&.focused {
border: var(--color-success-txt-base) 6px solid;
}
}
}
</style>
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [i18n] Add Spanish translation (contribution made by [@DSJ2](https://github.com/DSJ2)) (PR [#8220](https://github.com/vatesfr/xen-orchestra/pull/8220))
- [Console]: Add Ctrl+Alt+Del functionality to console (PR [#8239](https://github.com/vatesfr/xen-orchestra/pull/8239))
- [UI]: Use user language set in XO 5 to set the language in XO 6 (PR [#8232](https://github.com/vatesfr/xen-orchestra/pull/8232))
- [Console]: Adding a border when console is focused (PR [#8235](https://github.com/vatesfr/xen-orchestra/pull/8235))
- [Backup] New [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) encryption for remotes, allow encrypted files larger than 64GB (PR [#8237](https://github.com/vatesfr/xen-orchestra/pull/8237))

### Bug fixes
Expand Down

0 comments on commit 300bb18

Please sign in to comment.