merge fix/settings-trim: dead settings, upstream remnants, JSON/Clash subscriptions removed
# Conflicts: # frontend/src/models/setting.ts # frontend/src/pages/settings/GeneralTab.tsx # frontend/src/pages/settings/SettingsPage.tsx # frontend/src/pages/settings/SubscriptionBalancersTab.tsx # frontend/src/pages/xray/outbounds/OutboundsTab.css # frontend/src/schemas/setting.ts
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"regexp"
|
||||
"slices"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -1371,22 +1370,6 @@ func (s *InboundService) DelInbound(id int) (bool, error) {
|
||||
if err := tx.Where("inbound_id = ?", id).Delete(&model.Host{}).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
// Drop the deleted inbound from any sub-balancer that selects it; a
|
||||
// dangling id would emit a member no subscriber can resolve (#5648).
|
||||
var balancers []model.SubBalancer
|
||||
if err := tx.Find(&balancers).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
for i := range balancers {
|
||||
before := balancers[i].InboundIds
|
||||
balancers[i].InboundIds = slices.DeleteFunc(before, func(b int) bool { return b == id })
|
||||
if len(balancers[i].InboundIds) == len(before) {
|
||||
continue
|
||||
}
|
||||
if err := tx.Save(&balancers[i]).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if loadErr == nil && ib.NodeID != nil {
|
||||
return (&NodeService{}).MarkNodeDirtyTx(tx, *ib.NodeID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user