ITEM6 B4: frontend reshaping — xray page retired, stats switches to settings, template read paths closed
- Delete the xray settings page (routes/menu/title), geodata UI/service, XraySettingController/Service and routing-sync write paths; the stored xrayTemplateConfig row loses its last readers (GetXrayConfigTemplate now returns the embedded factory template; B1 already deleted the row). - Settings GeneralTab gains the four trafficStatsSwitches switches (settings.trafficStatsSwitches, B1) with the dual warning copy; entity AllSetting carries the key end to end (TestTrafficStatsSwitchesPlumbing). - Tag-directory consumers (panelOutbound, mtproto egress, node/host outbound pickers) move from POST /xray/ to GET /server/outboundDirectory. - Shared Mux/Sockopt forms and balancer helpers relocated to lib/xray; converter preserves sniffing ips/domains exclusions into the panel sidecar instead of dropping them (B2 gap closed by retention). - Freedom final-rules DB fix seeders retired; getDefaultJsonConfig endpoint removed (no in-repo consumer); locales pruned to referenced keys (pages.xray 331 -> 68) plus the five new settings keys.
This commit is contained in:
@@ -1397,13 +1397,6 @@ func (s *InboundService) DelInbound(id int) (bool, error) {
|
||||
if postCommitApply != nil {
|
||||
postCommitApply()
|
||||
}
|
||||
if loadErr == nil && ib.Tag != "" {
|
||||
if routingChanged, syncErr := (&XraySettingService{}).RemoveInboundTagReferences(ib.Tag); syncErr != nil {
|
||||
logger.Warning("DelInbound: sync routing on inbound delete failed:", syncErr)
|
||||
} else if routingChanged {
|
||||
needRestart = true
|
||||
}
|
||||
}
|
||||
if !database.IsPostgres() {
|
||||
var count int64
|
||||
if err := db.Model(&model.Inbound{}).Count(&count).Error; err != nil {
|
||||
@@ -1974,17 +1967,6 @@ func (s *InboundService) UpdateInbound(inbound *model.Inbound) (*model.Inbound,
|
||||
if postCommitApply != nil {
|
||||
postCommitApply()
|
||||
}
|
||||
// After the rename is committed, point any routing rules / loopback outbounds
|
||||
// in xrayTemplateConfig at the new tag (oldInbound.Tag now holds the resolved
|
||||
// new tag; tag holds the pre-edit one). Done post-commit so a sync failure
|
||||
// can't roll back the inbound edit.
|
||||
if tag != oldInbound.Tag {
|
||||
if routingChanged, syncErr := (&XraySettingService{}).PropagateInboundTagRename(tag, oldInbound.Tag); syncErr != nil {
|
||||
logger.Warning("UpdateInbound: sync routing on tag rename failed:", syncErr)
|
||||
} else if routingChanged {
|
||||
needRestart = true
|
||||
}
|
||||
}
|
||||
return inbound, needRestart, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user