From db9e3e791e3a168c2f3cdef75d5cf1f834bce484 Mon Sep 17 00:00:00 2001 From: viarotel Date: Thu, 11 Jul 2024 17:18:27 +0800 Subject: [PATCH 1/7] =?UTF-8?q?perf:=20=E2=9C=85=20Support=20batch=20scree?= =?UTF-8?q?nshot=20and=20other=20performance=20optimization?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 3 +- CHANGELOG.md | 19 +++++++ README-CN.md | 2 +- README.md | 2 +- components.d.ts | 32 ------------ electron/main.js | 2 - package.json | 2 +- src/App.vue | 2 +- .../{AppInstall => Application}/index.vue | 8 +-- .../BatchActions/Screenshot/index.vue | 34 +++++++++++++ .../Device/components/BatchActions/index.vue | 17 +++++-- .../{AppInstall => Application}/index.vue | 13 +++-- .../ControlBar/Screenshot/index.vue | 50 ++++++------------- .../Device/components/ControlBar/index.vue | 6 +-- .../MoreDropdown/components/Record/index.vue | 24 ++------- src/components/Device/index.vue | 7 +-- src/components/Preference/index.vue | 7 +-- .../{AppSearch => Search}/index.vue | 0 src/plugins/auto.js | 1 + .../components/EleIconLoading}/index.vue | 2 +- src/plugins/element-plus/index.js | 10 ++++ src/styles/css/desktop.css | 1 + 22 files changed, 123 insertions(+), 121 deletions(-) rename src/components/Device/components/BatchActions/{AppInstall => Application}/index.vue (67%) create mode 100644 src/components/Device/components/BatchActions/Screenshot/index.vue rename src/components/Device/components/ControlBar/{AppInstall => Application}/index.vue (89%) rename src/components/{AppSearch => Search}/index.vue (100%) rename src/{components/Device/components/LoadingIcon => plugins/element-plus/components/EleIconLoading}/index.vue (84%) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0b9f2b6..ffb9835 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -49,5 +49,6 @@ ], "cSpell.words": [ "bhsn" - ] + ], + "common-intellisense.ui": [] } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index cce69ed..52ba658 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [1.20.1](https://github.com/viarotel-org/escrcpy/compare/v1.20.0...v1.20.1) (2024-07-04) + + +### Bug Fixes + +* 🐛 Fix batch text spelling errors ([062c689](https://github.com/viarotel-org/escrcpy/commit/062c689755df5bcc5f8e38605c7f101762d7ada0)) + +## [1.20.0](https://github.com/viarotel-org/escrcpy/compare/v1.19.4...v1.20.0) (2024-07-04) + + +### Features + +* ✨ Add batch installation application function ([37ce245](https://github.com/viarotel-org/escrcpy/commit/37ce2457bce9a1b661c6db7162023f53268833f5)) + + +### Performance Improvements + +* 🚀 Add mouse binding options ([7ee4ba4](https://github.com/viarotel-org/escrcpy/commit/7ee4ba4f2b177e6dbfce85036425b51bfa35ecff)) + ## [1.19.4](https://github.com/viarotel-org/escrcpy/compare/v1.19.3...v1.19.4) (2024-07-02) diff --git a/README-CN.md b/README-CN.md index 84fcafa..03ff1cb 100644 --- a/README-CN.md +++ b/README-CN.md @@ -203,7 +203,7 @@ Windows 及 Linux 端内部集成了 Gnirehtet, 用于提供 PC 到安卓设 15. 支持批量连接历史设备功能 ✅ 16. 支持使用内置终端执行自定义命令 ✅ 17. 支持设备自动执行镜像 ✅ -18. 添加批量安装应用功能 ✅ +18. 支持常用批量功能 ✅ 19. 支持更多批量处理功能 🚧 20. 支持对设备进行分组 🚧 21. 添加文件传输助手功能 🚧 diff --git a/README.md b/README.md index 518fe32..17b766c 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,7 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master 15. Support bulk connecting to historical devices ✅ 16. Support to use built-in terminals to execute custom commands ✅ 17. Supports automatic execution of mirror on devices ✅ -18. Add batch installation application function ✅ +18. Support common batch processing function ✅ 19. Support more batch processing functions 🚧 20. Support the device to group 🚧 21. Add file transmission assistant function 🚧 diff --git a/components.d.ts b/components.d.ts index c6282ce..ab50cdb 100644 --- a/components.d.ts +++ b/components.d.ts @@ -7,21 +7,11 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { - About: typeof import('./src/components/About/index.vue')['default'] - AppInstall: typeof import('./src/components/Device/components/BatchActions/AppInstall/index.vue')['default'] - AppSearch: typeof import('./src/components/AppSearch/index.vue')['default'] - AudioCodecSelect: typeof import('./src/components/Preference/components/AudioCodecSelect/index.vue')['default'] - BatchActions: typeof import('./src/components/Device/components/BatchActions/index.vue')['default'] - Camera: typeof import('./src/components/Device/components/MoreDropdown/components/Camera/index.vue')['default'] - ControlBar: typeof import('./src/components/Device/components/ControlBar/index.vue')['default'] - Device: typeof import('./src/components/Device/index.vue')['default'] - DisplaySelect: typeof import('./src/components/Preference/components/DisplaySelect/index.vue')['default'] ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete'] ElButton: typeof import('element-plus/es')['ElButton'] ElCol: typeof import('element-plus/es')['ElCol'] ElCollapse: typeof import('element-plus/es')['ElCollapse'] ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] - ElCollapseTransition: typeof import('element-plus/es')['ElCollapseTransition'] ElDialog: typeof import('element-plus/es')['ElDialog'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] @@ -44,28 +34,6 @@ declare module 'vue' { ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] - FileManage: typeof import('./src/components/Device/components/ControlBar/FileManage/index.vue')['default'] - Gnirehtet: typeof import('./src/components/Device/components/ControlBar/Gnirehtet/index.vue')['default'] - KeyboardInjectSelect: typeof import('./src/components/Preference/components/KeyboardInjectSelect/index.vue')['default'] - LanguageSelect: typeof import('./src/components/Preference/components/LanguageSelect/index.vue')['default'] - LoadingIcon: typeof import('./src/components/Device/components/LoadingIcon/index.vue')['default'] - MirrorAction: typeof import('./src/components/Device/components/MirrorAction/index.vue')['default'] - MirrorGroup: typeof import('./src/components/Device/components/ControlBar/MirrorGroup/index.vue')['default'] - MoreDropdown: typeof import('./src/components/Device/components/MoreDropdown/index.vue')['default'] - Otg: typeof import('./src/components/Device/components/MoreDropdown/components/Otg/index.vue')['default'] - PairDialog: typeof import('./src/components/Device/components/Wireless/PairDialog/index.vue')['default'] - PathInput: typeof import('./src/components/Preference/components/PathInput/index.vue')['default'] - Preference: typeof import('./src/components/Preference/index.vue')['default'] - Record: typeof import('./src/components/Device/components/MoreDropdown/components/Record/index.vue')['default'] - Remark: typeof import('./src/components/Device/components/Remark/index.vue')['default'] - Rotation: typeof import('./src/components/Device/components/ControlBar/Rotation/index.vue')['default'] - Screenshot: typeof import('./src/components/Device/components/ControlBar/Screenshot/index.vue')['default'] - TerminalAction: typeof import('./src/components/Device/components/TerminalAction/index.vue')['default'] - TerminalDialog: typeof import('./src/components/Device/components/TerminalAction/components/TerminalDialog/index.vue')['default'] - VideoCodecSelect: typeof import('./src/components/Preference/components/VideoCodecSelect/index.vue')['default'] - Volume: typeof import('./src/components/Device/components/ControlBar/Volume/index.vue')['default'] - Wireless: typeof import('./src/components/Device/components/Wireless/index.vue')['default'] - WirelessAction: typeof import('./src/components/Device/components/WirelessAction/index.vue')['default'] } export interface ComponentCustomProperties { vLoading: typeof import('element-plus/es')['ElLoadingDirective'] diff --git a/electron/main.js b/electron/main.js index 76b0e9a..f037f6d 100644 --- a/electron/main.js +++ b/electron/main.js @@ -27,8 +27,6 @@ log.initialize({ preload: true }) const debug = !!appStore.get('common.debug') -log.info('Debug Status:', debug) - if (!debug) { log.warn( 'Debug Tips:', diff --git a/package.json b/package.json index 56f04b1..cdfb6fb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "escrcpy", "type": "module", - "version": "1.19.4", + "version": "1.20.1", "private": true, "description": "Scrcpy Powered by Electron", "author": "viarotel", diff --git a/src/App.vue b/src/App.vue index 16fc657..746ac26 100644 --- a/src/App.vue +++ b/src/App.vue @@ -33,7 +33,7 @@ import { ElMessageBox } from 'element-plus' import Device from './components/Device/index.vue' import Preference from './components/Preference/index.vue' import About from './components/About/index.vue' -import AppSearch from './components/AppSearch/index.vue' +import AppSearch from './components/Search/index.vue' import { useThemeStore } from '$/store/theme/index.js' import { usePreferenceStore } from '$/store/preference/index.js' diff --git a/src/components/Device/components/BatchActions/AppInstall/index.vue b/src/components/Device/components/BatchActions/Application/index.vue similarity index 67% rename from src/components/Device/components/BatchActions/AppInstall/index.vue rename to src/components/Device/components/BatchActions/Application/index.vue index 7aeef33..5482a82 100644 --- a/src/components/Device/components/BatchActions/AppInstall/index.vue +++ b/src/components/Device/components/BatchActions/Application/index.vue @@ -1,17 +1,17 @@ + + diff --git a/src/components/Device/components/BatchActions/index.vue b/src/components/Device/components/BatchActions/index.vue index 8073157..33468c0 100644 --- a/src/components/Device/components/BatchActions/index.vue +++ b/src/components/Device/components/BatchActions/index.vue @@ -1,5 +1,5 @@ - {{ $t('common.batch') }}{{ $t(item.label) }} + {{ $t('common.batch') }}-{{ $t(item.label) }} @@ -39,11 +39,13 @@ diff --git a/src/plugins/element-plus/index.js b/src/plugins/element-plus/index.js index 7874d74..0e07347 100644 --- a/src/plugins/element-plus/index.js +++ b/src/plugins/element-plus/index.js @@ -8,12 +8,22 @@ import 'element-plus/theme-chalk/el-message-box.css' import 'element-plus/theme-chalk/dark/css-vars.css' import './restyle.css' +import EleIconLoading from './components/EleIconLoading/index.vue' + export default { install(app) { for (const [key, component] of Object.entries(ElementPlusIcons)) { app.component(key, component) } + ElMessage.loading = (message, options = {}) => + ElMessage({ + duration: 0, + ...options, + message, + icon: EleIconLoading, + }) + app.use(ElMessage) app.use(ElMessageBox) app.use(ElLoading) diff --git a/src/styles/css/desktop.css b/src/styles/css/desktop.css index 0ef191f..4b44d67 100644 --- a/src/styles/css/desktop.css +++ b/src/styles/css/desktop.css @@ -7,6 +7,7 @@ html { @screen sm { ::-webkit-scrollbar { width: 8px; + height: 8px; } ::-webkit-scrollbar-track { From 677f30cdc2ab87aef1cf2c3ec1b1d3bc066342c6 Mon Sep 17 00:00:00 2001 From: viarotel Date: Fri, 12 Jul 2024 01:53:09 +0800 Subject: [PATCH 2/7] =?UTF-8?q?perf:=20=E2=9C=A8=20Support=20for=20custom?= =?UTF-8?q?=20startup=20mirroring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 2 +- README-CN.md | 12 +- README.md | 12 +- .../MoreDropdown/components/Camera/index.vue | 2 + .../Custom/components/DeployDialog/index.vue | 94 +++++++++ .../MoreDropdown/components/Custom/index.vue | 84 ++++++++ .../Device/components/MoreDropdown/index.vue | 7 + .../PreferenceForm/components/Input/index.vue | 26 +++ .../components/InputNumber/index.vue | 27 +++ .../components/InputPath}/index.vue | 8 +- .../components/Select/index.vue | 31 +++ .../components/SelectAudioCodec}/index.vue | 4 +- .../components/SelectDisplay}/index.vue | 6 +- .../SelectKeyboardInject}/index.vue | 5 +- .../components/SelectLanguage}/index.vue | 4 +- .../components/SelectVideoCodec}/index.vue | 4 +- .../components/Switch/index.vue | 16 ++ .../PreferenceForm/components/index.js | 30 +++ .../components/PreferenceForm/index.vue | 195 ++++++++++++++++++ src/components/Preference/index.vue | 169 ++------------- src/locales/languages/en-US.json | 1 + src/locales/languages/zh-CN.json | 1 + src/locales/languages/zh-TW.json | 1 + src/plugins/element-plus/restyle.css | 13 ++ src/store/preference/helpers/index.js | 6 +- src/store/preference/index.js | 25 +-- src/store/preference/model/audio/index.js | 4 +- src/store/preference/model/camera/index.js | 2 +- src/store/preference/model/common/index.js | 3 + src/store/preference/model/record/index.js | 2 +- src/store/preference/model/video/index.js | 8 +- src/store/preference/model/window/index.js | 8 +- 32 files changed, 602 insertions(+), 210 deletions(-) create mode 100644 src/components/Device/components/MoreDropdown/components/Custom/components/DeployDialog/index.vue create mode 100644 src/components/Device/components/MoreDropdown/components/Custom/index.vue create mode 100644 src/components/Preference/components/PreferenceForm/components/Input/index.vue create mode 100644 src/components/Preference/components/PreferenceForm/components/InputNumber/index.vue rename src/components/Preference/components/{PathInput => PreferenceForm/components/InputPath}/index.vue (92%) create mode 100644 src/components/Preference/components/PreferenceForm/components/Select/index.vue rename src/components/Preference/components/{AudioCodecSelect => PreferenceForm/components/SelectAudioCodec}/index.vue (94%) rename src/components/Preference/components/{DisplaySelect => PreferenceForm/components/SelectDisplay}/index.vue (93%) rename src/components/Preference/components/{KeyboardInjectSelect => PreferenceForm/components/SelectKeyboardInject}/index.vue (89%) rename src/components/Preference/components/{LanguageSelect => PreferenceForm/components/SelectLanguage}/index.vue (91%) rename src/components/Preference/components/{VideoCodecSelect => PreferenceForm/components/SelectVideoCodec}/index.vue (94%) create mode 100644 src/components/Preference/components/PreferenceForm/components/Switch/index.vue create mode 100644 src/components/Preference/components/PreferenceForm/components/index.js create mode 100644 src/components/Preference/components/PreferenceForm/index.vue diff --git a/.vscode/settings.json b/.vscode/settings.json index ffb9835..6c650fc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -30,7 +30,7 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "i18n-ally.localesPaths": ["src/locales/index.js", "src/locales/languages"], - "i18n-ally.sourceLanguage": "en", + "i18n-ally.sourceLanguage": "zh-CN", "i18n-ally.keystyle": "nested", "i18n-ally.extract.ignored": [ "Switch", diff --git a/README-CN.md b/README-CN.md index 03ff1cb..c5e4adf 100644 --- a/README-CN.md +++ b/README-CN.md @@ -84,6 +84,7 @@ Windows 及 Linux 端内部集成了 Gnirehtet, 用于提供 PC 到安卓设 - 录制 - OTG - 摄像 +- 灵活启动 ### 设备交互栏 @@ -204,11 +205,12 @@ Windows 及 Linux 端内部集成了 Gnirehtet, 用于提供 PC 到安卓设 16. 支持使用内置终端执行自定义命令 ✅ 17. 支持设备自动执行镜像 ✅ 18. 支持常用批量功能 ✅ -19. 支持更多批量处理功能 🚧 -20. 支持对设备进行分组 🚧 -21. 添加文件传输助手功能 🚧 -22. 支持通过界面从设备下载选中的文件 🚧 -23. 添加对游戏的增强功能,如游戏键位映射 🚧 +19. 支持灵活启动镜像 ✅ +20. 支持更多批量处理功能 🚧 +21. 支持对设备进行分组 🚧 +22. 添加文件传输助手功能 🚧 +23. 支持通过界面从设备下载选中的文件 🚧 +24. 添加对游戏的增强功能,如游戏键位映射 🚧 ## 常见问题 diff --git a/README.md b/README.md index 17b766c..a5f8335 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master - Recording - OTG - Camera +- Custom ### Device Interaction Bar @@ -202,11 +203,12 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master 16. Support to use built-in terminals to execute custom commands ✅ 17. Supports automatic execution of mirror on devices ✅ 18. Support common batch processing function ✅ -19. Support more batch processing functions 🚧 -20. Support the device to group 🚧 -21. Add file transmission assistant function 🚧 -22. Support GUI-based selective file downloads from devices 🚧 -23. Add game enhancement features such as game keyboard mapping 🚧 +19. Support for custom startup mirroring ✅ +20. Support more batch processing functions 🚧 +21. Support the device to group 🚧 +22. Add file transmission assistant function 🚧 +23. Support GUI-based selective file downloads from devices 🚧 +24. Add game enhancement features such as game keyboard mapping 🚧 ## FAQ diff --git a/src/components/Device/components/MoreDropdown/components/Camera/index.vue b/src/components/Device/components/MoreDropdown/components/Camera/index.vue index b206722..e7cf886 100644 --- a/src/components/Device/components/MoreDropdown/components/Camera/index.vue +++ b/src/components/Device/components/MoreDropdown/components/Camera/index.vue @@ -45,6 +45,8 @@ export default { }, )}` + console.log('args', args) + try { const mirroring = this.$scrcpy.mirror(row.id, { title: this.$store.device.getLabel(row), diff --git a/src/components/Device/components/MoreDropdown/components/Custom/components/DeployDialog/index.vue b/src/components/Device/components/MoreDropdown/components/Custom/components/DeployDialog/index.vue new file mode 100644 index 0000000..3d707d6 --- /dev/null +++ b/src/components/Device/components/MoreDropdown/components/Custom/components/DeployDialog/index.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/components/Device/components/MoreDropdown/components/Custom/index.vue b/src/components/Device/components/MoreDropdown/components/Custom/index.vue new file mode 100644 index 0000000..a92bc14 --- /dev/null +++ b/src/components/Device/components/MoreDropdown/components/Custom/index.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/components/Device/components/MoreDropdown/index.vue b/src/components/Device/components/MoreDropdown/index.vue index 9197deb..d5be13a 100644 --- a/src/components/Device/components/MoreDropdown/index.vue +++ b/src/components/Device/components/MoreDropdown/index.vue @@ -41,17 +41,20 @@ import Record from './components/Record/index.vue' import Otg from './components/Otg/index.vue' import Camera from './components/Camera/index.vue' +import Custom from './components/Custom/index.vue' export default { components: { Record, Otg, Camera, + Custom, }, props: { ...Record.props, ...Otg.props, ...Camera.props, + ...Custom.props, }, data() { return { @@ -68,6 +71,10 @@ export default { label: 'device.actions.more.camera.name', component: 'Camera', }, + { + label: 'device.actions.more.custom.name', + component: 'Custom', + }, ], } }, diff --git a/src/components/Preference/components/PreferenceForm/components/Input/index.vue b/src/components/Preference/components/PreferenceForm/components/Input/index.vue new file mode 100644 index 0000000..b6858ef --- /dev/null +++ b/src/components/Preference/components/PreferenceForm/components/Input/index.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/components/Preference/components/PreferenceForm/components/InputNumber/index.vue b/src/components/Preference/components/PreferenceForm/components/InputNumber/index.vue new file mode 100644 index 0000000..713d270 --- /dev/null +++ b/src/components/Preference/components/PreferenceForm/components/InputNumber/index.vue @@ -0,0 +1,27 @@ + + + + + diff --git a/src/components/Preference/components/PathInput/index.vue b/src/components/Preference/components/PreferenceForm/components/InputPath/index.vue similarity index 92% rename from src/components/Preference/components/PathInput/index.vue rename to src/components/Preference/components/PreferenceForm/components/InputPath/index.vue index 1039224..abe3404 100644 --- a/src/components/Preference/components/PathInput/index.vue +++ b/src/components/Preference/components/PreferenceForm/components/InputPath/index.vue @@ -1,11 +1,11 @@ + + diff --git a/src/components/Preference/index.vue b/src/components/Preference/index.vue index d53baf6..9a2d061 100644 --- a/src/components/Preference/index.vue +++ b/src/components/Preference/index.vue @@ -4,43 +4,11 @@ class="mr-4 pb-4 flex items-center justify-between flex-none border-b border-gray-200 dark:border-gray-700" >
- - - - - + @device-change="onDeviceChange" + />
@@ -52,7 +20,7 @@ {{ $t('preferences.config.edit.name') }} - + {{ $t('preferences.config.reset.name') }}
@@ -73,47 +41,32 @@ From 33b018110cc7727a822f61b97ae5c5f1211adb0c Mon Sep 17 00:00:00 2001 From: viarotel Date: Fri, 12 Jul 2024 15:58:13 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=F0=9F=93=9D=20Update=20Translation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Custom/components/DeployDialog/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Device/components/MoreDropdown/components/Custom/components/DeployDialog/index.vue b/src/components/Device/components/MoreDropdown/components/Custom/components/DeployDialog/index.vue index 3d707d6..4f014b7 100644 --- a/src/components/Device/components/MoreDropdown/components/Custom/components/DeployDialog/index.vue +++ b/src/components/Device/components/MoreDropdown/components/Custom/components/DeployDialog/index.vue @@ -3,7 +3,7 @@ - 取消 + {{ $t('common.cancel') }} - 确定 + {{ $t('common.confirm') }} From 2013413611b3efe44811b230ceea036eba310026 Mon Sep 17 00:00:00 2001 From: viarotel Date: Fri, 12 Jul 2024 20:11:44 +0800 Subject: [PATCH 5/7] =?UTF-8?q?feat:=20=F0=9F=9A=80=20Support=20execution?= =?UTF-8?q?=20script=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/exposes/adbkit/index.js | 4 +- .../components/ControlBar/Shell/index.vue | 80 +++++++++++++++++++ .../Device/components/ControlBar/index.vue | 8 ++ .../components/TerminalDialog/index.vue | 39 ++++++--- .../components/TerminalAction/index.vue | 3 + src/components/Device/index.vue | 7 +- src/locales/languages/en-US.json | 6 ++ src/locales/languages/zh-CN.json | 6 ++ src/locales/languages/zh-TW.json | 6 ++ 9 files changed, 145 insertions(+), 14 deletions(-) create mode 100644 src/components/Device/components/ControlBar/Shell/index.vue diff --git a/electron/exposes/adbkit/index.js b/electron/exposes/adbkit/index.js index ec5471c..6d7ced3 100644 --- a/electron/exposes/adbkit/index.js +++ b/electron/exposes/adbkit/index.js @@ -198,8 +198,8 @@ const push = async ( progress?.(stats) }) - res.on('end', (ret) => { - resolve(ret) + res.on('end', () => { + resolve(savePath) }) res.on('error', (err) => { diff --git a/src/components/Device/components/ControlBar/Shell/index.vue b/src/components/Device/components/ControlBar/Shell/index.vue new file mode 100644 index 0000000..7a32e42 --- /dev/null +++ b/src/components/Device/components/ControlBar/Shell/index.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/src/components/Device/components/ControlBar/index.vue b/src/components/Device/components/ControlBar/index.vue index 2718789..6fa4f62 100644 --- a/src/components/Device/components/ControlBar/index.vue +++ b/src/components/Device/components/ControlBar/index.vue @@ -72,6 +72,7 @@ import MirrorGroup from './MirrorGroup/index.vue' import Rotation from './Rotation/index.vue' import Volume from './Volume/index.vue' import FileManage from './FileManage/index.vue' +import Shell from './Shell/index.vue' export default { components: { @@ -82,6 +83,7 @@ export default { Rotation, Volume, FileManage, + Shell, }, props: { device: { @@ -149,6 +151,12 @@ export default { svgIcon: 'file-send', component: 'FileManage', }, + { + label: 'device.control.shell.name', + svgIcon: 'command', + component: 'Shell', + tips: 'device.control.shell.tips', + }, { label: 'device.control.gnirehtet', elIcon: 'Link', diff --git a/src/components/Device/components/TerminalAction/components/TerminalDialog/index.vue b/src/components/Device/components/TerminalAction/components/TerminalDialog/index.vue index 1254b3c..24287fa 100644 --- a/src/components/Device/components/TerminalAction/components/TerminalDialog/index.vue +++ b/src/components/Device/components/TerminalAction/components/TerminalDialog/index.vue @@ -4,8 +4,9 @@ width="80%" :close-on-click-modal="false" :close-on-press-escape="true" + destroy-on-close class="overflow-hidden !rounded-md el-dialog-headless dark:border dark:border-gray-700" - @open="onOpen" + @closed="onClosed" > diff --git a/src/components/Device/components/TerminalAction/index.vue b/src/components/Device/components/TerminalAction/index.vue index 65e4b36..f514f5f 100644 --- a/src/components/Device/components/TerminalAction/index.vue +++ b/src/components/Device/components/TerminalAction/index.vue @@ -22,6 +22,9 @@ export default { handleShow() { this.$refs.terminalDialog.show() }, + invoke(...args) { + this.$refs.terminalDialog.invoke(...args) + }, }, } diff --git a/src/components/Device/index.vue b/src/components/Device/index.vue index b10128e..101dba8 100644 --- a/src/components/Device/index.vue +++ b/src/components/Device/index.vue @@ -28,7 +28,7 @@ {{ $t('device.log.name') }} - + this.$refs.terminalActionRef.invoke(...args), + } + }, data() { return { loading: false, diff --git a/src/locales/languages/en-US.json b/src/locales/languages/en-US.json index f076f73..4f310e2 100644 --- a/src/locales/languages/en-US.json +++ b/src/locales/languages/en-US.json @@ -102,6 +102,12 @@ "device.control.file.push.success": "Successfully pushed {totalCount} files to the /sdcard/Download/ directory of {deviceName}, {successCount} succeeded, and {failCount} failed", "device.control.file.push.success.single": "Files successfully pushed to the /sdcard/Download/ directory of {deviceName}", "device.control.file.push.error": "Failed to push the file, please check the file and try again", + "device.control.shell.name": "Execute Script", + "device.control.shell.tips": "Perform custom script through the ADB command", + "device.control.shell.select": "Please select the script you want to execute", + "device.control.shell.pushing": "Push script", + "device.control.shell.success": "Push script successfully", + "device.control.shell.enter": "Please enter the Enter key to confirm the execution of the script", "device.control.capture": "Screenshot", "device.control.capture.progress": "Capturing screenshot for {deviceName}...", "device.control.capture.success.message": "Open screenshot location?", diff --git a/src/locales/languages/zh-CN.json b/src/locales/languages/zh-CN.json index a16fa11..bde1b4b 100644 --- a/src/locales/languages/zh-CN.json +++ b/src/locales/languages/zh-CN.json @@ -102,6 +102,12 @@ "device.control.file.push.success": "已成功将 {totalCount} 个文件推送到 {deviceName} 的 /sdcard/Download/ 目录,{successCount} 成功,{failCount} 失败。", "device.control.file.push.success.single": "文件已成功推送到 {deviceName} 的 /sdcard/Download/ 目录", "device.control.file.push.error": "推送文件失败,请检查文件后重试", + "device.control.shell.name": "执行脚本", + "device.control.shell.tips": "通过 ADB 命令执行自定义脚本", + "device.control.shell.select": "请选择要执行的脚本", + "device.control.shell.pushing": "推送脚本中", + "device.control.shell.success": "推送脚本成功", + "device.control.shell.enter": "请输入回车键确认执行该脚本", "device.control.capture": "截取屏幕", "device.control.capture.progress": "正在截取 {deviceName} 的屏幕快照...", "device.control.capture.success.message": "是否前往截屏位置进行查看?", diff --git a/src/locales/languages/zh-TW.json b/src/locales/languages/zh-TW.json index 46a6f13..e366e99 100644 --- a/src/locales/languages/zh-TW.json +++ b/src/locales/languages/zh-TW.json @@ -102,6 +102,12 @@ "device.control.file.push.success": "已成功將 {totalCount} 個檔案推送到 {deviceName} 的 /sdcard/Download/ 目錄,{successCount} 成功,{failCount} 失敗。", "device.control.file.push.success.single": "檔案已成功推送到 {deviceName} 的 /sdcard/Download/ 目錄", "device.control.file.push.error": "推送檔案失敗,請檢查檔案後重試", + "device.control.shell.name": "執行腳本", + "device.control.shell.tips": "透過 ADB 命令執行自訂腳本", + "device.control.shell.select": "請選擇要執行的腳本", + "device.control.shell.pushing": "推送腳本中", + "device.control.shell.success": "推送腳本成功", + "device.control.shell.enter": "請輸入回車鍵確認執行該腳本", "device.control.capture": "擷取螢幕", "device.control.capture.progress": "正在擷取 {deviceName} 的螢幕快照...", "device.control.capture.success.message": "是否前往截圖位置進行檢視?", From 8097022798ca3ea95ed6530a722f321a862f2e23 Mon Sep 17 00:00:00 2001 From: viarotel Date: Sat, 13 Jul 2024 17:05:17 +0800 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20=F0=9F=8E=89=20Support=20batch=20ex?= =?UTF-8?q?ecution=20script=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc-auto-import.json | 3 +- README-CN.md | 17 +- README.md | 21 +- auto-imports.d.ts | 1 + .../BatchActions/Application/index.vue | 41 ++- .../BatchActions/FileManage/index.vue | 71 ++++++ .../BatchActions/Screenshot/index.vue | 21 +- .../components/BatchActions/Shell/index.vue | 83 +++++++ .../Device/components/BatchActions/index.vue | 56 ++--- .../ControlBar/Application/index.vue | 53 ++-- .../ControlBar/FileManage/index.vue | 157 ++++++------ .../components/ControlBar/Gnirehtet/index.vue | 6 +- .../components/ControlBar/Shell/index.vue | 59 ++--- .../components/TerminalDialog/index.vue | 235 ++++++++++-------- .../components/TerminalAction/index.vue | 2 +- src/locales/languages/en-US.json | 8 +- src/locales/languages/zh-CN.json | 8 +- src/locales/languages/zh-TW.json | 8 +- src/plugins/element-plus/index.js | 8 +- src/utils/device/index.js | 66 +++++ src/utils/index.js | 37 +++ 21 files changed, 635 insertions(+), 326 deletions(-) create mode 100644 src/components/Device/components/BatchActions/FileManage/index.vue create mode 100644 src/components/Device/components/BatchActions/Shell/index.vue create mode 100644 src/utils/device/index.js diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json index 74a9e1d..385207c 100644 --- a/.eslintrc-auto-import.json +++ b/.eslintrc-auto-import.json @@ -79,6 +79,7 @@ "watch": true, "watchEffect": true, "watchPostEffect": true, - "watchSyncEffect": true + "watchSyncEffect": true, + "ElMessage": true } } diff --git a/README-CN.md b/README-CN.md index c5e4adf..07802d6 100644 --- a/README-CN.md +++ b/README-CN.md @@ -76,7 +76,10 @@ Windows 及 Linux 端内部集成了 Gnirehtet, 用于提供 PC 到安卓设 ### 批量处理 +- 批量截取屏幕 - 批量安装应用 +- 批量文件管理 +- 批量执行脚本 ### 控制模式 @@ -99,6 +102,7 @@ Windows 及 Linux 端内部集成了 Gnirehtet, 用于提供 PC 到安卓设 - 重启设备 - 安装应用 - 文件管理 +- 执行脚本 - 反向供网(Gnirehtet) - 多屏协同 @@ -204,13 +208,12 @@ Windows 及 Linux 端内部集成了 Gnirehtet, 用于提供 PC 到安卓设 15. 支持批量连接历史设备功能 ✅ 16. 支持使用内置终端执行自定义命令 ✅ 17. 支持设备自动执行镜像 ✅ -18. 支持常用批量功能 ✅ -19. 支持灵活启动镜像 ✅ -20. 支持更多批量处理功能 🚧 -21. 支持对设备进行分组 🚧 -22. 添加文件传输助手功能 🚧 -23. 支持通过界面从设备下载选中的文件 🚧 -24. 添加对游戏的增强功能,如游戏键位映射 🚧 +18. 支持灵活启动镜像 ✅ +19. 支持常用批量功能 ✅ +20. 支持对设备进行分组 🚧 +21. 添加文件传输助手功能 🚧 +22. 支持通过界面从设备下载选中的文件 🚧 +23. 添加对游戏的增强功能,如游戏键位映射 🚧 ## 常见问题 diff --git a/README.md b/README.md index a5f8335..ff7a4d2 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,10 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master ### Batch Processing -- Batch installation application +- Batch Interception Screen +- Batch Installation Application +- Batch File Management +- Batch Execution Script ### Control Model @@ -97,6 +100,7 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master - Reboot - Install APP - File Manager +- Execution Script - Gnirehtet - Mirror Group @@ -201,14 +205,13 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master 14. Add more features to device interaction bar: file push, screen rotation, audio control etc ✅ 15. Support bulk connecting to historical devices ✅ 16. Support to use built-in terminals to execute custom commands ✅ -17. Supports automatic execution of mirror on devices ✅ -18. Support common batch processing function ✅ -19. Support for custom startup mirroring ✅ -20. Support more batch processing functions 🚧 -21. Support the device to group 🚧 -22. Add file transmission assistant function 🚧 -23. Support GUI-based selective file downloads from devices 🚧 -24. Add game enhancement features such as game keyboard mapping 🚧 +17. Support automatic execution of mirror on devices ✅ +18. Support for custom startup mirroring ✅ +19. Support common batch processing function ✅ +20. Support the device to group 🚧 +21. Add file transmission assistant function 🚧 +22. Support GUI-based selective file downloads from devices 🚧 +23. Add game enhancement features such as game keyboard mapping 🚧 ## FAQ diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 0ce0ca8..9c51698 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -6,6 +6,7 @@ export {} declare global { const EffectScope: typeof import('vue')['EffectScope'] + const ElMessage: typeof import('element-plus/es')['ElMessage'] const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'] const computed: typeof import('vue')['computed'] const createApp: typeof import('vue')['createApp'] diff --git a/src/components/Device/components/BatchActions/Application/index.vue b/src/components/Device/components/BatchActions/Application/index.vue index e785c4d..6453d4f 100644 --- a/src/components/Device/components/BatchActions/Application/index.vue +++ b/src/components/Device/components/BatchActions/Application/index.vue @@ -1,13 +1,13 @@ + + diff --git a/src/components/Device/components/BatchActions/Screenshot/index.vue b/src/components/Device/components/BatchActions/Screenshot/index.vue index 4adeb46..353f2d5 100644 --- a/src/components/Device/components/BatchActions/Screenshot/index.vue +++ b/src/components/Device/components/BatchActions/Screenshot/index.vue @@ -1,13 +1,13 @@ + + diff --git a/src/components/Device/components/BatchActions/index.vue b/src/components/Device/components/BatchActions/index.vue index 33468c0..566b065 100644 --- a/src/components/Device/components/BatchActions/index.vue +++ b/src/components/Device/components/BatchActions/index.vue @@ -38,41 +38,41 @@ - diff --git a/src/components/Device/components/ControlBar/Application/index.vue b/src/components/Device/components/ControlBar/Application/index.vue index c4559db..d7cb061 100644 --- a/src/components/Device/components/ControlBar/Application/index.vue +++ b/src/components/Device/components/ControlBar/Application/index.vue @@ -5,6 +5,8 @@ diff --git a/src/components/Device/components/ControlBar/Gnirehtet/index.vue b/src/components/Device/components/ControlBar/Gnirehtet/index.vue index a3e2623..4881bd1 100644 --- a/src/components/Device/components/ControlBar/Gnirehtet/index.vue +++ b/src/components/Device/components/ControlBar/Gnirehtet/index.vue @@ -7,7 +7,7 @@ @@ -48,9 +48,7 @@ export default { try { await this.$gnirehtet.run(this.device.id) await sleep() - this.$message.success( - this.$t('device.control.gnirehtet.start.success'), - ) + this.$message.success(this.$t('device.control.gnirehtet.start.success')) } catch (error) { this.$message.warning(error.message || 'Start service failure') diff --git a/src/components/Device/components/ControlBar/Shell/index.vue b/src/components/Device/components/ControlBar/Shell/index.vue index 7a32e42..646ad01 100644 --- a/src/components/Device/components/ControlBar/Shell/index.vue +++ b/src/components/Device/components/ControlBar/Shell/index.vue @@ -6,74 +6,45 @@ diff --git a/src/components/Device/components/TerminalAction/components/TerminalDialog/index.vue b/src/components/Device/components/TerminalAction/components/TerminalDialog/index.vue index 24287fa..52b84f2 100644 --- a/src/components/Device/components/TerminalAction/components/TerminalDialog/index.vue +++ b/src/components/Device/components/TerminalAction/components/TerminalDialog/index.vue @@ -4,27 +4,26 @@ width="80%" :close-on-click-modal="false" :close-on-press-escape="true" - destroy-on-close + :destroy-on-close="true" class="overflow-hidden !rounded-md el-dialog-headless dark:border dark:border-gray-700" @closed="onClosed" > - @@ -37,125 +36,141 @@ -