add alias for key menu in admin-panel
This commit is contained in:
+3
-1
@@ -1155,7 +1155,8 @@ async def get_key_details(email, session):
|
||||
record = await session.fetchrow(
|
||||
"""
|
||||
SELECT k.server_id, k.key, k.remnawave_link, k.email, k.is_frozen,
|
||||
k.expiry_time, k.client_id, k.created_at, u.tg_id, u.balance
|
||||
k.expiry_time, k.client_id, k.created_at, k.alias,
|
||||
u.tg_id, u.balance
|
||||
FROM keys k
|
||||
JOIN users u ON k.tg_id = u.tg_id
|
||||
WHERE k.email = $1
|
||||
@@ -1193,6 +1194,7 @@ async def get_key_details(email, session):
|
||||
"email": record["email"],
|
||||
"is_frozen": record["is_frozen"],
|
||||
"balance": record["balance"],
|
||||
"alias": record["alias"],
|
||||
"expiry_date": expiry_date.strftime("%d %B %Y года %H:%M"),
|
||||
"days_left_message": days_left_message,
|
||||
"link": public_link or remna_link,
|
||||
|
||||
@@ -436,6 +436,7 @@ async def handle_key_edit(
|
||||
return
|
||||
|
||||
key_value = key_details.get("key") or key_details.get("remnawave_link") or "—"
|
||||
alias = key_details.get("alias")
|
||||
|
||||
text = (
|
||||
f"<b>🔑 Информация о ключе</b>"
|
||||
@@ -445,11 +446,18 @@ async def handle_key_edit(
|
||||
f"\n🆔 ID клиента: <b>{key_details['tg_id']}</b>"
|
||||
)
|
||||
|
||||
if alias:
|
||||
text += f"\n🏷️ Имя ключа: <b>{alias}</b>"
|
||||
|
||||
if not update or not callback_data.edit:
|
||||
await callback_query.message.edit_text(text=text, reply_markup=build_key_edit_kb(key_details, email))
|
||||
await callback_query.message.edit_text(
|
||||
text=text,
|
||||
reply_markup=build_key_edit_kb(key_details, email)
|
||||
)
|
||||
else:
|
||||
await callback_query.message.edit_text(
|
||||
text=text, reply_markup=build_users_key_expiry_kb(callback_data.tg_id, email)
|
||||
text=text,
|
||||
reply_markup=build_users_key_expiry_kb(callback_data.tg_id, email)
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user