Remove SNR column from messages and add last seen to members

- Remove SNR column from messages list (no longer provided by meshcore library)
- Add relative "last seen" time to nodes on members page with tooltip
- Add populateRelativeTimeElements() utility for time elements
This commit is contained in:
Louis King
2026-01-08 21:23:14 +00:00
parent d52c23fc29
commit 3051984fb9
3 changed files with 20 additions and 13 deletions

View File

@@ -56,8 +56,23 @@ function populateReceiverTooltips() {
});
}
/**
* Populate <time> elements with data-relative-time attribute
* Uses the datetime attribute as the timestamp source
*/
function populateRelativeTimeElements() {
document.querySelectorAll('time[data-relative-time]').forEach(el => {
const timestamp = el.getAttribute('datetime');
if (timestamp) {
const relTime = formatRelativeTime(timestamp);
el.textContent = relTime ? `${relTime} ago` : '';
}
});
}
// Auto-populate when DOM is ready
document.addEventListener('DOMContentLoaded', () => {
populateRelativeTimestamps();
populateReceiverTooltips();
populateRelativeTimeElements();
});

View File

@@ -50,7 +50,7 @@
📦
{% endif %}
</span>
<div>
<div class="flex-1 min-w-0">
{% if display_name %}
<div class="font-medium text-sm">{{ display_name }}</div>
<div class="font-mono text-xs opacity-60">{{ node.public_key[:12] }}...</div>
@@ -58,6 +58,9 @@
<div class="font-mono text-sm">{{ node.public_key[:12] }}...</div>
{% endif %}
</div>
{% if node.last_seen %}
<time class="text-xs opacity-60 whitespace-nowrap" datetime="{{ node.last_seen }}" title="{{ node.last_seen[:19].replace('T', ' ') }}" data-relative-time>-</time>
{% endif %}
</a>
{% endfor %}
</div>

View File

@@ -79,9 +79,6 @@
</div>
</div>
<div class="flex items-center gap-2 flex-shrink-0">
{% if msg.snr is not none %}
<span class="badge badge-ghost badge-xs">{{ "%.1f"|format(msg.snr) }}dB</span>
{% endif %}
{% if msg.receivers and msg.receivers|length >= 1 %}
<div class="flex gap-0.5">
{% for recv in msg.receivers %}
@@ -110,7 +107,6 @@
<th>Time</th>
<th>From/Channel</th>
<th>Message</th>
<th class="text-center">SNR</th>
<th>Receivers</th>
</tr>
</thead>
@@ -135,13 +131,6 @@
{% endif %}
</td>
<td class="break-words max-w-md" style="white-space: pre-wrap;">{{ msg.text or '-' }}</td>
<td class="text-center whitespace-nowrap">
{% if msg.snr is not none %}
<span class="badge badge-ghost badge-sm">{{ "%.1f"|format(msg.snr) }}</span>
{% else %}
-
{% endif %}
</td>
<td>
{% if msg.receivers and msg.receivers|length >= 1 %}
<div class="flex gap-1">
@@ -158,7 +147,7 @@
</tr>
{% else %}
<tr>
<td colspan="6" class="text-center py-8 opacity-70">No messages found.</td>
<td colspan="5" class="text-center py-8 opacity-70">No messages found.</td>
</tr>
{% endfor %}
</tbody>