feat: show optional serivce description before payment

This commit is contained in:
3252a8
2026-05-20 21:55:22 +03:00
parent d8a1da1f13
commit 7521f89ffd
51 changed files with 1199 additions and 499 deletions
+1 -1
View File
@@ -514,7 +514,7 @@ def _support_email(
footer = _t_html(_resolve_i18n(i18n), lang, "email_footer_auto", brand=brand)
preview_block = (
f'<div style="margin:0 0 16px 0;background:{_BG};border:1px solid {_BORDER};'
f'border-radius:14px;padding:14px 16px;font-size:14px;line-height:1.55;color:{_TEXT};'
f"border-radius:14px;padding:14px 16px;font-size:14px;line-height:1.55;color:{_TEXT};"
f'white-space:pre-wrap;">{html.escape(body_preview or "")}</div>'
)
body_parts = [_info_rows_html(rows), preview_block]
+1 -3
View File
@@ -290,9 +290,7 @@ class NotificationService:
return bool(value)
async def support_admin_email_notifications_enabled(self) -> bool:
enabled = bool(
getattr(self.settings, SUPPORT_ADMIN_EMAIL_NOTIFICATIONS_KEY, False)
)
enabled = bool(getattr(self.settings, SUPPORT_ADMIN_EMAIL_NOTIFICATIONS_KEY, False))
if not self.session_factory:
return enabled
try:
@@ -255,8 +255,7 @@ class PanelWebhookService:
"panel",
{"event": event_name, "user": user_data},
event_id=(
f"{event_name}:"
f"{telegram_id or user_data.get('uuid') or user_data.get('shortUuid')}"
f"{event_name}:{telegram_id or user_data.get('uuid') or user_data.get('shortUuid')}"
),
)
if not queued:
@@ -70,10 +70,9 @@ def _apply_to_provider_bundle(key: str, value: Any) -> bool:
from bot.payment_providers import (
find_manifest_owner,
get_provider_bundle,
get_spec_presentation,
)
from bot.payment_providers import get_spec_presentation
owner = find_manifest_owner(key)
if owner is None:
return False
@@ -213,9 +212,7 @@ async def load_overrides_from_db(settings: Settings, async_session_factory: sess
overrides = await app_settings_dal.get_all_overrides(session)
backup_overrides = _read_appearance_backup()
missing_backup_overrides = {
key: value
for key, value in backup_overrides.items()
if key not in overrides
key: value for key, value in backup_overrides.items() if key not in overrides
}
if missing_backup_overrides:
for key, value in missing_backup_overrides.items():
+6 -6
View File
@@ -644,12 +644,12 @@ class TariffTrafficWorker:
for node_uuid in node_uuids:
stats_cache_key = (node_uuid, start_date, end_date)
if stats_cache_key not in self._premium_node_stats_tick_cache:
self._premium_node_stats_tick_cache[stats_cache_key] = (
await self.panel_service.get_node_users_bandwidth_stats(
node_uuid,
start=start_date,
end=end_date,
)
self._premium_node_stats_tick_cache[
stats_cache_key
] = await self.panel_service.get_node_users_bandwidth_stats(
node_uuid,
start=start_date,
end=end_date,
)
stats = self._premium_node_stats_tick_cache.get(stats_cache_key)
if not stats: