AI Update: تسک ها را آماده کن این ساختار عالیه
This commit is contained in:
@@ -615,3 +615,44 @@ def format_commit_detail_view(
|
||||
)
|
||||
|
||||
|
||||
def format_ftp_info(
|
||||
project_name: str,
|
||||
host: Optional[str],
|
||||
port: int = 21,
|
||||
user: Optional[str] = None,
|
||||
path: str = "/",
|
||||
tls: bool = False,
|
||||
lang: str = "fa",
|
||||
) -> str:
|
||||
"""Formats FTP connection and deployment status for Telegram HTML."""
|
||||
is_fa = (lang or "").lower() in ("fa", "farsi", "persian", "🇮🇷 persian / farsi (فارسی)")
|
||||
clean_p = escape_html(project_name)
|
||||
host_str = f"<code>{escape_html(host)}:{port}</code>" if host else ("<i>(تنظیم نشده)</i>" if is_fa else "<i>(Not configured)</i>")
|
||||
user_str = f"<code>{escape_html(user)}</code>" if user else ("<i>(ندارد)</i>" if is_fa else "<i>(None)</i>")
|
||||
path_str = f"<code>{escape_html(path)}</code>"
|
||||
tls_str = "بله (FTPS/TLS امن) 🔒" if tls else "خیر (FTP معمولی)"
|
||||
tls_str_en = "Yes (Secure FTPS/TLS) 🔒" if tls else "No (Standard FTP)"
|
||||
|
||||
if is_fa:
|
||||
return (
|
||||
f"🚀 <b>تنظیمات استقرار و دیپلوی FTP پروژه</b>\n\n"
|
||||
f"• 📁 <b>پروژه:</b> <code>{clean_p}</code>\n"
|
||||
f"• 🌐 <b>سرور / هاست FTP:</b> {host_str}\n"
|
||||
f"• 👤 <b>نام کاربری:</b> {user_str}\n"
|
||||
f"• 📂 <b>مسیر مقصد روی هاست:</b> {path_str}\n"
|
||||
f"• 🔒 <b>پروتکل امن (FTPS):</b> {tls_str}\n\n"
|
||||
f"💡 <i>در زمان دیپلوی، هوش مصنوعی فایلهای زائد، کش، سشنها و مخزن گیت (.git) را به صورت خودکار فیلتر کرده و تنها سورس اصلی و تمیز به سرور منتقل میشود.</i>"
|
||||
)
|
||||
else:
|
||||
return (
|
||||
f"🚀 <b>Project FTP Deployment Settings</b>\n\n"
|
||||
f"• 📁 <b>Project:</b> <code>{clean_p}</code>\n"
|
||||
f"• 🌐 <b>FTP Host:</b> {host_str}\n"
|
||||
f"• 👤 <b>Username:</b> {user_str}\n"
|
||||
f"• 📂 <b>Remote Target Path:</b> {path_str}\n"
|
||||
f"• 🔒 <b>Secure FTPS/TLS:</b> {tls_str_en}\n\n"
|
||||
f"💡 <i>During deployment, unnecessary cache, temp, sessions, and .git files are automatically excluded for a clean production upload.</i>"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user