mirror of
https://github.com/viarotel-org/escrcpy.git
synced 2025-02-20 20:21:38 +01:00
fix: 🔨 修复无线配对时表单验证错误
This commit is contained in:
parent
8de04e0d6a
commit
7cd9ea3ae5
@ -48,3 +48,4 @@ publish:
|
||||
provider: github
|
||||
owner: viarotel-org
|
||||
repo: escrcpy
|
||||
updaterCacheDirName: escrcpy-updater
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "escrcpy",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"description": "Scrcpy Powered by Electron",
|
||||
"author": "viarotel",
|
||||
"homepage": "https://github.com/viarotel-org/escrcpy",
|
||||
|
@ -1,15 +1,23 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" title="无线配对" width="600" append-to-body>
|
||||
<el-dialog v-model="visible" title="无线配对" width="600" append-to-body destroy-on-close>
|
||||
<div class="text-red-500 text-sm pb-8 pl-4">
|
||||
注意:可以在 开发者选项 -> 无线调试(可以点进去) -> 使用配对码配对设备 中获取以下信息
|
||||
</div>
|
||||
|
||||
<el-form :model="formData" label-width="100px">
|
||||
<el-form-item label="配对IP地址" prop="host">
|
||||
<el-form ref="elForm" :model="formData" label-width="100px">
|
||||
<el-form-item
|
||||
label="配对IP地址"
|
||||
prop="host"
|
||||
:rules="[{ required: true, message: '配对码不能为空' }]"
|
||||
>
|
||||
<el-input v-model="formData.host" placeholder="请输入配对IP地址" class="" clearable>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="配对端口号" prop="port">
|
||||
<el-form-item
|
||||
label="配对端口号"
|
||||
prop="port"
|
||||
:rules="[{ required: true, message: '配对码不能为空' }]"
|
||||
>
|
||||
<el-input
|
||||
v-model.number="formData.port"
|
||||
type="number"
|
||||
@ -73,14 +81,17 @@ export default {
|
||||
},
|
||||
async handleSubmit() {
|
||||
try {
|
||||
await this.$refs.elForm.validate()
|
||||
const command = `pair ${this.formData.host}:${this.formData.port} ${this.formData.pair}`
|
||||
// console.log(command)
|
||||
await this.$adb.rawShell(command)
|
||||
await this.$adb.shell(command)
|
||||
this.$emit('success')
|
||||
this.handleClose()
|
||||
}
|
||||
catch (error) {
|
||||
this.$message.warning(error.message)
|
||||
if (error.message) {
|
||||
this.$message.warning(error.message)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -65,19 +65,30 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="350" align="left">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" :loading="row.$loading" @click="handleMirror(row)">
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="row.$loading"
|
||||
:disabled="row.$unauthorized"
|
||||
@click="handleMirror(row)"
|
||||
>
|
||||
{{ row.$loading ? '镜像中' : '开始镜像' }}
|
||||
</el-button>
|
||||
<el-button v-if="!row.$wireless" type="primary" @click="handleWifi(row)">
|
||||
<el-button
|
||||
v-if="!row.$wireless"
|
||||
type="primary"
|
||||
:disabled="row.$unauthorized"
|
||||
@click="handleWifi(row)"
|
||||
>
|
||||
无线模式
|
||||
</el-button>
|
||||
<el-button type="default" @click="handleScreenUp(row)">
|
||||
<el-button type="default" :disabled="row.$unauthorized" @click="handleScreenUp(row)">
|
||||
点亮屏幕
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.$wireless"
|
||||
type="danger"
|
||||
:loading="row.$stopLoading"
|
||||
:disabled="row.$unauthorized"
|
||||
@click="handleStop(row)"
|
||||
>
|
||||
{{ row.$stopLoading ? '断开中' : '断开连接' }}
|
||||
@ -182,7 +193,7 @@ export default {
|
||||
'连接设备失败',
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
confirmButtonText: '配对',
|
||||
confirmButtonText: '无线配对',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
},
|
||||
@ -215,7 +226,9 @@ export default {
|
||||
)
|
||||
}
|
||||
catch (error) {
|
||||
this.$message.warning(error.message)
|
||||
if (error.message) {
|
||||
this.$message.warning(error.message)
|
||||
}
|
||||
}
|
||||
row.$loading = false
|
||||
},
|
||||
@ -257,8 +270,9 @@ export default {
|
||||
console.log('getDeviceData.data', this.deviceList)
|
||||
}
|
||||
catch (error) {
|
||||
if (error.message)
|
||||
if (error.message) {
|
||||
this.$message.warning(error.message)
|
||||
}
|
||||
this.deviceList = []
|
||||
}
|
||||
this.loading = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user