- 改进 ui 界面
 - 修复流量超出后账号不自动失效问题
 - 修复vless生成的链接不正确问题
 - 修复网页端重启面板功能问题
This commit is contained in:
sprov
2021-06-15 11:10:39 +08:00
parent 5cc4cf02ee
commit e91daabb18
13 changed files with 303 additions and 59 deletions

View File

@@ -36,8 +36,7 @@ func (a *InboundController) startTask() {
webServer := global.GetWebServer()
c := webServer.GetCron()
c.AddFunc("@every 10s", func() {
if a.xrayService.IsNeedRestart() {
a.xrayService.SetIsNeedRestart(false)
if a.xrayService.IsNeedRestartAndSetFalse() {
err := a.xrayService.RestartXray()
if err != nil {
logger.Error("restart xray failed:", err)
@@ -70,7 +69,7 @@ func (a *InboundController) addInbound(c *gin.Context) {
err = a.inboundService.AddInbound(inbound)
jsonMsg(c, "添加", err)
if err == nil {
a.xrayService.SetIsNeedRestart(true)
a.xrayService.SetToNeedRestart()
}
}
@@ -83,7 +82,7 @@ func (a *InboundController) delInbound(c *gin.Context) {
err = a.inboundService.DelInbound(id)
jsonMsg(c, "删除", err)
if err == nil {
a.xrayService.SetIsNeedRestart(true)
a.xrayService.SetToNeedRestart()
}
}
@@ -104,6 +103,6 @@ func (a *InboundController) updateInbound(c *gin.Context) {
err = a.inboundService.UpdateInbound(inbound)
jsonMsg(c, "修改", err)
if err == nil {
a.xrayService.SetIsNeedRestart(true)
a.xrayService.SetToNeedRestart()
}
}