重载远程配置时,Git代理也重启。
parent
6357dd341f
commit
7c91ff615d
|
@ -18,6 +18,10 @@ const Plugin = function (context) {
|
||||||
await pluginApi.start()
|
await pluginApi.start()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isEnabled () {
|
||||||
|
return config.get().plugin.git.enabled
|
||||||
|
},
|
||||||
|
|
||||||
async save (newConfig) {
|
async save (newConfig) {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
@ -107,11 +107,17 @@ export default {
|
||||||
this.setConfig(config)
|
this.setConfig(config)
|
||||||
},
|
},
|
||||||
async reloadConfigAndRestart () {
|
async reloadConfigAndRestart () {
|
||||||
|
if (this.$api.plugin.git.isEnabled()) {
|
||||||
|
await this.$api.plugin.git.close()
|
||||||
|
}
|
||||||
await this.reloadConfig()
|
await this.reloadConfig()
|
||||||
this.printConfig('After reloadConfigAndRestart(), ')
|
this.printConfig('After reloadConfigAndRestart(), ')
|
||||||
if (this.status.server.enabled || this.status.proxy.enabled) {
|
if (this.status.server.enabled || this.status.proxy.enabled) {
|
||||||
await this.$api.proxy.restart()
|
await this.$api.proxy.restart()
|
||||||
await this.$api.server.restart()
|
await this.$api.server.restart()
|
||||||
|
if (this.$api.plugin.git.isEnabled()) {
|
||||||
|
await this.$api.plugin.git.start()
|
||||||
|
}
|
||||||
this.$message.success('代理服务和系统代理重启成功')
|
this.$message.success('代理服务和系统代理重启成功')
|
||||||
} else {
|
} else {
|
||||||
this.$message.info('代理服务和系统代理未启动,无需重启')
|
this.$message.info('代理服务和系统代理未启动,无需重启')
|
||||||
|
|
Loading…
Reference in New Issue