diff --git a/src/meshcore_hub/web/static/js/map-main.js b/src/meshcore_hub/web/static/js/map-main.js index 5e7a2ab..4a5ab40 100644 --- a/src/meshcore_hub/web/static/js/map-main.js +++ b/src/meshcore_hub/web/static/js/map-main.js @@ -104,10 +104,10 @@ var relativeTime = typeof formatRelativeTime === 'function' ? formatRelativeTime(node.last_seen) : ''; var timeDisplay = relativeTime ? ' (' + relativeTime + ')' : ''; - // Use logo for infrastructure nodes, blue circle for others + // Use red circle for infrastructure nodes, blue circle for others var iconHtml; if (node.is_infra) { - iconHtml = 'Infra'; + iconHtml = '
'; } else { iconHtml = '
'; } @@ -123,6 +123,17 @@ }); } + /** + * Get type emoji for node + */ + function getTypeEmoji(node) { + var type = normalizeType(node.adv_type); + if (type === 'chat') return '💬'; + if (type === 'repeater') return '📡'; + if (type === 'room') return '🪧'; + return '📍'; + } + /** * Create popup content for a node */ @@ -141,18 +152,23 @@ } var typeDisplay = getTypeDisplay(node); + var typeEmoji = getTypeEmoji(node); - // Use logo for infrastructure nodes, blue circle for others - var iconHtml = node.is_infra - ? 'Infra' - : ''; + // Infra indicator (red/blue dot) shown to the right of the title if is_infra is defined + var infraIndicatorHtml = ''; + if (typeof node.is_infra !== 'undefined') { + var dotColor = node.is_infra ? '#ef4444' : '#3b82f6'; + var borderColor = node.is_infra ? '#b91c1c' : '#1e40af'; + var title = node.is_infra ? 'Infrastructure' : 'Public'; + infraIndicatorHtml = ' '; + } var lastSeenHtml = node.last_seen ? '

Last seen: ' + node.last_seen.substring(0, 19).replace('T', ' ') + '

' : ''; return '
' + - '

' + iconHtml + ' ' + node.name + '

' + + '

' + typeEmoji + ' ' + node.name + infraIndicatorHtml + '

' + '
' + '

Type: ' + typeDisplay + '

' + roleHtml + diff --git a/src/meshcore_hub/web/templates/map.html b/src/meshcore_hub/web/templates/map.html index b6efa03..47e7149 100644 --- a/src/meshcore_hub/web/templates/map.html +++ b/src/meshcore_hub/web/templates/map.html @@ -65,12 +65,12 @@
Legend:
- Infrastructure +
Infrastructure
- Node + Public