Fixed Date format to mm/dd/YYYY.

Added /api that dumps a json with all the nodes.
This commit is contained in:
Pablo Revilla
2025-03-17 13:25:36 -07:00
parent 196ca07dac
commit 0b8597c704
2 changed files with 24 additions and 7 deletions

View File

@@ -35,7 +35,7 @@
</style>
</head>
<body hx-indicator="#spinner">
<br><div style="text-align:center"><strong>{{ site_config["site"]["title"] }} - {{ site_config["site"]["domain"] }}</strong></div>
<br><div style="text-align:center"><strong>{{ site_config["site"]["title"] }} {{ site_config["site"]["domain"] }}</strong></div>
<div style="text-align: center;">{{ site_config["site"]["message"] }}</div>
<div style="text-align:center">Quick Links:&nbsp;&nbsp;<a href="/nodelist">Nodes</a>&nbsp;-&nbsp;<a href="/chat">Conversations</a>&nbsp;-&nbsp;<a href="/firehose">See <strong>everything</strong> </a>
&nbsp;-&nbsp;Mesh Graph <a href="/nodegraph/LongFast">LF</a>&nbsp;-&nbsp;<a href="/nodegraph/MediumSlow">MS </a>&nbsp;-&nbsp;<a href="/stats">Stats </a>

View File

@@ -13,7 +13,7 @@
<div class="card-text text-start">
<dl>
<dt>Import Time</dt>
<dd>{{seen.import_time.strftime('%-I:%M:%S %p - %m-%d-%Y')}}</dd>
<dd>{{seen.import_time.strftime('%-I:%M:%S %p - %d-%m-%Y')}}</dd>
<dt>rx_time</dt>
<dd>{{seen.rx_time|format_timestamp}}</dd>
<dt>hop_limit</dt>
@@ -36,7 +36,7 @@
{% if map_center %}
<script>
var details_map = L.map('details_map').setView({{ map_center | tojson }}, 10);
var details_map = L.map('details_map').setView({{ map_center | tojson }}, 12);
var markers = L.featureGroup();
markers.addTo(details_map);
@@ -80,6 +80,7 @@
// Calculate distance in miles
var distanceMiles = getDistanceInMiles(fromNodeLatLng, uplinkNodeLatLng).toFixed(1);
/*
var node = L.circleMarker(uplinkNodeLatLng, {
radius: 6,
color: 'blue',
@@ -87,6 +88,17 @@
fillColor: 'blue',
fillOpacity: 0.4
}).addTo(markers);
*/
var node = L.marker(uplinkNodeLatLng, {
icon: L.divIcon({
className: 'text-icon', // Custom class for styling
html: '<div style="font-size: 12px; color: white; font-weight: bold; display: flex; justify-content: center; align-items: center; height: 16px; width: 16px; border-radius: 50%; background-color: blue; border: 1px solid blue;">{{u.hops}}</div>',
iconSize: [16, 16], // Size of the icon container
iconAnchor: [8, 8] // Anchoring the text to the center of the marker
})
}).addTo(markers);
node.setZIndexOffset({{u.hops}}*-1);
// Add a tooltip with node details and distance
node.bindTooltip(`
@@ -97,12 +109,17 @@
<b>Distance:</b> ${distanceMiles} miles <br/>
<b>Coordinates:</b> [{{u.lat}}, {{u.long}}]
`, { permanent: false, direction: 'top', opacity: 0.9 });
{% endfor %}
if (markers.getLayers().length > 0) {
details_map.fitBounds(markers.getBounds().pad(0.1), { animate: true });
}
// Ensure markers are added before adjusting map bounds
setTimeout(() => {
if (markers.getLayers().length > 0) {
details_map.fitBounds(markers.getBounds().pad(0.3), { animate: true });
details_map.fitBounds(markers.getBounds().pad(0.1), { animate: true });
}
}, 500); // Delay to ensure markers load
@@ -120,9 +137,9 @@
div.style.textAlign = 'left'; /* Ensure left alignment */
div.innerHTML = `
<b>Legend</b><br>
<svg width="16" height="16">
<circle cx="8" cy="8" r="6" fill="blue" stroke="blue" stroke-width="1" fill-opacity="0.4"/>
</svg> Receiving Node<br>
<svg width="20" height="20">
<circle cx="8" cy="8" r="6" fill="blue" stroke="blue" stroke-width="1" fill-opacity="0.9"/>
</svg> Receiving Node (Number is hop count)<br>
<svg width="20" height="20">
<circle cx="10" cy="10" r="8" fill="red" stroke="red" stroke-width="1" fill-opacity="0.4"/>
</svg> Sending Node<br>