Files
cluster-map/static/index.html
T
Vitaliy ChefanovandClaude Opus 5.5 cf84e9976f UI rework: inventory tree, compact cards, live Hubble traffic
Frontend rewritten around three panes. Inventory tree on the left
(namespaces by kind, or nodes by namespace) with search and keyboard
navigation replaces the namespace checkbox list. The map shows only the
selected namespace(s) or node: fixed-size cards inside namespace boxes,
laid out in two elk passes so a big namespace packs into rows instead of
one tall column; zoom is capped so the view no longer jumps. Details
panel has Overview / Links / YAML / Logs tabs. Light and dark themes.
Libraries are vendored, no CDN.

Backend: /api/flows reads recent flows from hubble-relay (TLS verified
with the hubble CA, no client cert needed) and aggregates them per
source/destination/port. Pods are resolved to workloads with the same
rules as the graph, since Hubble leaves Workloads empty on some flows.
Pods under non-native controllers (kruise DaemonSet, CNPG clusters,
bare Jobs, static pods) are now graph nodes too. Probes move to
/healthz: /api/graph was timing out the 1s probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 19:50:53 +03:00

82 lines
4.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<title>cluster-map</title>
<link rel="stylesheet" href="app.css">
<script src="vendor/cytoscape.min.js"></script>
<script src="vendor/elk.bundled.js"></script>
</head>
<body>
<header class="topbar">
<div class="brand">cluster-map</div>
<nav class="crumbs" id="crumbs" aria-label="Текущий вид"></nav>
<div class="topbar-actions">
<label class="toggle"><input type="checkbox" id="traffic-on" checked> Трафик</label>
<select id="traffic-window" aria-label="Окно трафика">
<option value="300">5 мин</option>
<option value="900">15 мин</option>
<option value="3600">1 час</option>
</select>
<label class="toggle" title="Проверки kubelet, cilium health, трафик между нодами"><input type="checkbox" id="infra-traffic"> Служебный</label>
<button type="button" id="reload" class="btn">Обновить</button>
<span class="muted small" id="updated"></span>
</div>
</header>
<div class="layout">
<aside class="sidebar" aria-label="Инвентарь">
<div class="seg" role="tablist" aria-label="Группировка">
<button type="button" role="tab" id="view-ns" aria-selected="true" aria-controls="tree">Namespaces</button>
<button type="button" role="tab" id="view-nodes" aria-selected="false" aria-controls="tree">Ноды</button>
</div>
<input type="search" id="tree-filter" placeholder="Поиск: имя, namespace, образ…" aria-label="Поиск по инвентарю">
<ul class="tree" id="tree" role="tree" aria-label="Объекты кластера"></ul>
<p class="hint">Клик — открыть на карте. Ctrl+клик по namespace — добавить к текущему виду.</p>
</aside>
<main class="stage">
<div id="cy" aria-label="Карта"></div>
<div class="stage-status" id="stage-status" role="status" aria-live="polite"></div>
<div class="zoom" role="group" aria-label="Масштаб">
<button type="button" class="btn icon" id="zoom-in" aria-label="Приблизить">+</button>
<button type="button" class="btn icon" id="zoom-out" aria-label="Отдалить">−</button>
<button type="button" class="btn icon" id="zoom-fit" aria-label="Показать всё">⤢</button>
</div>
<div class="legend" id="legend"></div>
</main>
<aside class="details" id="details" aria-label="Детали объекта" hidden>
<div class="details-head">
<div class="details-title">
<span class="kind-chip" id="d-kind"></span>
<h2 id="d-name"></h2>
<div class="muted small" id="d-sub"></div>
</div>
<button type="button" class="btn icon" id="d-close" aria-label="Закрыть панель">×</button>
</div>
<div class="tabs" role="tablist" aria-label="Разделы">
<button type="button" role="tab" data-tab="overview" aria-selected="true">Обзор</button>
<button type="button" role="tab" data-tab="links" aria-selected="false">Связи</button>
<button type="button" role="tab" data-tab="yaml" aria-selected="false">YAML</button>
<button type="button" role="tab" data-tab="logs" aria-selected="false">Логи</button>
</div>
<section class="tab-panel" data-panel="overview" role="tabpanel"></section>
<section class="tab-panel" data-panel="links" role="tabpanel" hidden></section>
<section class="tab-panel" data-panel="yaml" role="tabpanel" hidden><pre class="code" id="d-yaml"></pre></section>
<section class="tab-panel" data-panel="logs" role="tabpanel" hidden>
<div class="logs-bar">
<select id="pod-select" aria-label="Под"></select>
<select id="container-select" aria-label="Контейнер"></select>
<button type="button" class="btn" id="logs-reload">Обновить</button>
</div>
<pre class="code" id="d-logs"></pre>
</section>
</aside>
</div>
<script src="app.js"></script>
</body>
</html>