Normalize port number lists

This commit is contained in:
Amy Nagle
2026-02-10 10:33:54 -05:00
parent b43683a259
commit dd98814b2c
7 changed files with 123 additions and 46 deletions

View File

@@ -13,13 +13,40 @@
"go to node": "Go to Node",
"all": "All",
"portnum_options": {
"0": "Unknown",
"1": "Text Message",
"2": "Remote Hardware",
"3": "Position",
"4": "Node Info",
"5": "Routing",
"6": "Admin",
"7": "Text (Compressed)",
"8": "Waypoint",
"9": "Audio",
"10": "Detection Sensor",
"11": "Alert",
"12": "Key Verification",
"32": "Reply",
"33": "IP Tunnel",
"34": "Paxcounter",
"35": "Store Forward++",
"36": "Node Status",
"64": "Serial",
"65": "Store & Forward",
"66": "Range Test",
"67": "Telemetry",
"68": "ZPS",
"69": "Simulator",
"70": "Traceroute",
"71": "Neighbor Info"
}
"71": "Neighbor Info",
"72": "ATAK",
"73": "Map Report",
"74": "Power Stress",
"76": "Reticulum Tunnel",
"77": "Cayenne",
"256": "Private App",
"257": "ATAK Forwarder"
}
},
"chat": {
"chat_title": "Chats:",

View File

@@ -13,12 +13,39 @@
"go_to_node": "Ir al nodo",
"all": "Todos",
"portnum_options": {
"0": "Desconocido",
"1": "Mensaje de Texto",
"2": "Hardware Remoto",
"3": "Ubicación",
"4": "Información del Nodo",
"5": "Enrutamiento",
"6": "Administración",
"7": "Texto (Comprimido)",
"8": "Punto de Referencia",
"9": "Audio",
"10": "Sensor de Detección",
"11": "Alerta",
"12": "Verificación de Clave",
"32": "Respuesta",
"33": "Túnel IP",
"34": "Paxcounter",
"35": "Store Forward++",
"36": "Estado del Nodo",
"64": "Serial",
"65": "Store & Forward",
"66": "Prueba de Alcance",
"67": "Telemetría",
"68": "ZPS",
"69": "Simulador",
"70": "Traceroute",
"71": "Información de Vecinos"
"71": "Información de Vecinos",
"72": "ATAK",
"73": "Reporte de Mapa",
"74": "Prueba de Energía",
"76": "Túnel Reticulum",
"77": "Cayenne",
"256": "App Privada",
"257": "ATAK Forwarder"
}
},

View File

@@ -44,6 +44,7 @@ body { margin: 0; font-family: monospace; background: #121212; color: #eee; }
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" crossorigin></script>
<script src="https://unpkg.com/leaflet-polylinedecorator@1.6.0/dist/leaflet.polylinedecorator.js" crossorigin></script>
<script src="/static/portmaps.js"></script>
<script>
(async function(){
@@ -97,7 +98,7 @@ body { margin: 0; font-family: monospace; background: #121212; color: #eee; }
const channels = new Set();
const activeBlinks = new Map();
const portMap = {1:"Text",67:"Telemetry",3:"Position",70:"Traceroute",4:"Node Info",71:"Neighbour Info",73:"Map Report"};
const portMap = window.PORT_LABEL_MAP;
nodes.forEach(node=>{
if(isInvalidCoord(node)) return;

View File

@@ -1,34 +1,75 @@
// Shared port label/color definitions for UI pages.
// Port numbers defined in: https://github.com/meshtastic/protobufs/blob/master/meshtastic/portnums.proto
window.PORT_LABEL_MAP = {
0: "UNKNOWN",
0: "Unknown",
1: "Text",
2: "Remote Hardware",
3: "Position",
4: "Node Info",
5: "Routing",
6: "Admin",
7: "Text (Compressed)",
8: "Waypoint",
9: "Audio",
10: "Detection Sensor",
11: "Alert",
12: "Key Verification",
32: "Reply",
33: "IP Tunnel",
34: "Paxcounter",
35: "Store Forward++",
36: "Node Status",
64: "Serial",
65: "Store & Forward",
66: "Range Test",
67: "Telemetry",
68: "ZPS",
69: "Simulator",
70: "Traceroute",
71: "Neighbor",
72: "ATAK",
73: "Map Report",
74: "Power Stress",
76: "Reticulum Tunnel",
77: "Cayenne",
256: "Private App",
257: "ATAK Forwarder",
};
window.PORT_COLOR_MAP = {
0: "#6c757d",
1: "#007bff",
3: "#28a745",
4: "#ffc107",
5: "#dc3545",
6: "#20c997",
8: "#fd7e14",
35: "#8bc34a",
65: "#6610f2",
67: "#17a2b8",
70: "#ff4444",
71: "#ff66cc",
73: "#9999ff",
0: "#6c757d", // gray - Unknown
1: "#007bff", // blue - Text
2: "#795548", // brown - Remote Hardware
3: "#28a745", // green - Position
4: "#ffc107", // yellow - Node Info
5: "#dc3545", // red - Routing
6: "#20c997", // teal - Admin
7: "#0056b3", // dark blue - Text (Compressed)
8: "#fd7e14", // orange - Waypoint
9: "#e91e63", // pink - Audio
10: "#ff9800", // amber - Detection Sensor
11: "#f44336", // bright red - Alert
12: "#9c27b0", // purple - Key Verification
32: "#00bcd4", // cyan - Reply
33: "#607d8b", // blue-gray - IP Tunnel
34: "#8d6e63", // brown-gray - Paxcounter
35: "#8bc34a", // light green - Store Forward++
36: "#4caf50", // green - Node Status
64: "#9e9e9e", // gray - Serial
65: "#6610f2", // indigo - Store & Forward
66: "#cddc39", // lime - Range Test
67: "#17a2b8", // info blue - Telemetry
68: "#3f51b5", // indigo - ZPS
69: "#673ab7", // deep purple - Simulator
70: "#ff4444", // red - Traceroute
71: "#ff66cc", // pink - Neighbor
72: "#2196f3", // blue - ATAK
73: "#9999ff", // light purple - Map Report
74: "#ff5722", // deep orange - Power Stress
76: "#009688", // teal - Reticulum Tunnel
77: "#4db6ac", // teal accent - Cayenne
256: "#757575", // dark gray - Private App
257: "#1976d2", // blue - ATAK Forwarder
};
// Aliases for pages that expect different names.

View File

@@ -128,6 +128,7 @@
<script src="https://unpkg.com/leaflet-polylinedecorator@1.6.0/dist/leaflet.polylinedecorator.js"
integrity="sha384-FhPn/2P/fJGhQLeNWDn9B/2Gml2bPOrKJwFqJXgR3xOPYxWg5mYQ5XZdhUSugZT0"
crossorigin></script>
<script src="/static/portmaps.js"></script>
<script>
/* ======================================================
@@ -179,15 +180,7 @@ var unmappedPackets = [];
const UNMAPPED_LIMIT = 50;
const UNMAPPED_TTL_MS = 5000;
const portMap = {
1:"Text",
67:"Telemetry",
3:"Position",
70:"Traceroute",
4:"Node Info",
71:"Neighbour Info",
73:"Map Report"
};
const portMap = window.PORT_LABEL_MAP;
const palette = ["#e6194b","#4363d8","#f58231","#911eb4","#46f0f0","#f032e6","#bcf60c","#fabebe",
"#008080","#e6beff","#9a6324","#fffac8","#800000","#aaffc3","#808000","#ffd8b1",

View File

@@ -2,6 +2,10 @@
{% block title %}Packet Details{% endblock %}
{% block head %}
<script src="/static/portmaps.js"></script>
{% endblock %}
{% block css %}
{{ super() }}
<style>
@@ -178,17 +182,7 @@ document.addEventListener("DOMContentLoaded", async () => {
const packetId = match[1];
/* PORT LABELS (NOT TRANSLATED) */
const PORT_NAMES = {
0:"UNKNOWN APP",
1:"Text",
3:"Position",
4:"Node Info",
5:"Routing",
6:"Admin",
67:"Telemetry",
70:"Traceroute",
71:"Neighbor"
};
const PORT_NAMES = window.PORT_LABEL_MAP;
/* ---------------------------------------------
Fetch packet

View File

@@ -89,6 +89,7 @@
{% block head %}
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.0/dist/echarts.min.js"></script>
<script src="/static/portmaps.js"></script>
{% endblock %}
{% block body %}
@@ -205,14 +206,7 @@
</div>
<script>
const PORTNUM_LABELS = {
1: "Text Messages",
3: "Position",
4: "Node Info",
67: "Telemetry",
70: "Traceroute",
71: "Neighbor Info"
};
const PORTNUM_LABELS = window.PORT_LABEL_MAP;
// --- Fetch & Processing ---
async function fetchStats(period_type,length,portnum=null,channel=null){