From 7621b7a348ac6df9936ac81ef830711a34fa50a4 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Tue, 7 Jan 2025 02:25:20 +0100 Subject: [PATCH] fix vless flow in client configs #354 --- backend/service/client.go | 8 ++++++-- frontend/src/layouts/modals/Client.vue | 21 ++++++++++----------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/backend/service/client.go b/backend/service/client.go index 939c628..861a1fb 100644 --- a/backend/service/client.go +++ b/backend/service/client.go @@ -105,9 +105,13 @@ func (s *ClientService) updateLinksWithFixedInbounds(tx *gorm.DB, clients []*mod } } for index, client := range clients { - var clientLinks, newClientLinks []map[string]string - json.Unmarshal(client.Links, &clientLinks) + var clientLinks []map[string]string + err = json.Unmarshal(client.Links, &clientLinks) + if err != nil { + return err + } + newClientLinks := []map[string]string{} for _, inbound := range inbounds { newLinks := util.LinkGenerator(client.Config, &inbound, hostname) for _, newLink := range newLinks { diff --git a/frontend/src/layouts/modals/Client.vue b/frontend/src/layouts/modals/Client.vue index 47f28ac..00556e4 100644 --- a/frontend/src/layouts/modals/Client.vue +++ b/frontend/src/layouts/modals/Client.vue @@ -82,33 +82,33 @@ - + {{ key }} @@ -190,7 +190,6 @@ export default { client: createClient(), title: "add", loading: false, - clientStats: false, tab: "t1", clientConfig: [], links: [], @@ -226,7 +225,7 @@ export default { this.client.links = [ ...this.extLinks.filter(l => l.uri != ''), ...this.subLinks.filter(l => l.uri != '')] - this.$emit('save', this.client, this.clientStats) + this.$emit('save', this.client) this.loading = false }, setDate(newDate:number){