mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-16 10:05:00 +03:00
feat(tgbot): show inbound remark alongside email in the online clients list
Online-client buttons showed only the email, which is ambiguous when the same usernames exist across inbounds. Label each button email - remark via the canonical GetClientInboundByEmail lookup (first matching inbound for multi-inbound clients); the callback payload stays the bare email. Closes #5318
This commit is contained in:
@@ -374,7 +374,11 @@ func (t *Tgbot) onlineClients(chatId int64, messageID ...int) {
|
|||||||
if onlinesCount > 0 {
|
if onlinesCount > 0 {
|
||||||
var buttons []telego.InlineKeyboardButton
|
var buttons []telego.InlineKeyboardButton
|
||||||
for _, online := range onlines {
|
for _, online := range onlines {
|
||||||
buttons = append(buttons, tu.InlineKeyboardButton(online).WithCallbackData(t.encodeQuery("client_get_usage "+online)))
|
label := online
|
||||||
|
if _, inbound, err := t.inboundService.GetClientInboundByEmail(online); err == nil && inbound != nil && inbound.Remark != "" {
|
||||||
|
label = online + " - " + inbound.Remark
|
||||||
|
}
|
||||||
|
buttons = append(buttons, tu.InlineKeyboardButton(label).WithCallbackData(t.encodeQuery("client_get_usage "+online)))
|
||||||
}
|
}
|
||||||
cols := 0
|
cols := 0
|
||||||
if onlinesCount < 21 {
|
if onlinesCount < 21 {
|
||||||
|
|||||||
Reference in New Issue
Block a user