From bfdad9e8dee31f0c8e59078ebbed646bab499375 Mon Sep 17 00:00:00 2001 From: viarotel Date: Fri, 10 Nov 2023 16:09:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Recording=20prompt=20and?= =?UTF-8?q?=20file=20format=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ControlBar/AppInstall/index.vue | 6 +-- .../ControlBar/FileManage/index.vue | 8 ++-- .../components/ControlBar/Gnirehtet/index.vue | 17 ++++++-- .../ControlBar/MirrorGroup/index.vue | 6 +-- .../ControlBar/Screenshot/index.vue | 12 +++--- src/components/Device/index.vue | 42 ++++++++++--------- src/store/device/index.js | 29 +++++++++++++ 7 files changed, 81 insertions(+), 39 deletions(-) diff --git a/src/components/Device/components/ControlBar/AppInstall/index.vue b/src/components/Device/components/ControlBar/AppInstall/index.vue index 1f951e76..a8b5f381 100644 --- a/src/components/Device/components/ControlBar/AppInstall/index.vue +++ b/src/components/Device/components/ControlBar/AppInstall/index.vue @@ -48,7 +48,7 @@ export default { const messageEl = this.$message({ message: this.$t('device.control.install.progress', { - deviceName: device.$name, + deviceName: this.$store.device.getLabel(device), }), icon: LoadingIcon, duration: 0, @@ -73,7 +73,7 @@ export default { if (totalCount > 1) { this.$message.success( this.$t('device.control.install.success', { - deviceName: device.$name, + deviceName: this.$store.device.getLabel(device), totalCount, successCount, failCount, @@ -83,7 +83,7 @@ export default { else { this.$message.success( this.$t('device.control.install.success.single', { - deviceName: device.$name, + deviceName: this.$store.device.getLabel(device), }), ) } diff --git a/src/components/Device/components/ControlBar/FileManage/index.vue b/src/components/Device/components/ControlBar/FileManage/index.vue index 4233ade8..592782d6 100644 --- a/src/components/Device/components/ControlBar/FileManage/index.vue +++ b/src/components/Device/components/ControlBar/FileManage/index.vue @@ -6,7 +6,9 @@ @@ -73,7 +75,7 @@ export default { if (totalCount > 1) { this.$message.success( this.$t('device.control.file.push.success', { - deviceName: this.device.$name, + deviceName: this.$store.device.getLabel(this.device), totalCount, successCount, failCount, @@ -83,7 +85,7 @@ export default { else { this.$message.success( this.$t('device.control.file.push.success.single', { - deviceName: this.device.$name, + deviceName: this.$store.device.getLabel(this.device), }), ) } diff --git a/src/components/Device/components/ControlBar/Gnirehtet/index.vue b/src/components/Device/components/ControlBar/Gnirehtet/index.vue index 870b46d5..4b538ae9 100644 --- a/src/components/Device/components/ControlBar/Gnirehtet/index.vue +++ b/src/components/Device/components/ControlBar/Gnirehtet/index.vue @@ -25,7 +25,14 @@ export default { }, }, data() { - return { + return {} + }, + created() { + if (!Object.hasOwnProperty.call(this.device, '$gnirehtetLoading')) { + Object.assign(this.device, { + $gnirehtetLoading: false, + $gnirehtetLoadingText: '', + }) } }, methods: { @@ -33,7 +40,9 @@ export default { return this.$store.preference.getData(...args) }, async handleStart() { - this.device.$gnirehtetLoadingText = this.$t('device.control.gnirehtet.running') + this.device.$gnirehtetLoadingText = this.$t( + 'device.control.gnirehtet.running', + ) this.device.$gnirehtetLoading = true try { @@ -50,7 +59,9 @@ export default { } }, async handleStop() { - this.device.$gnirehtetLoadingText = this.$t('device.control.gnirehtet.stopping') + this.device.$gnirehtetLoadingText = this.$t( + 'device.control.gnirehtet.stopping', + ) try { await this.$gnirehtet.stop(this.device.id) diff --git a/src/components/Device/components/ControlBar/MirrorGroup/index.vue b/src/components/Device/components/ControlBar/MirrorGroup/index.vue index 2f9adcd8..979f7683 100644 --- a/src/components/Device/components/ControlBar/MirrorGroup/index.vue +++ b/src/components/Device/components/ControlBar/MirrorGroup/index.vue @@ -42,9 +42,9 @@ export default { const res = await this.$scrcpy.mirrorGroup(this.device.id, { open, title: ({ displayId }) => - `${this.device.$remark ? `${this.device.$remark}-` : ''}${ - this.device.$name - }-${this.device.id}-display-${displayId}`, + `${this.$store.device.getLabel( + this.device, + )}-displayId-${displayId}`, args: this.scrcpyArgs(this.device.id), }) diff --git a/src/components/Device/components/ControlBar/Screenshot/index.vue b/src/components/Device/components/ControlBar/Screenshot/index.vue index c84a28ca..85e4aa49 100644 --- a/src/components/Device/components/ControlBar/Screenshot/index.vue +++ b/src/components/Device/components/ControlBar/Screenshot/index.vue @@ -5,7 +5,6 @@