- Introduced new `RadarConfig` structure in `config.go` to manage radar settings, including `statuses_url`, `http_timeout_ms`, and `ping_from`. - Implemented validation for radar configuration in `config_test.go` to ensure correct URL schemes and timeout limits. - Added new API routes for radar statuses and ping functionality in the gateway, enhancing the service's capabilities. - Updated documentation in `GATEWAY_RUN.md` to include details about the new radar features and their usage. - Enhanced the user interface to include navigation and display options for the Radar DC section in the sidebar and page titles. - Added client-side API functions for fetching radar statuses and ping responses, improving integration with the frontend.
Telemt Panel (Web UI)
SvelteKit + shadcn-svelte. В production статика собирается и встраивается в образ шлюза (Dockerfile в корне репозитория): панель и API на одном порту (например http://127.0.0.1:8080/ — UI, /api/… — шлюз).
Основные разделы панели
/— обзор флота (KPI, активные IP, сводка по нодам)/users,/users/[username]— пользователи и детали/ips— unique IP + GeoIP карта/incidents— triage-интерфейс инцидентов (ack/resolved/owner/noteв localStorage)/live— live snapshot (SSE, авто-reconnect)
Переменная PUBLIC_TELEMT_GATEWAY_URL
| Значение | Когда |
|---|---|
| (пусто) | Тот же хост и порт, что у страницы (Docker-образ шлюза, npm run build в Dockerfile с ENV PUBLIC_TELEMT_GATEWAY_URL=) |
http://127.0.0.1:8080 |
Локальная разработка: Vite на :5173, шлюз на :8080 |
Скопируйте .env.example в .env и при необходимости задайте URL.
Разработка (Vite отдельно от Go)
cd web
npm install
npm run dev
Откройте http://localhost:5173. В конфиге шлюза включите CORS для этого origin:
cors_allowed_origins:
- "http://localhost:5173"
Сборка только фронта
npm run build
Артефакт — каталог build/, при сборке Docker-образа шлюза он копируется в internal/webui/static/ и попадает в бинарник через embed.
Типы из OpenAPI агрегатов
npm run gen:api
Источник: ../docs/AGGREGATE_OPENAPI.yaml.
URL-driven controls (операторский режим)
На ключевых страницах используются query-параметры:
aliases=node-a,node-b— фильтр по нодамrefresh=0|10..300— auto-refresh (0 выключает polling)include_links=0|1— для/usersgeo=0|1— для/ips
Live-страница /live работает через SSE endpoint шлюза: /api/live/events.
Ограничения
- Секреты upstream к Telemt задаются на шлюзе (
authorization_env), не в браузере. - Для мутаций из другого origin шлюз отдаёт нужные заголовки CORS (в т.ч. методы
POST,PATCH,DELETE).