feat: add country_code field to hosts response
This commit is contained in:
+3
-1
@@ -3,6 +3,7 @@ import logging
|
|||||||
from os import getenv
|
from os import getenv
|
||||||
from remnawave import RemnawaveSDK
|
from remnawave import RemnawaveSDK
|
||||||
from remnawave.models.hosts import GetAllHostsResponseDto
|
from remnawave.models.hosts import GetAllHostsResponseDto
|
||||||
|
from remnawave.models.nodes import GetOneNodeResponseDto
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
@@ -40,7 +41,8 @@ async def get_nodes():
|
|||||||
{
|
{
|
||||||
'name': clean_host_name(host.remark),
|
'name': clean_host_name(host.remark),
|
||||||
'address': host.address,
|
'address': host.address,
|
||||||
'port': host.port
|
'port': host.port,
|
||||||
|
'country_code': (await remnawave.nodes.get_one_node(uuid=host.nodes[0])).country_code
|
||||||
}
|
}
|
||||||
|
|
||||||
for host in hosts.root if not host.is_disabled and not host.is_hidden
|
for host in hosts.root if not host.is_disabled and not host.is_hidden
|
||||||
|
|||||||
Reference in New Issue
Block a user