Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions frontend/css/topology.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
.section[data-section="topology"] {
overflow-y: auto;
}

.topology-panel {
padding: 1.25rem;
max-width: 1100px;
margin: 0 auto;
}

.topology-panel__header {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: space-between;
gap: 1rem;
margin-bottom: 0.75rem;
}

.topology-panel__title {
margin: 0;
font-size: 1.1rem;
color: var(--text-primary, #f1f5f9);
}

.topology-panel__desc {
margin: 0.25rem 0 0;
font-size: 0.78rem;
color: var(--text-secondary, #94a3b8);
max-width: 36rem;
}

.topology-panel__controls {
display: inline-flex;
gap: 0.35rem;
}

.topology-btn {
background: rgba(15, 23, 42, 0.8);
border: 1px solid rgba(51, 65, 85, 0.8);
color: var(--text-secondary, #94a3b8);
font-size: 0.72rem;
font-family: var(--font-mono);
padding: 0.25rem 0.55rem;
border-radius: 6px;
cursor: pointer;
}

.topology-btn--active,
.topology-btn:hover {
color: var(--accent-cyan, #06b6d4);
border-color: rgba(6, 182, 212, 0.45);
}

.topology-panel__meta {
display: flex;
gap: 1rem;
font-family: var(--font-mono);
font-size: 0.68rem;
color: #64748b;
margin-bottom: 0.5rem;
}

.topology-panel__canvas-wrap {
position: relative;
background: var(--card-bg, #111827);
border: 1px solid var(--border, #1e293b);
border-radius: 12px;
min-height: 420px;
overflow: hidden;
}

.topology-svg {
display: block;
width: 100%;
min-height: 420px;
}

.topology-empty {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
color: var(--text-secondary, #94a3b8);
font-size: 0.85rem;
pointer-events: none;
}

.topology-legend {
display: flex;
flex-wrap: wrap;
gap: 1rem;
margin-top: 0.75rem;
font-size: 0.68rem;
color: #64748b;
}

.topology-swatch {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
margin-right: 0.3rem;
vertical-align: middle;
}

.topology-swatch--mt { background: #06b6d4; }
.topology-swatch--mc { background: #a855f7; }
.topology-swatch--weak {
background: transparent;
border: 1px dashed #64748b;
border-radius: 2px;
width: 14px;
height: 0;
}

@media (max-width: 768px) {
.topology-panel { padding: 0.85rem; }
.topology-panel__header { flex-direction: column; }
}
24 changes: 24 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<link rel="stylesheet" href="css/radio_channels.css" />
<link rel="stylesheet" href="css/radio_readout.css" />
<link rel="stylesheet" href="css/stats.css" />
<link rel="stylesheet" href="css/topology.css" />
<link rel="stylesheet" href="css/settings.css" />
<link rel="stylesheet" href="css/configuration.css" />
<link rel="stylesheet" href="css/gps.css" />
Expand Down Expand Up @@ -102,6 +103,21 @@
<span class="sidebar__label">Stats</span>
</a>
</li>
<li class="sidebar__item">
<a href="#/topology" class="sidebar__link" data-route="topology">
<span class="sidebar__icon">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="5" cy="6" r="2"/>
<circle cx="19" cy="6" r="2"/>
<circle cx="12" cy="18" r="2"/>
<line x1="6.8" y1="7.5" x2="11" y2="16.5"/>
<line x1="17.2" y1="7.5" x2="13" y2="16.5"/>
<line x1="7" y1="6" x2="17" y2="6"/>
</svg>
</span>
<span class="sidebar__label">Topology</span>
</a>
</li>
<li class="sidebar__item">
<a href="#/messages" class="sidebar__link" data-route="messages">
<span class="sidebar__icon">
Expand Down Expand Up @@ -391,6 +407,12 @@
</div>
</section>

<section class="section" data-section="topology" style="display:none">
<div id="topology-panel" class="topology-panel">
<div class="stats-panel__loading">Loading topology...</div>
</div>
</section>

<section class="section" data-section="messages" style="display:none">
<div id="messaging-panel"></div>
</section>
Expand Down Expand Up @@ -679,6 +701,7 @@ <h3 class="dangerous-panel__title">Service actions</h3>
<script src="js/node_cards_sort.js"></script>
<script src="js/node_cards.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.4/dist/chart.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/d3@7.9.0/dist/d3.min.js"></script>
<script src="js/node_metrics_chart.js"></script>
<script src="js/node_drawer.js"></script>
<script src="js/simple_packet_feed.js"></script>
Expand All @@ -693,6 +716,7 @@ <h3 class="dangerous-panel__title">Service actions</h3>
<script src="js/radio_companion_card.js"></script>
<script src="js/radio_settings.js"></script>
<script src="js/stats_tab.js"></script>
<script src="js/topology_tab.js"></script>
<script src="js/signout_controller.js"></script>
<script src="js/settings/password_change_form.js"></script>
<script src="js/settings/sign_out_all_form.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion frontend/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ document.addEventListener('DOMContentLoaded', async () => {
const router = new Router({
defaultRoute: 'dashboard',
allowedRoutes: [
'dashboard', 'stats', 'messages', 'radio', 'terminal',
'dashboard', 'stats', 'topology', 'messages', 'radio', 'terminal',
'configuration/identity', 'configuration/radio',
'configuration/channels', 'configuration/transmit',
'configuration/mqtt',
Expand Down Expand Up @@ -502,6 +502,7 @@ function _bootCommandPaletteAndKeymap(router) {
const routeCommands = [
['dashboard', 'Go to Dashboard', 'Pages'],
['stats', 'Go to Stats', 'Pages'],
['topology', 'Go to Topology', 'Pages'],
['messages', 'Go to Messages', 'Pages'],
['radio', 'Go to Radio', 'Pages'],
['terminal', 'Go to Terminal', 'Pages'],
Expand Down
5 changes: 3 additions & 2 deletions frontend/js/components/node_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,9 @@ class NodeMap {

async _loadTopology() {
try {
const res = await fetch('/api/analytics/topology');
const links = await res.json();
const res = await fetch('/api/analytics/topology?hours=24');
const data = await res.json();
const links = Array.isArray(data) ? data : (data.edges || []);
this._topologyLayer.clearLayers();

for (const link of links) {
Expand Down
Loading
Loading