Add geographic coordinates to IP data and enhance map visualization
- Introduced latitude and longitude fields in the IP data structure to support geographic information. - Updated the API documentation to reflect the inclusion of geographic coordinates in the unique IPs endpoint. - Enhanced the UI to display a map of connections using Leaflet, providing a visual representation of IP locations based on the new geographic data. - Improved the handling of GeoIP data to ensure accurate mapping and user experience when GeoIP is enabled.
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@
|
||||
| --- | --- | --- |
|
||||
| GET | `/api/agg/summary` | Сводка по флоту, список опросов upstream, `fleet_total_megabytes` / `fleet_total_connections`. Два топа (размер задаётся `top_n`): **`top_users`** — самые «прожорливые» по суммарному трафику (MiB) по всем серверам; **`top_users_by_unique_ips`** — по максимальному `active_unique_ips` среди серверов для пользователя (как в Telemt, снимок). |
|
||||
| GET | `/api/agg/traffic` | Трафик по каждому пользователю в разрезе серверов: `servers.<alias>.total_megabytes`. |
|
||||
| GET | `/api/agg/unique-ips` | Уникальные IP по пользователю: на каких серверах IP есть в active/recent списках снимка. При **`geoip.enabled`** в конфиге — из City: `country_code`, `country_name`, `city_name`; при наличии ASN-БД — `asn`, `as_organization` (см. [GEOIP.md](GEOIP.md)); отключить гео для запроса: `?geo=false`. |
|
||||
| GET | `/api/agg/unique-ips` | Уникальные IP по пользователю: на каких серверах IP есть в active/recent списках снимка. При **`geoip.enabled`** в конфиге — из City: `country_code`, `country_name`, `city_name`, а также `latitude`, `longitude` (если доступны); при наличии ASN-БД — `asn`, `as_organization` (см. [GEOIP.md](GEOIP.md)); отключить гео для запроса: `?geo=false`. |
|
||||
| GET | `/api/agg/users` | Объединённый список пользователей с `by_server`, суммарным `total_megabytes` и **смерженными лимитами** (см. ниже). |
|
||||
| GET | `/api/agg/user/{username}` | Один пользователь в том же формате, что элементы `/api/agg/users` (без списка всех). Имя в пути: `[A-Za-z0-9_.-]+`. Ответ **`404`**, если пользователь не найден ни на одном успешном upstream. |
|
||||
| GET | `/api/agg/fleet-status` | По каждому алиасу: параллельно health + system/info; в `data.servers[]` — статусы подзапросов и тела `health` / `system_info` при успехе. См. [AGGREGATE_OPENAPI.yaml](AGGREGATE_OPENAPI.yaml). |
|
||||
|
||||
@@ -211,6 +211,8 @@ components:
|
||||
country_code: { type: string, nullable: true }
|
||||
country_name: { type: string, nullable: true }
|
||||
city_name: { type: string, nullable: true }
|
||||
latitude: { type: number, format: float, nullable: true }
|
||||
longitude: { type: number, format: float, nullable: true }
|
||||
asn: { type: integer, format: int64, nullable: true }
|
||||
as_organization: { type: string, nullable: true }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user