fix cashback in stats/back tariff/disable cluster

This commit is contained in:
Vladless
2025-06-02 20:11:02 +03:00
parent f64c6b401a
commit b0d6c3fe4c
5 changed files with 14 additions and 9 deletions
+1 -1
View File
@@ -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 = (
"<b>🔧 Управление кластерами</b>\n\n"
+9 -7
View File
@@ -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=" Добавить кластер",
+4 -1
View File
@@ -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()
)]
]
)