From 7f484fa7b3b7539b7be84afdb28e28ce36bd5d30 Mon Sep 17 00:00:00 2001
From: 3252a8 <3252a8@proton.me>
Date: Sun, 24 May 2026 00:05:16 +0300
Subject: [PATCH] feat: warn about legacy tariff settings
---
.../src/admin/sections/SettingsSection.svelte | 23 ++++++++
frontend/src/styles/admin.css | 58 +++++++++++++++++++
locales/en.json | 3 +
locales/ru.json | 3 +
4 files changed, 87 insertions(+)
diff --git a/frontend/src/admin/sections/SettingsSection.svelte b/frontend/src/admin/sections/SettingsSection.svelte
index cce6bb2..050e061 100644
--- a/frontend/src/admin/sections/SettingsSection.svelte
+++ b/frontend/src/admin/sections/SettingsSection.svelte
@@ -7,6 +7,7 @@
EyeOff,
FileText,
Search,
+ TriangleAlert,
X,
} from "$components/ui/icons.js";
import * as UiIcons from "$components/ui/icons.js";
@@ -338,6 +339,25 @@
{/snippet}
+{#snippet renderLegacyTariffsWarning()}
+
@@ -573,6 +593,9 @@
{@const rootGroup = groups.find((g) => !g.label)}
{@const labelGroups = groups.filter((g) => g.label)}
+ {#if section.id === "pricing"}
+ {@render renderLegacyTariffsWarning()}
+ {/if}
{#if rootGroup}
{#if rootGroup.webhook}
{@render renderWebhookHint(rootGroup.webhook)}
diff --git a/frontend/src/styles/admin.css b/frontend/src/styles/admin.css
index c92a658..e0c08f1 100644
--- a/frontend/src/styles/admin.css
+++ b/frontend/src/styles/admin.css
@@ -1948,6 +1948,54 @@
flex: 0 0 auto;
}
+.admin-settings-warning {
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr) auto;
+ gap: 12px;
+ align-items: center;
+ min-width: 0;
+ margin: 14px 18px 4px;
+ padding: 12px 14px;
+ border: 1px solid var(--warning-border);
+ border-radius: 10px;
+ background: color-mix(in srgb, var(--warning) 10%, var(--admin-surface));
+ color: var(--admin-text);
+}
+
+.admin-settings-warning > svg {
+ color: var(--warning);
+}
+
+.admin-settings-warning-copy {
+ display: grid;
+ gap: 3px;
+ min-width: 0;
+}
+
+.admin-settings-warning-copy strong {
+ font-size: 13px;
+ line-height: 1.3;
+}
+
+.admin-settings-warning-copy p {
+ margin: 0;
+ color: var(--admin-muted);
+ font-size: 12px;
+ line-height: 1.45;
+}
+
+.admin-settings-warning-link {
+ color: var(--accent);
+ font-size: 12px;
+ font-weight: 700;
+ text-decoration: none;
+ white-space: nowrap;
+}
+
+.admin-settings-warning-link:hover {
+ text-decoration: underline;
+}
+
.admin-setting:last-child {
border-bottom: 0;
}
@@ -2704,6 +2752,16 @@
align-self: flex-start;
}
+ .admin-settings-warning {
+ grid-template-columns: auto minmax(0, 1fr);
+ margin: 12px 14px 4px;
+ }
+
+ .admin-settings-warning-link {
+ grid-column: 2;
+ justify-self: start;
+ }
+
.admin-card-head {
padding: 12px 14px;
}
diff --git a/locales/en.json b/locales/en.json
index 357b1b2..bba929e 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -1241,6 +1241,9 @@
"admin_ads_col_status": "Status",
"admin_no_data": "No data",
"admin_settings_hint": "Changes in the admin panel take precedence over .env. The 'Reset' button returns the value from environment variables.",
+ "admin_settings_legacy_tariffs_warning_title": "Legacy tariffs",
+ "admin_settings_legacy_tariffs_warning_body": "These settings do not apply when tariffs are configured in the dedicated Tariffs section.",
+ "admin_settings_legacy_tariffs_warning_link": "Open Tariffs",
"admin_collapse_all": "Collapse all",
"admin_expand_all": "Expand all",
"admin_settings_params_count": "{count} parameters",
diff --git a/locales/ru.json b/locales/ru.json
index 78b799c..c7a4985 100644
--- a/locales/ru.json
+++ b/locales/ru.json
@@ -1241,6 +1241,9 @@
"admin_ads_col_status": "Статус",
"admin_no_data": "Нет данных",
"admin_settings_hint": "Изменения в админке имеют приоритет над .env. Кнопка «Сбросить» возвращает значение из переменных окружения.",
+ "admin_settings_legacy_tariffs_warning_title": "Legacy-тарифы",
+ "admin_settings_legacy_tariffs_warning_body": "Эти настройки не применяются, если тарифы настроены через отдельный раздел «Тарифы».",
+ "admin_settings_legacy_tariffs_warning_link": "Открыть тарифы",
"admin_collapse_all": "Свернуть всё",
"admin_expand_all": "Развернуть всё",
"admin_settings_params_count": "{count} параметров",