fix: 🐛 Add gnirehtet fix option

This commit is contained in:
viarotel 2023-11-03 14:07:27 +08:00
parent b5a45e2bdd
commit f9c6c32174
8 changed files with 30 additions and 13 deletions

View File

@ -124,9 +124,15 @@ const run = async (deviceId) => {
throw new Error(error?.message || 'Gnirehtet Relay fail')
})
const gnirehtetFix = appStore.get('common.gnirehtetFix') || false
const isInstalled = installed(deviceId)
if (gnirehtetFix || !isInstalled) {
console.log('Installing Gnirehtet Client...')
await install(deviceId).catch((error) => {
throw new Error(error?.message || 'Gnirehtet Install Client fail')
})
}
await start(deviceId).catch((error) => {
throw new Error(error?.message || 'Gnirehtet Start fail')

View File

@ -84,14 +84,6 @@ function createWindow() {
return { action: 'deny' }
})
// Test active push message to Renderer-process.
mainWindow.webContents.on('did-finish-load', () => {
mainWindow?.webContents.send(
'main-process-message',
new Date().toLocaleString(),
)
})
if (VITE_DEV_SERVER_URL) {
mainWindow.loadURL(VITE_DEV_SERVER_URL)
}

View File

@ -193,7 +193,7 @@ export default {
})
},
beforeUnmount() {
this?.unAdbWatch()
this?.unAdbWatch?.()
},
methods: {
onStdout() {},

View File

@ -54,6 +54,11 @@ export default {
},
},
},
watch: {
inputValue(value) {
this.locale = value
},
},
methods: {},
}
</script>

View File

@ -73,7 +73,7 @@
<div class="flex-1 w-0 truncate pl-4 text-base">
{{ $t(item.label) }}
</div>
<div class="flex-none pl-4 pr-12">
<div class="flex-none pl-4 pr-12" @click.stop>
<el-button type="primary" text @click="handleReset(name)">
{{ $t("preferences.reset") }}
</el-button>

View File

@ -128,6 +128,9 @@
"preferences.common.gnirehtet.name": "Gnirehtet Path",
"preferences.common.gnirehtet.placeholder": "Set gnirehtet path",
"preferences.common.gnirehtet.tips": "The path for gnirehtet used to provide reverse tethering for devices.",
"preferences.common.gnirehtet.fix.name": "Gnirehtet Fix",
"preferences.common.gnirehtet.fix.placeholder": "Turning this on will try to fix reverse tethering issues on some devices",
"preferences.common.gnirehtet.fix.tips": "Note: May cause duplicate gnirehtet client installations",
"preferences.common.language.name": "Language",
"preferences.common.language.placeholder": "Select language",
"preferences.common.language.chinese": "中文",

View File

@ -128,6 +128,9 @@
"preferences.common.gnirehtet.name": "gnirehtet 路径",
"preferences.common.gnirehtet.placeholder": "请设置 gnirehtet 路径",
"preferences.common.gnirehtet.tips": "用于为设备反向供网的 gnirehtet 地址。",
"preferences.common.gnirehtet.fix.name": "gnirehtet 修复",
"preferences.common.gnirehtet.fix.placeholder": "开启将尝试修复某些机型二次开启反向供网功能失败的问题",
"preferences.common.gnirehtet.fix.tips": "注意:可能导致 gnirehtet 客户端重复安装",
"preferences.common.language.name": "语言",
"preferences.common.language.placeholder": "选择你需要的语言",
"preferences.common.language.chinese": "中文",

View File

@ -89,6 +89,14 @@ export default {
{ name: 'preferences.common.gnirehtet.name', extensions: ['*'] },
],
},
gnirehtetFix: {
label: 'preferences.common.gnirehtet.fix.name',
field: 'gnirehtetFix',
type: 'Switch',
value: false,
placeholder: 'preferences.common.gnirehtet.fix.placeholder',
tips: 'preferences.common.gnirehtet.fix.tips',
},
debug: {
label: 'preferences.common.debug.name',
field: 'debug',