mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
Fix #164
This commit is contained in:
@@ -104,16 +104,13 @@ func (s *XrayService) GetXrayConfig() (*xray.Config, error) {
|
||||
}
|
||||
|
||||
// clear client config for additional parameters
|
||||
indexDecrease := 0
|
||||
for index, client := range clients {
|
||||
var final_clients []interface{}
|
||||
for _, client := range clients {
|
||||
|
||||
c := client.(map[string]interface{})
|
||||
|
||||
// remove disabled clients
|
||||
if c["enable"] != nil {
|
||||
if enable, ok := c["enable"].(bool); ok && !enable {
|
||||
clients = RemoveIndex(clients, index-indexDecrease)
|
||||
indexDecrease++
|
||||
continue
|
||||
}
|
||||
}
|
||||
@@ -122,10 +119,10 @@ func (s *XrayService) GetXrayConfig() (*xray.Config, error) {
|
||||
delete(c, key)
|
||||
}
|
||||
}
|
||||
clients[index-indexDecrease] = interface{}(c)
|
||||
final_clients = append(final_clients, interface{}(c))
|
||||
}
|
||||
|
||||
settings["clients"] = clients
|
||||
settings["clients"] = final_clients
|
||||
modifiedSettings, err := json.Marshal(settings)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user