mirror of
https://github.com/viarotel-org/escrcpy.git
synced 2025-02-20 20:21:38 +01:00
feat: ✨ Support to close the device screen when controlling
This commit is contained in:
parent
10d0370b66
commit
a84c775fa1
@ -10,8 +10,9 @@ export function initControlWindow(mainWindow) {
|
||||
|
||||
const controlWindow = new BrowserWindow({
|
||||
icon: getLogoPath(),
|
||||
width: 500,
|
||||
minWidth: 500,
|
||||
parent: mainWindow,
|
||||
width: 700,
|
||||
minWidth: 700,
|
||||
height: 28,
|
||||
maxHeight: 28,
|
||||
frame: false,
|
||||
|
@ -117,6 +117,12 @@ export default {
|
||||
elIcon: 'Back',
|
||||
command: 'input keyevent 4',
|
||||
},
|
||||
{
|
||||
label: 'device.control.turnScreenOff',
|
||||
elIcon: 'TurnOff',
|
||||
scrcpyCommand: '--turn-screen-off',
|
||||
tips: 'device.control.turnScreenOff.tips',
|
||||
},
|
||||
{
|
||||
label: 'device.control.notification',
|
||||
elIcon: 'Notification',
|
||||
@ -203,13 +209,16 @@ export default {
|
||||
this.$refs.scrollableRef.scrollForward()
|
||||
},
|
||||
handleClick(row, trigger) {
|
||||
if (row?.command) {
|
||||
this.$adb.deviceShell(this.device.id, row.command)
|
||||
if (trigger) {
|
||||
trigger(row)
|
||||
return false
|
||||
}
|
||||
|
||||
if (trigger) {
|
||||
trigger(row)
|
||||
if (row?.command) {
|
||||
this.$adb.deviceShell(this.device.id, row.command)
|
||||
}
|
||||
else if (row?.scrcpyCommand) {
|
||||
this.$scrcpy.control(this.device.id, { command: row.scrcpyCommand })
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -86,7 +86,7 @@
|
||||
<el-table-column
|
||||
v-slot="{ row, $index }"
|
||||
:label="$t('device.control.name')"
|
||||
min-width="300"
|
||||
min-width="250"
|
||||
align="left"
|
||||
>
|
||||
<MirrorAction
|
||||
|
@ -79,7 +79,7 @@
|
||||
"device.task.extra.shell": "Select Script",
|
||||
|
||||
"device.wireless.name": "Wireless",
|
||||
"device.wireless.mode": "Wireless Mode",
|
||||
"device.wireless.mode": "Wireless",
|
||||
"device.wireless.mode.error": "Do not get the local area network connection address, please check the network",
|
||||
"device.wireless.connect.name": "Connect",
|
||||
"device.wireless.connect.error.title": "Connect failed",
|
||||
@ -121,11 +121,11 @@
|
||||
"device.refresh.name": "Refresh",
|
||||
"device.restart.name": "Restart",
|
||||
"device.log.name": "Logs",
|
||||
"device.mirror.start": "Mirror",
|
||||
"device.mirror.start": "Connect",
|
||||
"device.record.progress": "Recording",
|
||||
"device.record.success.title": "Record Success",
|
||||
"device.record.success.message": "Open record location?",
|
||||
"device.actions.more.name": "More Operation",
|
||||
"device.actions.more.name": "Extra",
|
||||
"device.actions.more.record.name": "Start Recording",
|
||||
"device.actions.more.camera.name": "Startup Camera",
|
||||
"device.actions.more.recordCamera.name": "Record Camera",
|
||||
@ -166,6 +166,8 @@
|
||||
"device.control.capture.success.message": "Open screenshot location?",
|
||||
"device.control.capture.success.message.title": "Screenshot Success",
|
||||
"device.control.reboot": "Reboot",
|
||||
"device.control.turnScreenOff": "Turn screen off",
|
||||
"device.control.turnScreenOff.tips": "Turn off the screen without affecting control",
|
||||
"device.control.power": "Power",
|
||||
"device.control.power.tips": "Turn screen on/off",
|
||||
"device.control.notification": "Notification",
|
||||
|
@ -79,7 +79,7 @@
|
||||
"device.task.extra.shell": "Выберите скрипт",
|
||||
|
||||
"device.wireless.name": "По WiFi",
|
||||
"device.wireless.mode": "Режим беспроводного подключения",
|
||||
"device.wireless.mode": "беспроводной",
|
||||
"device.wireless.mode.error": "Не удалось получить адрес подключения локальной сети, проверьте сеть",
|
||||
"device.wireless.connect.name": "Подключиться",
|
||||
"device.wireless.connect.error.title": "Не удалось подключиться",
|
||||
@ -125,7 +125,7 @@
|
||||
"device.record.progress": "Запись",
|
||||
"device.record.success.title": "Запись успешна",
|
||||
"device.record.success.message": "Открыть место сохранения записи?",
|
||||
"device.actions.more.name": "Дополнительные действия",
|
||||
"device.actions.more.name": "дополнительный",
|
||||
"device.actions.more.record.name": "Начать запись",
|
||||
"device.actions.more.camera.name": "Запустить камеры",
|
||||
"device.actions.more.recordCamera.name": "Запись камеры",
|
||||
@ -166,6 +166,8 @@
|
||||
"device.control.capture.success.message": "Открыть место сохранения скриншота?",
|
||||
"device.control.capture.success.message.title": "Скриншот успешно создан",
|
||||
"device.control.reboot": "Перезагрузить",
|
||||
"device.control.turnScreenOff": "Выключить экран",
|
||||
"device.control.turnScreenOff.tips": "Выключить экран без потери управления",
|
||||
"device.control.power": "Питание",
|
||||
"device.control.power.tips": "Включить/выключить экран",
|
||||
"device.control.notification": "Уведомление",
|
||||
|
@ -166,6 +166,8 @@
|
||||
"device.control.capture.success.message": "是否前往截屏位置进行查看?",
|
||||
"device.control.capture.success.message.title": "截屏成功",
|
||||
"device.control.reboot": "重启设备",
|
||||
"device.control.turnScreenOff": "关闭屏幕",
|
||||
"device.control.turnScreenOff.tips": "关闭屏幕而不影响控制",
|
||||
"device.control.power": "电源键",
|
||||
"device.control.power.tips": "可以用来开启或关闭屏幕",
|
||||
"device.control.notification": "通知栏",
|
||||
|
@ -166,6 +166,8 @@
|
||||
"device.control.capture.success.message": "是否前往截圖位置進行檢視?",
|
||||
"device.control.capture.success.message.title": "截圖成功",
|
||||
"device.control.reboot": "重啟裝置",
|
||||
"device.control.turnScreenOff": "關閉螢幕",
|
||||
"device.control.turnScreenOff.tips": "關閉螢幕而不影響控制",
|
||||
"device.control.power": "電源鍵",
|
||||
"device.control.power.tips": "可以用來開啟或關閉螢幕",
|
||||
"device.control.notification": "通知欄",
|
||||
|
@ -4,9 +4,12 @@
|
||||
* @returns {string} The formatted command line arguments string
|
||||
*/
|
||||
function stringify(options) {
|
||||
if (typeof options === 'string') {
|
||||
return options
|
||||
}
|
||||
|
||||
if (!options || typeof options !== 'object' || Array.isArray(options)) {
|
||||
console.warn('Options must be a plain object')
|
||||
return ''
|
||||
throw new TypeError('Options must be a plain object')
|
||||
}
|
||||
|
||||
const args = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user