diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 3413a248..e000202c 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -351,10 +351,11 @@ await this.submit(`/xui/inbound/update/${dbInbound.id}`, data, inModal); }, openAddClient(inbound) { + dbInbound = this.dbInbounds.find(row => row.id === inbound.id); clientModal.show({ title: '{{ i18n "pages.client.add"}}', okText: '{{ i18n "pages.client.submitAdd"}}', - dbInbound: inbound, + dbInbound: dbInbound, confirm: async (inbound, dbInbound, index) => { clientModal.loading(); await this.addClient(inbound, dbInbound); diff --git a/web/service/inbound.go b/web/service/inbound.go index b0ccddd5..d320868d 100644 --- a/web/service/inbound.go +++ b/web/service/inbound.go @@ -134,7 +134,9 @@ func (s *InboundService) AddInbound(inbound *model.Inbound) (*model.Inbound, err err = db.Save(inbound).Error if err == nil { - s.AddClientStat(inbound.Id, &clients[0]) + for _, client := range clients { + s.AddClientStat(inbound.Id, &client) + } } return inbound, err }