AI Update: تست اف تی پی نتیجه رو درست نمیگه
This commit is contained in:
+17
-2
@@ -4832,9 +4832,24 @@ async def callback_handler(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
path=curr_proj.ftp_path or "/",
|
||||
tls=curr_proj.ftp_tls,
|
||||
)
|
||||
icon = "✅" if test_ok else "❌"
|
||||
res_card = (
|
||||
f"{icon} <b>نتیجه تست اتصال FTP:</b>\n\n"
|
||||
f"• 🌐 <b>هاست:</b> <code>{escape_html(curr_proj.ftp_host)}:{curr_proj.ftp_port}</code>\n"
|
||||
f"• 👤 <b>نام کاربری:</b> <code>{escape_html(curr_proj.ftp_user or '(بدون نام کاربری)')}</code>\n"
|
||||
f"• 📂 <b>مسیر:</b> <code>{escape_html(curr_proj.ftp_path or '/')}</code>\n"
|
||||
f"• 🔒 <b>پروتکل:</b> {'FTPS/TLS امن 🔒' if curr_proj.ftp_tls else 'FTP معمولی'}\n\n"
|
||||
f"📋 <b>گزارش ارتباط:</b>\n{test_msg}"
|
||||
) if is_fa else (
|
||||
f"{icon} <b>FTP Connection Test Result:</b>\n\n"
|
||||
f"• 🌐 <b>Host:</b> <code>{escape_html(curr_proj.ftp_host)}:{curr_proj.ftp_port}</code>\n"
|
||||
f"• 👤 <b>User:</b> <code>{escape_html(curr_proj.ftp_user or '(none)')}</code>\n"
|
||||
f"• 📂 <b>Path:</b> <code>{escape_html(curr_proj.ftp_path or '/')}</code>\n"
|
||||
f"• 🔒 <b>Protocol:</b> {'Secure FTPS/TLS 🔒' if curr_proj.ftp_tls else 'Standard FTP'}\n\n"
|
||||
f"📋 <b>Status:</b>\n{test_msg}"
|
||||
)
|
||||
try:
|
||||
alert_text = ("✅ اتصال FTP برقرار است" if test_ok else "❌ خطا در اتصال FTP") + f"\n{test_msg}"
|
||||
await query.answer(alert_text[:200], show_alert=True)
|
||||
await query.message.reply_html(res_card, disable_web_page_preview=True)
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user