From f1760b0a2824a71b4178a979d9bc27c549b981f1 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Mon, 11 May 2026 00:11:09 +0200 Subject: [PATCH] feat(xray/balancer): restore observatory editor + auto-sync selectors The Vue3 migration dropped the Observatory / Burst Observatory section that used to sit under the balancer table. Without it, leastPing / leastLoad strategies had nowhere to populate Xray's required subjectSelector, so balancers that depended on probe data silently ran with an empty observer config. - Auto-seed and sync `observatory` for leastPing balancers and `burstObservatory` for leastLoad balancers (subjectSelector recomputed from every matching balancer's selector list). Drops the observatory when no matching strategy remains. - Defaults (probeURL, interval, connectivity, sampling) match the values the legacy panel shipped, themselves taken from the Xray docs at xtls.github.io/config/{observatory,burstobservatory}.html. - Surface both observatories under the table as a radio-switched JSON textarea so admins can tune probe settings inline without dropping into the full xray template tab. --- frontend/src/pages/xray/BalancersTab.vue | 126 ++++++++++++++++++++++- 1 file changed, 124 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/xray/BalancersTab.vue b/frontend/src/pages/xray/BalancersTab.vue index 94370886..cc74c5c1 100644 --- a/frontend/src/pages/xray/BalancersTab.vue +++ b/frontend/src/pages/xray/BalancersTab.vue @@ -1,5 +1,5 @@ + + [ .danger { color: #ff4d4f; } + +.json-editor { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; + font-size: 12px; + margin-top: 8px; +}