Skip to content

Commit

Permalink
重载远程配置时,Git代理也重启。
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed Sep 12, 2024
1 parent 6357dd3 commit 7c91ff6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/modules/plugin/git/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const Plugin = function (context) {
await pluginApi.start()
},

isEnabled () {
return config.get().plugin.git.enabled
},

async save (newConfig) {

},
Expand Down
6 changes: 6 additions & 0 deletions packages/gui/src/view/mixins/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,17 @@ export default {
this.setConfig(config)
},
async reloadConfigAndRestart () {
if (this.$api.plugin.git.isEnabled()) {
await this.$api.plugin.git.close()
}
await this.reloadConfig()
this.printConfig('After reloadConfigAndRestart(), ')
if (this.status.server.enabled || this.status.proxy.enabled) {
await this.$api.proxy.restart()
await this.$api.server.restart()
if (this.$api.plugin.git.isEnabled()) {
await this.$api.plugin.git.start()
}
this.$message.success('代理服务和系统代理重启成功')
} else {
this.$message.info('代理服务和系统代理未启动,无需重启')
Expand Down

0 comments on commit 7c91ff6

Please sign in to comment.