diff --git a/frontend/src/lib/inbounds/label.ts b/frontend/src/lib/inbounds/label.ts index 59d80de7a..6a5fcb0e3 100644 --- a/frontend/src/lib/inbounds/label.ts +++ b/frontend/src/lib/inbounds/label.ts @@ -1,12 +1,9 @@ /** - * 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. + * Display label for an inbound: the remark when one is set, otherwise the + * inbound tag. Falls back 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})`; + if (remarkText) return remarkText; + return (tag || '').trim(); } diff --git a/main.go b/main.go index cef4c63de..09ea0d9f1 100644 --- a/main.go +++ b/main.go @@ -418,7 +418,7 @@ func GetApiToken(getApiToken bool) { if len(tokens) > 0 { fmt.Printf("There are %d API token(s) configured. Existing tokens cannot be retrieved in plaintext because only hashes are stored.\n", len(tokens)) fmt.Println("If you have lost your token, you can manage and generate new tokens through the Panel UI (Settings -> API Tokens).") - + // Create a new fallback token so the CLI is still useful without the UI fallbackName := fmt.Sprintf("cli-fallback-%d", time.Now().Unix()) created, err := apiTokenService.Create(fallbackName)