fix cashback in stats/back tariff/disable cluster
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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="➕ Добавить кластер",
|
||||
|
||||
@@ -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()
|
||||
)]
|
||||
]
|
||||
)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user