fix(xray): surface reverse tags in routing and balancer dropdowns

Outbound reverse tags now appear as inbound options in routing rules
(#4199), and inbound-client reverse tags appear as outbounds in the
balancer selector (#4187). Both represent virtual endpoints created by
xray-core that the dropdowns previously missed.
This commit is contained in:
MHSanaei 2026-05-09 22:03:01 +02:00
parent 61c84e8223
commit 917f9b307e
No known key found for this signature in database
GPG key ID: 7E4060F2FBE5AB7A
3 changed files with 19 additions and 6 deletions

View file

@ -20,6 +20,7 @@ const { t } = useI18n();
const props = defineProps({ const props = defineProps({
templateSettings: { type: Object, default: null }, templateSettings: { type: Object, default: null },
clientReverseTags: { type: Array, default: () => [] },
}); });
const STRATEGY_LABELS = { const STRATEGY_LABELS = {
@ -40,11 +41,16 @@ const rows = computed(() => {
})); }));
}); });
const outboundTags = computed( const outboundTags = computed(() => {
() => (props.templateSettings?.outbounds || []) const tags = new Set();
.filter((o) => o.tag) for (const o of props.templateSettings?.outbounds || []) {
.map((o) => o.tag), if (o.tag) tags.add(o.tag);
); }
for (const t of props.clientReverseTags || []) {
if (t) tags.add(t);
}
return [...tags];
});
// === Modal state ==================================================== // === Modal state ====================================================
const modalOpen = ref(false); const modalOpen = ref(false);

View file

@ -70,6 +70,10 @@ const inboundTagOptions = computed(() => {
if (ib.tag) out.add(ib.tag); if (ib.tag) out.add(ib.tag);
} }
for (const t of props.inboundTags || []) out.add(t); for (const t of props.inboundTags || []) out.add(t);
for (const ob of props.templateSettings?.outbounds || []) {
const rt = ob?.reverse?.tag || ob?.settings?.reverse?.tag;
if (rt) out.add(rt);
}
// dnsTag if DNS is configured. // dnsTag if DNS is configured.
const dt = props.templateSettings?.dns?.tag; const dt = props.templateSettings?.dns?.tag;
if (dt) out.add(dt); if (dt) out.add(dt);

View file

@ -306,7 +306,10 @@ function confirmRestart() {
<template #tab> <template #tab>
<ClusterOutlined /> <span>{{ t('pages.xray.Balancers') }}</span> <ClusterOutlined /> <span>{{ t('pages.xray.Balancers') }}</span>
</template> </template>
<BalancersTab :template-settings="templateSettings" /> <BalancersTab
:template-settings="templateSettings"
:client-reverse-tags="clientReverseTags"
/>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="tpl-dns" class="tab-pane"> <a-tab-pane key="tpl-dns" class="tab-pane">