From f3ee98c33dfbb411336b78dc9732a869acacc4cb Mon Sep 17 00:00:00 2001 From: yuzeng Date: Thu, 23 Jun 2022 11:42:28 +0800 Subject: [PATCH] Harvester: Refactor Novnc --- shell/assets/translations/en-us.yaml | 2 +- shell/components/{ => novnc}/NovncConsole.vue | 0 .../components/{ => novnc}/NovncConsoleItem.vue | 16 ++++++++-------- .../{ => novnc}/NovncConsoleWrapper.vue | 16 ++++++++-------- .../c/_cluster/harvester/console/_uid/vnc.vue | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) rename shell/components/{ => novnc}/NovncConsole.vue (100%) rename shell/components/{ => novnc}/NovncConsoleItem.vue (82%) rename shell/components/{ => novnc}/NovncConsoleWrapper.vue (93%) diff --git a/shell/assets/translations/en-us.yaml b/shell/assets/translations/en-us.yaml index 753d96d51b..102243fe32 100644 --- a/shell/assets/translations/en-us.yaml +++ b/shell/assets/translations/en-us.yaml @@ -5865,7 +5865,7 @@ harvester: down: No events in the past hour console: down: This Virtual Machine is down. Please start it to access its console. - shortKeys: Short Keys + shortKeys: Shortcut Keys volume: label: Volumes diff --git a/shell/components/NovncConsole.vue b/shell/components/novnc/NovncConsole.vue similarity index 100% rename from shell/components/NovncConsole.vue rename to shell/components/novnc/NovncConsole.vue diff --git a/shell/components/NovncConsoleItem.vue b/shell/components/novnc/NovncConsoleItem.vue similarity index 82% rename from shell/components/NovncConsoleItem.vue rename to shell/components/novnc/NovncConsoleItem.vue index 777f559380..6f2f1c3ef9 100644 --- a/shell/components/NovncConsoleItem.vue +++ b/shell/components/novnc/NovncConsoleItem.vue @@ -28,16 +28,16 @@ export default { methods: { keysDown(key, pos) { - this.addKeys(key, pos); - this.$emit('sendKeys', this.path); + this.addKeys({ key, pos }); + this.$emit('sendKeys'); }, - addKeys(key, pos) { - this.path.splice(pos, this.path.length - pos, key); + addKeys({ key, pos }) { + this.$emit('update', { key, pos }); }, sendKeys() { - this.$emit('sendKeys', this.path); + this.$emit('sendKeys'); }, getOpenStatus(key, pos) { @@ -56,10 +56,10 @@ export default { trigger="click" :container="false" > - {{ item.label }} + {{ item.label }} @@ -68,7 +68,7 @@ export default { -