From 99ed1aeef73b312d1a217acdb332856564ec7b1b Mon Sep 17 00:00:00 2001 From: viarotel Date: Thu, 2 Nov 2023 16:07:42 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20Split=20Action?= =?UTF-8?q?=20Bar=20Function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/exposes/scrcpy/index.js | 19 ++ .../Device/ControlBar/AppInstall/index.vue | 98 ++++++++ .../Device/ControlBar/Gnirehtet/index.vue | 49 ++++ .../Device/ControlBar/Screenshot/index.vue | 83 +++++++ src/components/Device/ControlBar/index.vue | 220 ++++-------------- src/components/Device/index.vue | 31 +-- src/locales/languages/en_US.json | 17 +- src/locales/languages/zh_CN.json | 8 +- src/store/preference/model/audio/index.js | 4 +- src/store/preference/model/video/index.js | 4 +- 10 files changed, 327 insertions(+), 206 deletions(-) create mode 100644 src/components/Device/ControlBar/AppInstall/index.vue create mode 100644 src/components/Device/ControlBar/Gnirehtet/index.vue create mode 100644 src/components/Device/ControlBar/Screenshot/index.vue diff --git a/electron/exposes/scrcpy/index.js b/electron/exposes/scrcpy/index.js index f97e898..fb7296b 100644 --- a/electron/exposes/scrcpy/index.js +++ b/electron/exposes/scrcpy/index.js @@ -102,8 +102,27 @@ const getEncoders = async (serial) => { return value } +const mirror = async (serial, { title, args = '', ...options } = {}) => { + return shell( + `--serial="${serial}" --window-title="${title}" ${args}`, + options, + ) +} + +const record = async ( + serial, + { title, args = '', savePath, ...options } = {}, +) => { + return shell( + `--serial="${serial}" --window-title="${title}" --record="${savePath}" ${args}`, + options, + ) +} + export default () => ({ shell, execShell, getEncoders, + mirror, + record, }) diff --git a/src/components/Device/ControlBar/AppInstall/index.vue b/src/components/Device/ControlBar/AppInstall/index.vue new file mode 100644 index 0000000..ecd5222 --- /dev/null +++ b/src/components/Device/ControlBar/AppInstall/index.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/src/components/Device/ControlBar/Gnirehtet/index.vue b/src/components/Device/ControlBar/Gnirehtet/index.vue new file mode 100644 index 0000000..ac377fd --- /dev/null +++ b/src/components/Device/ControlBar/Gnirehtet/index.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/src/components/Device/ControlBar/Screenshot/index.vue b/src/components/Device/ControlBar/Screenshot/index.vue new file mode 100644 index 0000000..ef84c62 --- /dev/null +++ b/src/components/Device/ControlBar/Screenshot/index.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/src/components/Device/ControlBar/index.vue b/src/components/Device/ControlBar/index.vue index 0307734..fe9bea4 100644 --- a/src/components/Device/ControlBar/index.vue +++ b/src/components/Device/ControlBar/index.vue @@ -4,33 +4,51 @@ class="bg-primary-100 dark:bg-gray-800 -my-[8px] flex flex-nowrap overflow-hidden" title="滚动查看被遮盖的菜单" > - - - {{ $t(item.label) }} - + + + {{ $t(item.label) }} + +