mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
0.1.0
- 改进 ui 界面 - 修复流量超出后账号不自动失效问题 - 修复vless生成的链接不正确问题 - 修复网页端重启面板功能问题
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user