diff --git a/handlers/admin/clusters/clusters_handler.py b/handlers/admin/clusters/clusters_handler.py index 9b23e018..f9dbad14 100644 --- a/handlers/admin/clusters/clusters_handler.py +++ b/handlers/admin/clusters/clusters_handler.py @@ -63,7 +63,7 @@ class AdminClusterStates(StatesGroup): IsAdminFilter(), ) async def handle_servers(callback_query: CallbackQuery, session: AsyncSession): - servers = await get_servers(session) + servers = await get_servers(session, include_enabled=True) text = ( "🔧 Управление кластерами\n\n" diff --git a/handlers/admin/clusters/keyboard.py b/handlers/admin/clusters/keyboard.py index fe8c28f9..be962e04 100644 --- a/handlers/admin/clusters/keyboard.py +++ b/handlers/admin/clusters/keyboard.py @@ -16,18 +16,20 @@ def build_clusters_editor_kb(servers: dict) -> InlineKeyboardMarkup: cluster_names = list(servers.keys()) for i in range(0, len(cluster_names), 2): - builder.row( - *[ + row_buttons = [] + for name in cluster_names[i : i + 2]: + servers_in_cluster = servers[name] + all_disabled = all(not s["enabled"] for s in servers_in_cluster) + label = f"❌ {name} (отключен)" if all_disabled else f"⚙️ {name}" + row_buttons.append( InlineKeyboardButton( - text=f"⚙️ {name}", + text=label, callback_data=AdminClusterCallback( action="manage", data=name ).pack(), ) - for name in cluster_names[i : i + 2] - ] - ) - + ) + builder.row(*row_buttons) builder.row( InlineKeyboardButton( text="➕ Добавить кластер", diff --git a/handlers/admin/tariffs/keyboard.py b/handlers/admin/tariffs/keyboard.py index dcd362b3..2cbd6caf 100644 --- a/handlers/admin/tariffs/keyboard.py +++ b/handlers/admin/tariffs/keyboard.py @@ -154,6 +154,9 @@ def build_edit_tariff_fields_kb(tariff_id: int) -> InlineKeyboardMarkup: text="🔘 Активность", callback_data=f"toggle_active|{tariff_id}" ) ], - [InlineKeyboardButton(text="⬅️ Назад", callback_data=f"view|{tariff_id}")], + [InlineKeyboardButton( + text="⬅️ Назад", + callback_data=AdminTariffCallback(action=f"view|{tariff_id}").pack() + )] ] ) diff --git a/handlers/payments/utils.cpython-312-x86_64-linux-gnu.so b/handlers/payments/utils.cpython-312-x86_64-linux-gnu.so index 2dfd817c..4a21ad27 100644 Binary files a/handlers/payments/utils.cpython-312-x86_64-linux-gnu.so and b/handlers/payments/utils.cpython-312-x86_64-linux-gnu.so differ diff --git a/handlers/payments/yookassa_pay.cpython-312-x86_64-linux-gnu.so b/handlers/payments/yookassa_pay.cpython-312-x86_64-linux-gnu.so index 4fe4949b..28353021 100644 Binary files a/handlers/payments/yookassa_pay.cpython-312-x86_64-linux-gnu.so and b/handlers/payments/yookassa_pay.cpython-312-x86_64-linux-gnu.so differ