mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-05-13 13:58:22 +00:00
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:
parent
61c84e8223
commit
917f9b307e
3 changed files with 19 additions and 6 deletions
|
|
@ -20,6 +20,7 @@ const { t } = useI18n();
|
|||
|
||||
const props = defineProps({
|
||||
templateSettings: { type: Object, default: null },
|
||||
clientReverseTags: { type: Array, default: () => [] },
|
||||
});
|
||||
|
||||
const STRATEGY_LABELS = {
|
||||
|
|
@ -40,11 +41,16 @@ const rows = computed(() => {
|
|||
}));
|
||||
});
|
||||
|
||||
const outboundTags = computed(
|
||||
() => (props.templateSettings?.outbounds || [])
|
||||
.filter((o) => o.tag)
|
||||
.map((o) => o.tag),
|
||||
);
|
||||
const outboundTags = computed(() => {
|
||||
const tags = new Set();
|
||||
for (const o of props.templateSettings?.outbounds || []) {
|
||||
if (o.tag) tags.add(o.tag);
|
||||
}
|
||||
for (const t of props.clientReverseTags || []) {
|
||||
if (t) tags.add(t);
|
||||
}
|
||||
return [...tags];
|
||||
});
|
||||
|
||||
// === Modal state ====================================================
|
||||
const modalOpen = ref(false);
|
||||
|
|
|
|||
|
|
@ -70,6 +70,10 @@ const inboundTagOptions = computed(() => {
|
|||
if (ib.tag) out.add(ib.tag);
|
||||
}
|
||||
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.
|
||||
const dt = props.templateSettings?.dns?.tag;
|
||||
if (dt) out.add(dt);
|
||||
|
|
|
|||
|
|
@ -306,7 +306,10 @@ function confirmRestart() {
|
|||
<template #tab>
|
||||
<ClusterOutlined /> <span>{{ t('pages.xray.Balancers') }}</span>
|
||||
</template>
|
||||
<BalancersTab :template-settings="templateSettings" />
|
||||
<BalancersTab
|
||||
:template-settings="templateSettings"
|
||||
:client-reverse-tags="clientReverseTags"
|
||||
/>
|
||||
</a-tab-pane>
|
||||
|
||||
<a-tab-pane key="tpl-dns" class="tab-pane">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue