perf: ⬆️ Improved performance of automated mirroring

This commit is contained in:
viarotel 2025-02-13 09:56:08 +08:00
parent d054f8df6c
commit 33a03c3f63
6 changed files with 21 additions and 6 deletions

View File

@ -1,4 +1,9 @@
export const deviceStatus = [
{
label: 'device.status.connected',
value: 'emulator',
tagType: 'success',
},
{
label: 'device.status.connected',
value: 'device',
@ -14,4 +19,9 @@ export const deviceStatus = [
value: 'offline',
tagType: 'info',
},
{
label: 'device.status.authorizing',
value: 'authorizing',
tagType: 'warning',
},
]

View File

@ -69,6 +69,7 @@
"device.status.connected": "Connected",
"device.status.offline": "Offline",
"device.status.unauthorized": "Unauthorized",
"device.status.authorizing": "authorizing",
"device.battery": "Device Battery",
"device.isCharging": "Charging Status",
"device.temperature": "Device Temperature",

View File

@ -67,6 +67,7 @@
"device.terminal.name": "Терминал",
"device.status": "Статус",
"device.status.connected": "Подключено",
"device.status.authorizing": "Авторизация",
"device.status.offline": "Не в сети",
"device.status.unauthorized": "Не авторизован",
"device.battery": "Уровень заряда устройства",

View File

@ -69,6 +69,7 @@
"device.status.offline": "已离线",
"device.status.unauthorized": "未授权",
"device.status.connected": "已连接",
"device.status.authorizing": "授权中",
"device.battery": "设备电量",
"device.isCharging": "充电状态",
"device.temperature": "设备温度",

View File

@ -69,6 +69,7 @@
"device.status.connected": "已連接",
"device.status.offline": "已離線",
"device.status.unauthorized": "未授權",
"device.status.authorizing": "授權中",
"device.battery": "設備電量",
"device.isCharging": "充電狀態",
"device.temperature": "設備溫度",

View File

@ -88,7 +88,7 @@
</el-table-column>
<el-table-column
v-slot="{ row, $index }"
v-slot="{ row }"
:label="$t('device.control.name')"
align="left"
width="150"
@ -96,7 +96,7 @@
<div class="flex items-center !space-x-0">
<MirrorAction
v-if="['device', 'unauthorized'].includes(row.status)"
:ref="(value) => getMirrorActionRefs(value, $index)"
:ref="getMirrorActionRefs"
v-bind="{ row, toggleRowExpansion, handleReset }"
/>
@ -240,6 +240,7 @@ export default {
},
async onAdbWatch(type, ret) {
if (ret && ret.id) {
await sleep(1000)
this.getDeviceData()
}
@ -249,7 +250,7 @@ export default {
)
}
},
async getMirrorActionRefs(ref, index) {
async getMirrorActionRefs(ref) {
await this.$nextTick()
if (!ref?.row?.id) {
@ -264,11 +265,11 @@ export default {
return false
}
const length = this.mirrorActionRefs.length
this.mirrorActionRefs.push(ref)
const secondNum = index
await sleep(secondNum * 2000)
await sleep(length * 1000)
const autoMirror = this.$store.preference.data.autoMirror