diff --git a/@xen-orchestra/lite/CHANGELOG.md b/@xen-orchestra/lite/CHANGELOG.md index 7581a31b42e..deb759654bc 100644 --- a/@xen-orchestra/lite/CHANGELOG.md +++ b/@xen-orchestra/lite/CHANGELOG.md @@ -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) diff --git a/@xen-orchestra/web-core/lib/components/console/VtsRemoteConsole.vue b/@xen-orchestra/web-core/lib/components/console/VtsRemoteConsole.vue index 8ab6030ad07..1e9cb242ac6 100644 --- a/@xen-orchestra/web-core/lib/components/console/VtsRemoteConsole.vue +++ b/@xen-orchestra/web-core/lib/components/console/VtsRemoteConsole.vue @@ -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(() => { @@ -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; + } } } diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 45b5e39e83b..5ed194d8772 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -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