feature: 启用/禁用 “远程配置” 时,自动加载配置并重启代理服务和系统代理。

This commit is contained in:
王良
2024-02-22 12:57:02 +08:00
parent 129da218f6
commit 925c20501a
4 changed files with 35 additions and 11 deletions

View File

@@ -100,9 +100,17 @@ export default {
this.$api.autoStart.enabled(this.config.app.autoStart.enabled)
this.saveConfig()
},
onRemoteConfigEnabledChange () {
async onRemoteConfigEnabledChange () {
this.saveConfig()
this.$message.info('请重启加速服务')
if (this.config.app.remoteConfig.enabled === true) {
await this.$api.config.startAutoDownloadRemoteConfig()
} else {
this.$api.config.reload()
}
if (this.status.server.enabled || this.status.proxy.enabled) {
await this.$api.proxy.restart()
this.$api.server.restart()
}
}
}
}