Fix add client #26

This commit is contained in:
Alireza Ahmadi
2023-03-01 14:01:09 +01:00
parent afd369993a
commit 698af18d25
2 changed files with 5 additions and 2 deletions

View File

@@ -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);

View File

@@ -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
}