diff --git a/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue b/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue index 25a84c84..426ba896 100644 --- a/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue +++ b/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue @@ -136,20 +136,15 @@ export default { this.addedShortcutKeys.push([].concat(this.keysRecord)); }, - removeKey(keys) { - const key = keys.replace(/(\s*)|<\/code>/g, '').replace(/\s*,\s*/g, ','); + // The index is the one in displayedKeys, which lists the added shortcuts first. + removeKey(index) { + const added = this.addedShortcutKeys.length; - this.addedShortcutKeys = this.addedShortcutKeys.filter((item) => { - const formatkey = item.map((K) => K.key.charAt(0).toUpperCase() + K.key.slice(1)).join(','); - - return formatkey !== key; - }); - - this.preferredShortcutKeys = this.preferredShortcutKeys.filter((item) => { - const formatkey = item.map((K) => K.key.charAt(0).toUpperCase() + K.key.slice(1)).join(','); - - return formatkey !== key; - }); + if (index < added) { + this.addedShortcutKeys.splice(index, 1); + } else { + this.preferredShortcutKeys.splice(index - added, 1); + } }, async saveKeys(buttonCb) { @@ -220,6 +215,8 @@ export default { @@ -233,10 +230,10 @@ export default { class="btn role-secondary mr-20" @click.prevent="closeRecordingModal" > - + diff --git a/pkg/harvester/components/novnc/NovncConsoleWrapper.vue b/pkg/harvester/components/novnc/NovncConsoleWrapper.vue index 8dcf9e74..43155a17 100644 --- a/pkg/harvester/components/novnc/NovncConsoleWrapper.vue +++ b/pkg/harvester/components/novnc/NovncConsoleWrapper.vue @@ -428,7 +428,8 @@ export default { if (document.fullscreenElement) { await document.exitFullscreen(); } else { - await this.$refs.consoleContainer.requestFullscreen(); + // The whole page and not only the console, because dialogs render outside of it. + await document.documentElement.requestFullscreen(); // Keyboard lock lets shortcuts such as Ctrl+W and F11 reach the guest. await navigator.keyboard?.lock?.(['KeyW', 'F11']); } @@ -454,10 +455,7 @@ export default {