feat(sub): report why a subscription balancer emits nothing (#7209)

A subscription balancer whose inbounds were deleted, disabled, changed to a protocol with no JSON outbound, left without clients or closed by their hosts simply vanished from the JSON subscription, and nothing in the panel or the log said why.

GET /panel/api/sub-balancers now returns a problems[] array per balancer with stable codes: unknown_inbound, disabled_inbound, json_incapable_protocol, inbound_without_clients, hosts_excluded_from_json and no_members. Settings -> Sub Balancers shows a warning tag whose tooltip names each cause and the affected inbounds, and the log records a balancer's problems when they change instead of on every listing.

The advisories are read from the stored rows and never change what a subscription emits: a balancer with no usable member is still omitted. The list of JSON-incapable protocols is pinned to the renderer, the subscription allowlist and the form by tests.
This commit is contained in:
amirim
2026-11-28 09:23:14 +03:00
committed by GitHub
parent eb99820dd8
commit e071f220e9
30 changed files with 1419 additions and 13 deletions
@@ -10,8 +10,9 @@ _openapi:
- ./public/openapi.json
toc:
- depth: 2
title: List all subscription balancers in sort order (sort_order asc, id asc).
url: '#list-all-subscription-balancers-in-sort-order-sort_order-asc-id-asc'
title: List all subscription balancers in sort order, with problems[]
advisories.
url: '#list-all-subscription-balancers-in-sort-order-with-problems-advisories'
- depth: 2
title: Create a subscription balancer. It appears in the JSON subscription of
every client that sits on at least one selected inbound.
@@ -30,8 +31,9 @@ _openapi:
url: '#delete-a-balancer-by-id-post-alias-of-delete-for-clients-that-cannot-send-delete'
structuredData:
headings:
- content: List all subscription balancers in sort order (sort_order asc, id asc).
id: list-all-subscription-balancers-in-sort-order-sort_order-asc-id-asc
- content: List all subscription balancers in sort order, with problems[]
advisories.
id: list-all-subscription-balancers-in-sort-order-with-problems-advisories
- content: Create a subscription balancer. It appears in the JSON subscription of
every client that sits on at least one selected inbound.
id: create-a-subscription-balancer-it-appears-in-the-json-subscription-of-every-client-that-sits-on-at-least-one-selected-inbound
@@ -44,7 +46,14 @@ _openapi:
- content: Delete a balancer by id (POST alias of DELETE for clients that cannot
send DELETE).
id: delete-a-balancer-by-id-post-alias-of-delete-for-clients-that-cannot-send-delete
contents: []
contents:
- content: 'Each balancer carries a problems[] array of diagnostic advisories:
unknown_inbound, disabled_inbound, json_incapable_protocol,
inbound_without_clients, hosts_excluded_from_json, no_members.
Advisories never change the emitted config — a balancer with no
resolvable member is still omitted from the JSON subscription.
sort_order asc, id asc.'
heading: list-all-subscription-balancers-in-sort-order-with-problems-advisories
---
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}