fix vless flow in client configs #354

This commit is contained in:
Alireza Ahmadi
2025-01-07 02:25:20 +01:00
parent 9e63944d83
commit 7621b7a348
2 changed files with 16 additions and 13 deletions
+6 -2
View File
@@ -105,9 +105,13 @@ func (s *ClientService) updateLinksWithFixedInbounds(tx *gorm.DB, clients []*mod
} }
} }
for index, client := range clients { for index, client := range clients {
var clientLinks, newClientLinks []map[string]string var clientLinks []map[string]string
json.Unmarshal(client.Links, &clientLinks) err = json.Unmarshal(client.Links, &clientLinks)
if err != nil {
return err
}
newClientLinks := []map[string]string{}
for _, inbound := range inbounds { for _, inbound := range inbounds {
newLinks := util.LinkGenerator(client.Config, &inbound, hostname) newLinks := util.LinkGenerator(client.Config, &inbound, hostname)
for _, newLink := range newLinks { for _, newLink := range newLinks {
+10 -11
View File
@@ -82,33 +82,33 @@
</v-row> </v-row>
</v-window-item> </v-window-item>
<v-window-item value="t2"> <v-window-item value="t2">
<v-row v-for="(value, key) in clientConfig" :key="key"> <v-row v-for="key in Object.keys(clientConfig)">
<v-col cols="12" md="3" align="end" align-self="center"> <v-col cols="12" md="3" align="end" align-self="center">
{{ key }} {{ key }}
</v-col> </v-col>
<v-col> <v-col>
<v-text-field <v-text-field
v-if="value.password != undefined" v-if="clientConfig[key].password != undefined"
label="Password" label="Password"
v-model="value.password" v-model="clientConfig[key].password"
hide-details> hide-details>
</v-text-field> </v-text-field>
<v-text-field <v-text-field
v-if="value.uuid != undefined" v-if="clientConfig[key].uuid != undefined"
label="UUID" label="UUID"
v-model="value.uuid" v-model="clientConfig[key].uuid"
hide-details> hide-details>
</v-text-field> </v-text-field>
<v-text-field <v-text-field
v-if="value.flow != undefined" v-if="key == 'vless'"
label="Flow" label="Flow"
v-model="value.flow" v-model="clientConfig[key].flow"
hide-details> hide-details>
</v-text-field> </v-text-field>
<v-text-field <v-text-field
v-if="value.auth_str != undefined" v-if="key == 'hysteria'"
label="Auth" label="Auth"
v-model="value.auth_str" v-model="clientConfig[key].auth_str"
hide-details> hide-details>
</v-text-field> </v-text-field>
</v-col> </v-col>
@@ -190,7 +190,6 @@ export default {
client: createClient(), client: createClient(),
title: "add", title: "add",
loading: false, loading: false,
clientStats: false,
tab: "t1", tab: "t1",
clientConfig: <any>[], clientConfig: <any>[],
links: <Link[]>[], links: <Link[]>[],
@@ -226,7 +225,7 @@ export default {
this.client.links = [ this.client.links = [
...this.extLinks.filter(l => l.uri != ''), ...this.extLinks.filter(l => l.uri != ''),
...this.subLinks.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 this.loading = false
}, },
setDate(newDate:number){ setDate(newDate:number){