mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-17 07:37:15 +00:00
feat(inbounds): show linked host remarks in inbound list (#6468)
* feat(inbounds): show linked host remarks in inbound list Join Host Group remarks from the existing hosts list onto each inbound row client-side so multiple endpoints (IPv4/IPv6/CDN) are visible without opening the inbound. Truncate long lists with a tooltip for the full set. Fixes #6026 * fix(inbounds): skip disabled host groups in inbound list remarks buildHostRemarksByInboundId joined every host group from /hosts/list onto its inbounds, so a group toggled off on the Hosts page still read as a live endpoint in the inbound remark cell and matched the search box. A disabled group serves nothing: internal/sub/host_sub.go filters it out of subscription output and withMtprotoHostEndpoints skips it for MTProto share links. Skip it here the same way, and drop the unread `truncated` field from formatHostRemarksLabel. --------- Co-authored-by: mrchatam <287639636+mrchatam@users.noreply.github.com> Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { buildHostRemarksByInboundId } from '@/pages/inbounds/list/helpers';
|
||||
|
||||
describe('buildHostRemarksByInboundId', () => {
|
||||
it('joins only host groups a client can reach (#6026)', () => {
|
||||
const map = buildHostRemarksByInboundId([
|
||||
{ remark: 'USA IPv4', inboundIds: [1, 2], hosts: ['1.2.3.4:443'], isDisabled: false },
|
||||
{ remark: 'USA IPv6', inboundIds: [1], hosts: ['[2001:db8::1]:443'], isDisabled: true },
|
||||
{ remark: '', inboundIds: [2], hosts: ['', 'cdn.example.com:443'], isDisabled: false },
|
||||
{ remark: 'USA IPv4', inboundIds: [2], hosts: ['5.6.7.8'] },
|
||||
]);
|
||||
expect(map.get(1)).toEqual(['USA IPv4']);
|
||||
expect(map.get(2)).toEqual(['USA IPv4', 'cdn.example.com:443']);
|
||||
expect(map.has(3)).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user