diff --git a/README.md b/README.md index d2aa02d..def5cf7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Возможности - 🔄 Подписка на NATS subjects/очереди в реальном времени -- 📊 Красивый веб-интерфейс для просмотра сообщений +- 📊 Веб-интерфейс: продюсер/потребитель по сообщениям, активные подключения к NATS - 🔍 Фильтрация по subject и поиск по содержимому - 📈 Статистика: количество сообщений, subjects, общий размер - 🌐 WebSocket для обновлений в реальном времени @@ -41,6 +41,9 @@ nats_url: "nats://localhost:4222" # username: "your-username" # password: "your-password" +# URL HTTP-мониторинга NATS (порт 8222) — для отображения активных подключений +# nats_monitor_url: "http://localhost:8222" + # Список subjects для подписки (через запятую) subjects: ">" diff --git a/index.html b/index.html index a24cdde..de38476 100644 --- a/index.html +++ b/index.html @@ -228,6 +228,64 @@ color: #1976d2; } + .message-producer-consumer { + display: flex; + gap: 20px; + margin-top: 8px; + font-size: 0.85em; + color: #555; + } + + .message-producer-consumer span { + display: flex; + align-items: center; + gap: 6px; + } + + .message-producer-consumer strong { + color: #333; + } + + .connections-section { + padding: 20px 30px; + border-bottom: 1px solid #eee; + } + + .connections-section h2 { + font-size: 1.3em; + margin-bottom: 15px; + color: #333; + } + + .connections-table { + width: 100%; + border-collapse: collapse; + font-size: 0.9em; + } + + .connections-table th, + .connections-table td { + padding: 10px 12px; + text-align: left; + border-bottom: 1px solid #eee; + } + + .connections-table th { + background: #f5f5f5; + font-weight: 600; + color: #555; + } + + .connections-table tr:hover { + background: #fafafa; + } + + .connections-empty { + color: #999; + padding: 20px; + text-align: center; + } + .empty-state { text-align: center; padding: 60px 20px; @@ -300,6 +358,13 @@ +
| CID | +Имя | +IP:Порт | +Подписок | +Входящие | +Исходящие | +Язык | +
|---|---|---|---|---|---|---|
| ${c.cid} | +${escapeHtml(c.name || '—')} | +${escapeHtml(c.ip || '')}:${c.port || ''} | +${c.subscriptions ?? '—'} | +${c.in_msgs ?? '—'} | +${c.out_msgs ?? '—'} | +${escapeHtml(c.lang || '—')} | +