mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-16 00:01:02 +00:00
feat(routing): show tag (remark) in routing rules list (#5151)
* feat(routing): show tag (remark) in routing rules list Rules table and mobile cards showed raw inboundTag while the form already used remarks. Display "tag (remark)" when a remark exists; saved rules still store tags only. Signed-off-by: aleskxyz <39186039+aleskxyz@users.noreply.github.com> * feat(inbounds): show "tag (remark)" consistently wherever an inbound is listed Add a shared formatInboundLabel/formatInboundTag helper and apply the "tag (remark)" format across the routing rules table, mobile cards, the rule form and route tester, plus the client attach/detach/filter modals and the attached-inbounds column. Falls back to the bare tag when no distinct remark exists. Also fix the routing rules list mis-rendering inbounds whose remark contains a comma: formatted entries are now carried as an array end to end instead of being joined and re-split on commas. --------- Signed-off-by: aleskxyz <39186039+aleskxyz@users.noreply.github.com> Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Display label for an inbound: `tag (remark)` when a distinct remark exists,
|
||||
* otherwise just the tag. Falls back to the remark when no tag is set, and to an
|
||||
* empty string when neither is present.
|
||||
*/
|
||||
export function formatInboundLabel(tag?: string, remark?: string): string {
|
||||
const tagText = (tag || '').trim();
|
||||
const remarkText = (remark || '').trim();
|
||||
if (!tagText) return remarkText;
|
||||
if (!remarkText || remarkText === tagText) return tagText;
|
||||
return `${tagText} (${remarkText})`;
|
||||
}
|
||||
Reference in New Issue
Block a user