mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-30 23:17:14 +00:00
feat(clients,routing): label inbounds by remark with tag fallback
Inbound pickers and chips across the Users area, the inbounds attach-clients modals, and the routing rule inbound-tags selector showed the auto-generated tag (in-443-tcp). Show the inbound remark when set, falling back to the tag. Only display labels change; option values keep using the inbound id (or tag for routing rules, which match inbounds by tag), so filtering, attaching, and saved rules are unaffected. Routing reads remarks via a shared useInboundOptions hook that reuses the existing options query cache.
This commit is contained in:
@@ -36,7 +36,7 @@ export default function BulkAttachInboundsModal({
|
||||
.filter((ib) => MULTI_USER_PROTOCOLS.has((ib.protocol || '').toLowerCase()))
|
||||
.map((ib) => ({
|
||||
value: ib.id,
|
||||
label: ib.tag,
|
||||
label: ib.remark?.trim() || ib.tag || '',
|
||||
}));
|
||||
}, [inbounds]);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ export default function BulkDetachInboundsModal({
|
||||
.filter((ib) => MULTI_USER_PROTOCOLS.has((ib.protocol || '').toLowerCase()))
|
||||
.map((ib) => ({
|
||||
value: ib.id,
|
||||
label: ib.tag,
|
||||
label: ib.remark?.trim() || ib.tag || '',
|
||||
}));
|
||||
}, [inbounds]);
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ export default function ClientBulkAddModal({
|
||||
() => (inbounds || [])
|
||||
.filter((ib) => MULTI_CLIENT_PROTOCOLS.has(ib.protocol || ''))
|
||||
.map((ib) => ({
|
||||
label: ib.tag ?? '',
|
||||
label: ib.remark?.trim() || ib.tag || '',
|
||||
value: ib.id,
|
||||
})),
|
||||
[inbounds],
|
||||
|
||||
@@ -261,9 +261,9 @@ export default function ClientFormModal({
|
||||
() => (inbounds || [])
|
||||
.filter((ib) => MULTI_CLIENT_PROTOCOLS.has(ib.protocol || ''))
|
||||
.map((ib) => ({
|
||||
label: ib.tag ?? '',
|
||||
label: ib.remark?.trim() || ib.tag || '',
|
||||
value: ib.id,
|
||||
title: ib.tag ?? '',
|
||||
title: ib.remark?.trim() || ib.tag || '',
|
||||
})),
|
||||
[inbounds],
|
||||
);
|
||||
|
||||
@@ -382,7 +382,7 @@ export default function ClientInfoModal({
|
||||
const ib = inboundsById[id];
|
||||
const proto = (ib?.protocol || '').toLowerCase();
|
||||
const color = INBOUND_PROTOCOL_COLORS[proto] ?? 'default';
|
||||
const label = ib?.tag ?? '';
|
||||
const label = ib?.remark?.trim() || ib?.tag || '';
|
||||
return (
|
||||
<Tooltip key={id} title={label}>
|
||||
<Tag color={color}>{label}</Tag>
|
||||
|
||||
@@ -304,7 +304,7 @@ export default function ClientsPage() {
|
||||
|
||||
function inboundLabel(id: number) {
|
||||
const ib = inboundsById[id];
|
||||
return ib?.tag ?? '';
|
||||
return ib?.remark?.trim() || ib?.tag || '';
|
||||
}
|
||||
|
||||
const clientBucket = useCallback((row: ClientRecord | null | undefined): Bucket | null => {
|
||||
@@ -694,7 +694,7 @@ export default function ClientsPage() {
|
||||
const ib = inboundsById[id];
|
||||
const proto = (ib?.protocol || '').toLowerCase();
|
||||
const color = INBOUND_PROTOCOL_COLORS[proto] ?? 'default';
|
||||
const compactLabel = ib?.tag ?? '';
|
||||
const compactLabel = ib?.remark?.trim() || ib?.tag || '';
|
||||
return (
|
||||
<Tooltip key={id} title={inboundLabel(id)}>
|
||||
<Tag color={color} style={{ margin: 2 }}>
|
||||
|
||||
@@ -50,7 +50,7 @@ export default function FilterDrawer({
|
||||
const inboundOptions = useMemo(
|
||||
() => inbounds.map((ib) => ({
|
||||
value: ib.id,
|
||||
label: ib.tag ?? '',
|
||||
label: ib.remark?.trim() || ib.tag || '',
|
||||
})),
|
||||
[inbounds],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user