mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-11-30 20:28:53 +08:00
fix: show VNC console dialogs in full screen and restore deleting custom shortcut keys (#1222) (#1224)
* fix: show the VNC console's dialogs in full screen
Only the console went full screen and dialogs render outside of it, so the
Ctrl+Alt+Del and Soft Reboot confirmations, among others, stayed hidden behind
it until full screen was left. Put the whole page in full screen instead.
* fix: bring back deleting saved VNC console shortcut keys
The Vue 3 migration dropped the close button from the list of saved shortcuts,
which left no way to delete one. Restore it, and remove by position in the list:
the old code parsed the displayed HTML to find the shortcut, which cannot match
one with the Space key in it, such as Ctrl+Space.
* fix: tidy the VNC console's custom shortcut keys
Give the saved shortcuts in the menu the same space as the separator above
them, and name the dialog's buttons Cancel and Save, which say what they do.
---------
(cherry picked from commit 73eaccc2ad)
Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
Co-authored-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
This commit is contained in:
1 parent
0a797e7e22
commit
5e5b01a035
4 files changed
+126
-20
No files matched your search
@@ -136,20 +136,15 @@ export default {
|
||||
this.addedShortcutKeys.push([].concat(this.keysRecord));
|
||||
},
|
||||
|
||||
removeKey(keys) {
|
||||
const key = keys.replace(/(\s*)<code>|<\/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 {
|
||||
<Banner
|
||||
v-for="(keys,index) in displayedKeys"
|
||||
:key="index"
|
||||
:closable="true"
|
||||
@close="removeKey(index)"
|
||||
>
|
||||
<span v-clean-html="keys"></span>
|
||||
</Banner>
|
||||
@@ -233,10 +230,10 @@ export default {
|
||||
class="btn role-secondary mr-20"
|
||||
@click.prevent="closeRecordingModal"
|
||||
>
|
||||
<t k="generic.close" />
|
||||
<t k="generic.cancel" />
|
||||
</button>
|
||||
<AsyncButton
|
||||
mode="done"
|
||||
mode="edit"
|
||||
@click="saveKeys"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user