fix time and text/ cosmetic fixes/ description of the payment/ vat_code
This commit is contained in:
@@ -29,7 +29,6 @@ from handlers.keys.key_utils import (
|
||||
)
|
||||
from logger import logger
|
||||
from panels.remnawave import RemnawaveAPI
|
||||
from panels.remnawave_time import get_all_nodes_with_online
|
||||
|
||||
from ..panel.keyboard import AdminPanelCallback, build_admin_back_kb
|
||||
from .keyboard import (
|
||||
@@ -392,41 +391,20 @@ async def handle_cluster_availability(
|
||||
result_text += f"🌍 <b>{prefix} {server_name}</b> - {online_inbound_users} онлайн\n"
|
||||
|
||||
elif panel_type == "remnawave":
|
||||
# remna = RemnawaveAPI(server["api_url"])
|
||||
# if not await remna.login(REMNAWAVE_LOGIN, REMNAWAVE_PASSWORD):
|
||||
# raise Exception("Не удалось авторизоваться")
|
||||
|
||||
server_inbound_id = server.get("inbound_id")
|
||||
if not server_inbound_id:
|
||||
raise Exception("Не указан inbound_id сервера")
|
||||
|
||||
# all_nodes = await remna.get_all_nodes()
|
||||
# if not all_nodes:
|
||||
# raise Exception("Не удалось получить список нод")
|
||||
|
||||
# matching_node = None
|
||||
# for node in all_nodes:
|
||||
# excluded_inbounds = node.get("excludedInbounds", [])
|
||||
# if server_inbound_id not in excluded_inbounds:
|
||||
# matching_node = node
|
||||
# break
|
||||
|
||||
# if not matching_node:
|
||||
# raise Exception("Нода, обслуживающая этот inbound_id, не найдена")
|
||||
|
||||
# online_remna_users = matching_node.get("usersOnline", 0)
|
||||
# total_online_users += online_remna_users
|
||||
# result_text += (
|
||||
# f"🌍 <b>{prefix} {server_name}</b> - {online_remna_users} онлайн\n"
|
||||
# )
|
||||
|
||||
nodes_data = await get_all_nodes_with_online(
|
||||
server["api_url"], REMNAWAVE_LOGIN, REMNAWAVE_PASSWORD, server_inbound_id
|
||||
remna = RemnawaveAPI(server["api_url"])
|
||||
nodes_data = await remna.get_all_nodes_with_online(
|
||||
username=REMNAWAVE_LOGIN,
|
||||
password=REMNAWAVE_PASSWORD,
|
||||
inbound_id=server_inbound_id
|
||||
)
|
||||
|
||||
|
||||
if nodes_data.get("error"):
|
||||
raise Exception(nodes_data["error"])
|
||||
|
||||
|
||||
online_remna_users = nodes_data["total_online"]
|
||||
total_online_users += online_remna_users
|
||||
|
||||
@@ -442,7 +420,7 @@ async def handle_cluster_availability(
|
||||
flag = ''.join(chr(ord(c) + 127397) for c in country_code.upper())
|
||||
else:
|
||||
flag = country_code
|
||||
|
||||
|
||||
result_text += f" ↳ {flag} ({node_name}): {online_users} онлайн\n"
|
||||
else:
|
||||
result_text += (
|
||||
|
||||
Reference in New Issue
Block a user