Files
links/routermon/urls.py
T
junvandCopilot cfca2c2ed7 routermon: add WAN geo map + fix batch geo enrichment
- Add WanGeoStatsView (api/wan/geo/) returning country choropleth +
  bubble data for WAN source IPs using IPGeoCache lat/lon
- Add wanGeoMap (420px) in dashboard between ports chart and live table:
  red colour scale by country, rose bubbles sized by attempt count,
  top-5 country legend
- Rewrite _geo_worker_loop to drain up to 200 queue items per cycle,
  bulk DB cache check, batch API calls (100 IPs per request) instead
  of 1 request per IP — fixes ip-api.com timeout pile-up under scan
  volumes
- Add _geo_skip in-memory set: IPs that return no geo data get an
  empty IPGeoCache placeholder saved to DB so they are never retried;
  skip set also prevents re-queuing known-empty IPs during flush
- Remove _fetch_geo / _enrich_dns_geo / _enrich_wan_geo helpers
  (logic consolidated into the new batch worker)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-16 16:13:30 +10:00

19 lines
951 B
Python

from django.urls import path
from . import views
urlpatterns = [
path('', views.DashboardView.as_view(), name='routermon-dashboard'),
path('settings/', views.SettingsView.as_view(), name='routermon-settings'),
# HTMX partials
path('partials/queries/', views.LiveQueriesPartialView.as_view(), name='routermon-queries-partial'),
path('partials/wan/', views.WanLivePartialView.as_view(), name='routermon-wan-partial'),
# JSON APIs
path('api/chart/', views.ChartDataView.as_view(), name='routermon-chart'),
path('api/geo/', views.GeoStatsView.as_view(), name='routermon-geo'),
path('api/wan/chart/', views.WanChartDataView.as_view(), name='routermon-wan-chart'),
path('api/wan/geo/', views.WanGeoStatsView.as_view(), name='routermon-wan-geo'),
# Actions
path('toggle/', views.ToggleView.as_view(), name='routermon-toggle'),
path('status/', views.StatusStreamView.as_view(), name='routermon-status'),
]