Add multi-server 3x-ui registry with per-panel subscription URLs.

Admins can manage several 3x-ui panels by name and select which one issues invite/user configs via that server's /sub base URL.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
orohi
2026-07-26 03:19:09 +03:00
co-authored by Cursor
parent 83bb73179b
commit 8abe692624
14 changed files with 767 additions and 104 deletions
+12 -2
View File
@@ -292,7 +292,13 @@
</div>
<div class="form-group" id="ucXuiInboundGroup" style="display:none;">
<label class="form-label">{{ _('xui_inbound_label') }}</label>
<label class="form-label">{{ _('xui_server_select_label') }}</label>
<select class="form-select" id="ucXuiPanel" onchange="loadXuiInbounds()">
{% for s in xui_servers %}
<option value="{{ s.id }}" {% if s.id == xui_default_panel_id %}selected{% endif %}>{{ s.name }}</option>
{% endfor %}
</select>
<label class="form-label" style="margin-top:var(--space-sm);">{{ _('xui_inbound_label') }}</label>
<select class="form-select" id="ucXuiInbound">
<option value="">{{ _('xui_inbound_auto') }}</option>
</select>
@@ -407,6 +413,7 @@
const serversData = {{ servers | tojson }};
const xuiConfigured = {{ 'true' if xui_configured else 'false' }};
const xuiDefaultInboundId = {{ xui_inbound_id | int }};
const xuiServers = {{ xui_servers | default([]) | tojson }};
function populateTimeSelect(selectId) {
const select = document.getElementById(selectId);
@@ -640,7 +647,9 @@
if (!select) return;
select.innerHTML = `<option value="">${_('xui_inbound_auto')}</option>`;
try {
const data = await apiCall('/api/settings/xui/inbounds');
const panelId = document.getElementById('ucXuiPanel')?.value || '';
const q = panelId ? `?panel_id=${encodeURIComponent(panelId)}` : '';
const data = await apiCall('/api/settings/xui/inbounds' + q);
(data.inbounds || []).forEach(ib => {
const opt = document.createElement('option');
opt.value = ib.id;
@@ -865,6 +874,7 @@
} else if (body.protocol === 'xui') {
const inbound = document.getElementById('ucXuiInbound').value;
if (inbound) body.xui_inbound_id = parseInt(inbound);
body.xui_panel_id = document.getElementById('ucXuiPanel')?.value || '';
} else if (body.protocol === 'telemt') {
body.telemt_quota = document.getElementById('ucTelemtQuota').value || null;
body.telemt_max_ips = parseInt(document.getElementById('ucTelemtMaxIps').value) || null;