diff --git a/.env.example b/.env.example index c4d57d2..4a99862 100644 --- a/.env.example +++ b/.env.example @@ -212,6 +212,7 @@ LOG_PAYMENTS=True # LOG_PROMO_ACTIVATIONS=True # Log promo code activations LOG_TRIAL_ACTIVATIONS=True # Log trial activations LOG_SUSPICIOUS_ACTIVITY=True # Log suspicious activity +LOG_ADMIN_ACTIONS=True # Log actions from users listed in ADMIN_IDS # Embedded mode thumbnails. Please don't touch this if you don't know what it is. INLINE_REFERRAL_THUMBNAIL_URL=https://cdn-icons-png.flaticon.com/512/1077/1077114.png diff --git a/bot/app/web/admin_settings_manifest.py b/bot/app/web/admin_settings_manifest.py index 700382a..d704a23 100644 --- a/bot/app/web/admin_settings_manifest.py +++ b/bot/app/web/admin_settings_manifest.py @@ -26,6 +26,8 @@ class SettingField: max: Optional[float] = None choices: Optional[Tuple[Tuple[str, str], ...]] = None subsection: Optional[str] = None # group label inside a section + i18n_label_key: Optional[str] = None + i18n_description_key: Optional[str] = None SETTINGS_MANIFEST: List[SettingField] = [ @@ -165,6 +167,15 @@ SETTINGS_MANIFEST: List[SettingField] = [ SettingField("LOG_PROMO_ACTIVATIONS", "bool", "notifications", "Логировать активации промокодов"), SettingField("LOG_TRIAL_ACTIVATIONS", "bool", "notifications", "Логировать активации триала"), SettingField("LOG_SUSPICIOUS_ACTIVITY", "bool", "notifications", "Логировать подозрительные действия"), + SettingField( + "LOG_ADMIN_ACTIONS", + "bool", + "notifications", + "Логировать действия администраторов", + "Если выключено, события от пользователей из ADMIN_IDS не записываются в message logs.", + i18n_label_key="admin_settings_field_log_admin_actions_label", + i18n_description_key="admin_settings_field_log_admin_actions_description", + ), SettingField("LOG_LEVEL", "string", "notifications", "Глобальный уровень логов", "DEBUG / INFO / WARNING / ERROR"), SettingField("LOG_CHAT_ID", "int", "notifications", "ID чата для логов"), SettingField("LOG_THREAD_ID", "int", "notifications", "ID треда (для супергрупп)"), @@ -253,6 +264,8 @@ def manifest_payload() -> List[dict]: "subsection": field.subsection, "label": field.label, "description": field.description, + "i18n_label_key": field.i18n_label_key, + "i18n_description_key": field.i18n_description_key, "placeholder": field.placeholder, "optional": field.optional, "secret": field.secret, diff --git a/bot/app/web/frontend/src/admin/sections/SettingsSection.svelte b/bot/app/web/frontend/src/admin/sections/SettingsSection.svelte index db8e495..f0f84fb 100644 --- a/bot/app/web/frontend/src/admin/sections/SettingsSection.svelte +++ b/bot/app/web/frontend/src/admin/sections/SettingsSection.svelte @@ -97,7 +97,7 @@