mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-05-04 22:28:49 +00:00
add single client bug fixed (#1664)
This commit is contained in:
parent
b172d450e3
commit
538fc9b365
2 changed files with 7 additions and 14 deletions
web
|
@ -162,10 +162,8 @@ func (a *InboundController) clearClientIps(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *InboundController) addInboundClient(c *gin.Context) {
|
func (a *InboundController) addInboundClient(c *gin.Context) {
|
||||||
var requestData []model.Inbound
|
data := &model.Inbound{}
|
||||||
|
err := c.ShouldBind(data)
|
||||||
err := c.ShouldBindJSON(&requestData)
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jsonMsg(c, I18nWeb(c, "pages.inbounds.update"), err)
|
jsonMsg(c, I18nWeb(c, "pages.inbounds.update"), err)
|
||||||
return
|
return
|
||||||
|
@ -173,20 +171,15 @@ func (a *InboundController) addInboundClient(c *gin.Context) {
|
||||||
|
|
||||||
needRestart := true
|
needRestart := true
|
||||||
|
|
||||||
for _, data := range requestData {
|
needRestart, err = a.inboundService.AddInboundClient(data)
|
||||||
|
|
||||||
needRestart, err = a.inboundService.AddInboundClient(&data)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jsonMsg(c, "Something went wrong!", err)
|
jsonMsg(c, "Something went wrong!", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
jsonMsg(c, "Client(s) added", nil)
|
jsonMsg(c, "Client(s) added", nil)
|
||||||
if err == nil && needRestart {
|
if err == nil && needRestart {
|
||||||
a.xrayService.SetToNeedRestart()
|
a.xrayService.SetToNeedRestart()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *InboundController) addGroupInboundClient(c *gin.Context) {
|
func (a *InboundController) addGroupInboundClient(c *gin.Context) {
|
||||||
|
|
|
@ -964,7 +964,7 @@
|
||||||
settings: '{"clients": [' + clients.toString() + ']}',
|
settings: '{"clients": [' + clients.toString() + ']}',
|
||||||
};
|
};
|
||||||
|
|
||||||
await this.submit(`/panel/inbound/addClient`, data, true)
|
await this.submit(`/panel/inbound/addClient`, data)
|
||||||
},
|
},
|
||||||
|
|
||||||
async addGroupClient(clients, dbInboundIds) {
|
async addGroupClient(clients, dbInboundIds) {
|
||||||
|
|
Loading…
Reference in a new issue