Skip to content

Commit

Permalink
feat: 🚀 Add a scheduled task list
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Jul 24, 2024
1 parent 16f9535 commit d72202b
Show file tree
Hide file tree
Showing 31 changed files with 766 additions and 189 deletions.
3 changes: 2 additions & 1 deletion .eslintrc-auto-import.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"watchEffect": true,
"watchPostEffect": true,
"watchSyncEffect": true,
"ElMessage": true
"ElMessage": true,
"ElButtonProps": true
}
}
58 changes: 31 additions & 27 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
## 特点

- 🏃 同步:得益于 Web 技术,将更快速的与 Scrcpy 保持同步
- 🤖 自动化:允许自动连接到历史设备并自动执行镜像。
- 💡 定制化:支持对多个设备偏好进行独立配置,并且能够添加备注以及导入导出所有配置的功能
- 🔗 反向供网:集成了 Gnirehtet 反向供网功能
- 🎨 主题:支持浅色模式和深色模式,跟随系统切换
- 🤖 自动化:自动连接设备、自动执行镜像、自定义脚本、定时任务
- 💡 定制化:多设备管理、独立配置、自定义备注、配置导入导出
- 🔗 反向供网:Gnirehtet 反向供网
- 🎨 主题:浅色模式、深色模式、跟随系统切换
- 😎 轻巧度:本机支持,仅显示设备屏幕
- ⚡️ 性能:30~120 帧每秒,取决于设备
- 🌟 质量:1920×1080 或更高
Expand Down Expand Up @@ -78,6 +78,7 @@ Windows 及 Linux 端内部集成了 Gnirehtet, 用于提供 PC 到安卓设
- 批量安装应用
- 批量文件管理
- 批量执行脚本
- 批量定时任务

### 控制模式

Expand All @@ -101,6 +102,7 @@ Windows 及 Linux 端内部集成了 Gnirehtet, 用于提供 PC 到安卓设
- 安装应用
- 文件管理
- 执行脚本
- 定时任务
- 反向供网(Gnirehtet)
- 多屏协同

Expand Down Expand Up @@ -174,12 +176,12 @@ Windows 及 Linux 端内部集成了 Gnirehtet, 用于提供 PC 到安卓设
### 输入控制

- 鼠标模式
- 鼠标绑定
- 键盘模式
- 键盘注入方式

### 摄像控制

- 启用摄像
- 摄像源
- 摄像尺寸
- 摄像比例
Expand All @@ -189,29 +191,31 @@ Windows 及 Linux 端内部集成了 Gnirehtet, 用于提供 PC 到安卓设

> 优先级从高到低
1. 用户界面进行优化,制作合适的 Logo
2. 内置的软件更新功能
1. 更好的标志
2. 软件更新功能
3. 录制和保存音视频 ✅
4. 添加设备快捷交互控制栏 ✅
5. 支持自定义 Adb 及 Scrcpy 依赖 ✅
6. 支持自定义设备名称,以及偏好设置的导出及导入 ✅
7. 定制化,支持对单个设备进行独立配置 ✅
8. 添加 macOS 及 linux 操作系统的支持 ✅
9. 支持国际化 ✅
10. 对深色模式的支持 ✅
11. 添加 Gnirehtet 反向供网功能 ✅
12. 添加新的相机镜像相关功能 ✅
13. 更好的多屏协同 ✅
14. 设备交互栏添加更多功能:文件推送、旋转屏幕、音频控制等功能 ✅
15. 支持批量连接历史设备功能 ✅
16. 支持使用内置终端执行自定义命令 ✅
17. 支持设备自动执行镜像 ✅
18. 支持灵活启动镜像 ✅
19. 支持常用批量功能 ✅
20. 支持对设备进行分组 🚧
21. 添加文件传输助手功能 🚧
22. 支持通过界面从设备下载选中的文件 🚧
23. 添加对游戏的增强功能,如游戏键位映射 🚧
4. 设备快捷交互控制栏 ✅
5. 自定义 Adb 及 Scrcpy 依赖 ✅
6. 自定义设备名称 ✅
7. 偏好设置的导出及导入 ✅
8. 对单个设备进行独立配置 ✅
9. 添加 macOS 及 linux 操作系统的支持 ✅
10. 国际化 ✅
11. 深色模式 ✅
12. 反向供网(Gnirehtet) ✅
13. 相机镜像 ✅
14. 多屏协同 ✅
15. 文件推送、旋转屏幕、音频控制 ✅
16. 批量连接历史设备 ✅
17. 内置终端 ✅
18. 自动执行镜像 ✅
19. 灵活启动镜像 ✅
20. 批量处理 ✅
21. 定时任务 ✅
22. 对设备进行分组 🚧
23. 文件传输助手 🚧
24. 通过界面管理设备文件 🚧
25. 游戏键位映射 🚧

## 常见问题

Expand Down
58 changes: 31 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
## Features

- 🏃 Synchronous: Benefit from web technologies to synchronize with Scrcpy faster
- 🤖 Automation: Enables automatic connection to historical devices and automatic execution of mirror.
- 💡 Customizable: Support independent configuration for multiple devices and ability to add notes and import/export all configurations
- 🎨 Theme: Supports light mode and dark mode, system-wide switching
- 🔗 Gnirehtet: Integrated Gnirehtet's reverse tethering functionality
- 🤖 Automation: Auto-connect devices, auto-execute images, custom scripts, scheduled tasks
- 💡 Customization: Multi-device management, independent configurations, custom notes, config import/export
- 🔗 Reverse tethering: Gnirehtet reverse tethering
- 🎨 Themes: Light mode, dark mode, system-based switching
- 😎 Lightweight: Native support, only display device screen
- ⚡️ Performance: 30-120 fps depending on device
- 🌟 Quality: 1920×1080 or higher
Expand Down Expand Up @@ -76,6 +76,7 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master
- Batch Installation Application
- Batch File Management
- Batch Execution Script
- Batch Scheduled Task

### Control Model

Expand All @@ -99,6 +100,7 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master
- Install APP
- File Manager
- Execution Script
- Scheduled Task
- Gnirehtet
- Mirror Group

Expand Down Expand Up @@ -172,12 +174,12 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master
### Input Control

- Mouse mode
- Mouse binding
- Keyboard mode
- Keyboard injection method

### Camera Control

- Enable camera
- Camera source
- Camera resolution
- Camera aspect ratio
Expand All @@ -187,29 +189,31 @@ Refer to [scrcpy/doc/shortcuts](https://github.com/Genymobile/scrcpy/blob/master

> Priority from high to low:
1. Optimize user interface, design a suitable logo ✅
2. Built-in software update function
1. Improved logo ✅
2. Software update feature
3. Record and save audio/video ✅
4. Add device quick interaction control bar ✅
5. Support customization of Adb and Scrcpy dependencies ✅
6. Support custom device name, and import/export of preference settings ✅
7. Customization, support independent configuration for individual devices ✅
8. Add support for macOS and linux operating systems ✅
9. Support internationalization ✅
10. Support for dark mode ✅
11. Add Gnirehtet reverse network function ✅
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 ✅
16. Support to use built-in terminals to execute custom commands ✅
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 🚧
4. Device quick interaction control bar ✅
5. Custom Adb and Scrcpy dependencies ✅
6. Custom device names ✅
7. Export and import preferences ✅
8. Individual device configuration ✅
9. macOS and Linux support ✅
10. Internationalization ✅
11. Dark mode ✅
12. Reverse tethering (Gnirehtet) ✅
13. Camera mirroring ✅
14. Multi-screen collaboration ✅
15. File push, screen rotation, audio control ✅
16. Batch connect historical devices ✅
17. Built-in terminal ✅
18. Auto-execute mirroring ✅
19. Flexible mirroring launch ✅
20. Batch processing ✅
21. Scheduled tasks ✅
22. Device grouping 🚧
23. File transfer assistant 🚧
24. Manage device files via interface 🚧
25. Game key mapping 🚧

## FAQ

Expand Down
1 change: 0 additions & 1 deletion auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
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']
Expand Down
3 changes: 1 addition & 2 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ declare module 'vue' {
export interface GlobalComponents {
ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
ElButton: typeof import('element-plus/es')['ElButton']
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
ElCol: typeof import('element-plus/es')['ElCol']
ElCollapse: typeof import('element-plus/es')['ElCollapse']
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
Expand All @@ -23,12 +22,12 @@ declare module 'vue' {
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElIconSearch: typeof import('@element-plus/icons-vue')['Search']
ElInput: typeof import('element-plus/es')['ElInput']
ElLink: typeof import('element-plus/es')['ElLink']
ElOption: typeof import('element-plus/es')['ElOption']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dependencies": {
"electron-in-page-search": "^1.3.2",
"nanoid": "^5.0.7",
"pinia-plugin-persistedstate": "^3.2.1",
"vue": "^3.4.26"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<el-dialog
v-model="visible"
title="定时任务"
width="60%"
:title="$t('device.task.name')"
width="70%"
class="el-dialog-beautify"
append-to-body
destroy-on-close
Expand All @@ -12,13 +12,17 @@
ref="formRef"
:model="model"
:rules="rules"
label-width="120px"
class="!pr-[120px] !pt-4"
label-width="180px"
class="!pr-24 !pt-4"
>
<ele-form-item-col label="任务类型" :span="24" prop="taskType">
<ele-form-item-col
:label="$t('device.task.type')"
:span="24"
prop="taskType"
>
<el-select
v-model="model.taskType"
placeholder="请选择任务类型"
:placeholder="$t('common.select.please')"
clearable
filterable
@change="onTaskChange"
Expand All @@ -32,21 +36,25 @@
</el-option>
</el-select>
</ele-form-item-col>
<ele-form-item-col label="执行频率" :span="24" prop="timerType">
<ele-form-item-col
:label="$t('device.task.frequency')"
:span="24"
prop="timerType"
>
<el-radio-group v-model="model.timerType">
<el-radio
v-for="(item, index) of timerModel"
:key="index"
:value="item.value"
>
{{ item.label }}
{{ $t(item.label) }}
</el-radio>
</el-radio-group>
</ele-form-item-col>

<ele-form-item-col
v-if="['timeout'].includes(model.timerType)"
label="执行时间"
:label="$t('device.task.timeout')"
:span="24"
prop="timeout"
>
Expand All @@ -61,7 +69,7 @@

<ele-form-item-col
v-if="['interval'].includes(model.timerType)"
label="重复规则"
:label="$t('device.task.interval')"
:span="24"
prop="interval"
>
Expand All @@ -74,14 +82,14 @@
<template #append>
<el-select
v-model="model.intervalType"
placeholder="请选择时间单位"
:placeholder="$t('common.select.please')"
filterable
class="!w-24"
class="!w-36"
>
<el-option
v-for="(item, index) of intervalModel"
:key="index"
:label="item.label"
:label="$t(item.label)"
:value="item.value"
/>
</el-select>
Expand All @@ -91,7 +99,7 @@

<ele-form-item-col
v-if="['install'].includes(model.taskType)"
label="选择应用"
:label="$t('device.task.extra.app')"
:span="24"
prop="extra"
>
Expand All @@ -112,7 +120,7 @@

<ele-form-item-col
v-if="['shell'].includes(model.taskType)"
label="选择脚本"
:label="$t('device.task.extra.shell')"
:span="24"
prop="extra"
>
Expand All @@ -130,14 +138,20 @@
}"
/>
</ele-form-item-col>

<ele-form-item-col :span="24" label="">
<div class="text-red-200 hover:text-red-500 transition-colors">
{{ $t('device.task.tips') }}
</div>
</ele-form-item-col>
</ele-form-row>

<template #footer>
<el-button @click="close">
取消
{{ $t('common.cancel') }}
</el-button>
<el-button :loading type="primary" @click="submit">
确定
{{ $t('common.confirm') }}
</el-button>
</template>
</el-dialog>
Expand Down Expand Up @@ -173,14 +187,16 @@ const model = ref({
const rules = computed(() =>
Object.keys(model.value).reduce((obj, item) => {
obj[item] = [{ required: true, message: '该选项不能为空', trigger: 'blur' }]
obj[item] = [
{ required: true, message: window.t('common.required'), trigger: 'blur' },
]
if (item === 'timeout') {
obj[item].push({
trigger: 'blur',
validator: (rule, value, callback) => {
if (value.getTime() <= Date.now()) {
callback(new Error('不能小于当前时间'))
callback(new Error(window.t('device.task.timeout.tips')))
}
else {
callback()
Expand Down
Loading

0 comments on commit d72202b

Please sign in to comment.