diff --git a/package.json b/package.json index b718d71..8d45f3b 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "electron-log": "^5.0.0", "electron-store": "^8.1.0", "electron-updater": "^6.1.4", - "element-plus": "^2.4.1", + "element-plus": "^2.4.2", "fix-path": "^4.0.0", "fs-extra": "^11.1.1", "husky": "^8.0.0", diff --git a/src/components/Device/components/ControlBar/Gnirehtet/index.vue b/src/components/Device/components/ControlBar/Gnirehtet/index.vue index e0387e3..dfca18e 100644 --- a/src/components/Device/components/ControlBar/Gnirehtet/index.vue +++ b/src/components/Device/components/ControlBar/Gnirehtet/index.vue @@ -1,11 +1,23 @@ + + diff --git a/src/components/Device/components/ControlBar/index.vue b/src/components/Device/components/ControlBar/index.vue index 0987640..913189d 100644 --- a/src/components/Device/components/ControlBar/index.vue +++ b/src/components/Device/components/ControlBar/index.vue @@ -51,6 +51,7 @@ import AppInstall from './AppInstall/index.vue' import Gnirehtet from './Gnirehtet/index.vue' import MirrorGroup from './MirrorGroup/index.vue' import Rotation from './Rotation/index.vue' +import Volume from './Volume/index.vue' export default { components: { @@ -59,6 +60,7 @@ export default { Gnirehtet, MirrorGroup, Rotation, + Volume, }, props: { device: { @@ -72,17 +74,17 @@ export default { { label: 'device.control.switch', elIcon: 'Switch', - command: 'input keyevent KEYCODE_APP_SWITCH', + command: 'input keyevent 187', }, { label: 'device.control.home', svgIcon: 'home', - command: 'input keyevent KEYCODE_HOME', + command: 'input keyevent 3', }, { label: 'device.control.return', elIcon: 'Back', - command: 'input keyevent KEYCODE_BACK', + command: 'input keyevent 4', }, { label: 'device.control.notification', @@ -93,33 +95,19 @@ export default { { label: 'device.control.power', elIcon: 'SwitchButton', - command: 'input keyevent KEYCODE_POWER', + command: 'input keyevent 26', tips: 'device.control.power.tips', }, - { - label: 'device.control.reboot', - elIcon: 'RefreshLeft', - command: 'reboot', - }, + { label: 'device.control.rotation.name', svgIcon: 'rotation', component: 'Rotation', }, { - label: 'device.control.volume-down.name', - svgIcon: 'volume-down', - command: 'input keyevent KEYCODE_VOLUME_DOWN', - }, - { - label: 'device.control.volume-up.name', + label: 'device.control.volume.name', svgIcon: 'volume-up', - command: 'input keyevent KEYCODE_VOLUME_UP', - }, - { - label: 'device.control.volume-mute.name', - svgIcon: 'volume-mute', - command: 'input keyevent KEYCODE_VOLUME_MUTE', + component: 'Volume', }, { label: 'device.control.capture', @@ -127,6 +115,11 @@ export default { component: 'Screenshot', tips: '', }, + { + label: 'device.control.reboot', + elIcon: 'RefreshLeft', + command: 'reboot', + }, { label: 'device.control.install', svgIcon: 'install', diff --git a/src/icons/components/SvgIcon.vue b/src/icons/components/SvgIcon.vue index 3ceb43d..e8a6d82 100644 --- a/src/icons/components/SvgIcon.vue +++ b/src/icons/components/SvgIcon.vue @@ -13,15 +13,22 @@ export default { SvgComponent: null, } }, - created() { - this.getSvgComponent() + + watch: { + name: { + handler(value) { + if (!value) { + return false + } + + this.SvgComponent = null + this.getSvgComponent() + }, + immediate: true, + }, }, methods: { async getSvgComponent() { - if (!this.name) { - return - } - const module = await import(`../svg/${this.name}.svg?component`) this.SvgComponent = module.default.render() // console.log('this.SvgComponent', this.SvgComponent) diff --git a/src/locales/languages/en_US.json b/src/locales/languages/en_US.json index 08831ac..5016fe1 100644 --- a/src/locales/languages/en_US.json +++ b/src/locales/languages/en_US.json @@ -100,6 +100,7 @@ "device.control.mirror-group.name": "Mirror Group", "device.control.mirror-group.tips": "When enabled, can mirror multiple simulated secondary displays and achieve multi-screen collaboration by operating each mirrored window. Note this requires ROM support and desktop mode enabled.", "device.control.mirror-group.open": "Open {num} windows", + "device.control.volume.name": "Volume", "device.control.volume-up.name": "Volume Up", "device.control.volume-down.name": "Volume Down", "device.control.volume-mute.name": "Mute", diff --git a/src/locales/languages/zh_CN.json b/src/locales/languages/zh_CN.json index 7f0203b..ace3f6d 100644 --- a/src/locales/languages/zh_CN.json +++ b/src/locales/languages/zh_CN.json @@ -9,6 +9,7 @@ "common.tips": "提示", "common.open": "打开", "common.input.placeholder": "请填写", + "common.success": "操作成功", "close.quit": "退出", "close.quit.cancel": "取消退出", @@ -95,12 +96,16 @@ "device.control.gnirehtet.tips": "使用 Gnirehtet 为 Android 提供反向网络共享;注意:首次连接需要在设备上进行授权", "device.control.gnirehtet.progress": "正在启动 Gnirehtet 反向供网服务中...", "device.control.gnirehtet.success": "Gnirehtet 反向网络共享功能启动成功", + "device.control.gnirehtet.start": "启动服务", + "device.control.gnirehtet.stop": "停止服务", + "device.control.gnirehtet.stop.success": "停止服务成功", "device.control.mirror-group.name": "多屏协同", "device.control.mirror-group.tips": "开启后,可以同时镜像多个模拟辅助显示设备,并通过操作各个镜像窗口实现多屏协同功能。请注意,此功能需要手机 ROM 支持,并且必须开启强制使用桌面模式选项。", "device.control.mirror-group.open": "开启 {num} 个窗口", + "device.control.volume.name": "音量控制", "device.control.volume-up.name": "增加音量", "device.control.volume-down.name": "减小音量", - "device.control.volume-mute.name": "静音", + "device.control.volume-mute.name": "关闭音量", "device.control.rotation.name": "旋转屏幕", "device.control.rotation.vertically": "纵向旋转", "device.control.rotation.horizontally": "横向旋转",