perf: Support bulk connecting to historical devices

This commit is contained in:
viarotel 2023-11-10 10:15:52 +08:00
parent 9d6366f75c
commit b7eb1dd0d6
4 changed files with 35 additions and 6 deletions

View File

@ -176,7 +176,7 @@ Windows 及 Linux 端内部集成了 Gnirehtet 用于提供 PC 到安卓设
12. 添加新的相机镜像相关功能 ✅
13. 更好的多屏协同 ✅
14. 设备交互栏添加更多功能:文件推送、旋转屏幕、音频控制等功能 ✅
15. 支持批量连接历史设备功能 🚧
15. 支持批量连接历史设备功能
16. 添加独立的剪切板同步功能 🚧
17. 支持通过界面从设备下载选中的文件 🚧
18. 支持对设备进行分组,以及按组进行批量操作 🚧

View File

@ -174,7 +174,7 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master
12. Add new camera mirror related features ✅
13. Better multi -screen collaboration ✅
14. Add more features to device interaction bar: file push, screen rotation, audio control etc ✅
15. Support bulk connecting to historical devices 🚧
15. Support bulk connecting to historical devices
16. Add standalone clipboard sync feature 🚧
17. Support GUI-based selective file downloads from devices 🚧
18. Support grouping devices and bulk operations by group 🚧

View File

@ -12,6 +12,22 @@
<template #prepend>
{{ $t("device.wireless.name") }}
</template>
<template #default="{ item }">
<div
v-if="item.batch"
text
type="primary"
class="text-primary-500"
@click.stop="handleBatch"
>
{{ item.batch }}
</div>
<template v-else>
{{ item.host }}
</template>
</template>
</el-autocomplete>
<div class="text-gray-500 text-sm">
:
@ -83,15 +99,26 @@ export default {
)
}
else {
results = this.wirelessList
results = [...this.wirelessList]
}
results.push({
batch: '连接所有历史设备',
})
callback(results)
},
onPairSuccess() {
this.handleConnect()
},
async handleConnect(params = this.formData) {
async handleBatch() {
for (let index = 0; index < this.wirelessList.length; index++) {
const item = this.wirelessList[index]
await this.handleConnect(item, { successTips: false })
}
this.$message.success(this.$t('device.wireless.connect.success'))
},
async handleConnect(params = this.formData, { successTips = true } = {}) {
if (!params.host) {
this.$message.warning(
this.$t('device.wireless.connect.error.no-address'),
@ -103,7 +130,9 @@ export default {
try {
await this.$adb.connect(params.host, params.port || 5555)
this.$message.success(this.$t('device.wireless.connect.success'))
if (successTips) {
this.$message.success(this.$t('device.wireless.connect.success'))
}
this.handleSave(params)
}

View File

@ -25,7 +25,7 @@
"device.remark": "备注",
"device.permission.error": "设备可能未授权成功请重新插拔设备并点击允许USB调试",
"device.wireless.name": "无线连接",
"device.wireless.name": "无线",
"device.wireless.mode": "无线模式",
"device.wireless.mode.error": "没有获取到局域网连接地址,请检查网络",
"device.wireless.connect.name": "连接设备",