mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-08-11 11:12:55 +02:00
Merge branch 'dev'
Merge the latest changes from dev into the current branch to keep it up to date.
This commit is contained in:
@@ -26,6 +26,7 @@ A lightweight web interface for meshcore-cli, providing browser-based access to
|
|||||||
- **Advanced sorting:** Sort contacts by name (A-Z/Z-A) or last advertisement time (newest/oldest)
|
- **Advanced sorting:** Sort contacts by name (A-Z/Z-A) or last advertisement time (newest/oldest)
|
||||||
- **Smart filtering:** Search by name/key, filter by contact type (CLI, REP, ROOM, SENS)
|
- **Smart filtering:** Search by name/key, filter by contact type (CLI, REP, ROOM, SENS)
|
||||||
- **Activity indicators:** Visual status icons (🟢 active, 🟡 recent, 🔴 inactive) based on last advertisement
|
- **Activity indicators:** Visual status icons (🟢 active, 🟡 recent, 🔴 inactive) based on last advertisement
|
||||||
|
- **GPS location:** View contact location on Google Maps (when GPS coordinates available)
|
||||||
- **Cleanup tool:** Remove inactive contacts with configurable threshold (moved from Settings)
|
- **Cleanup tool:** Remove inactive contacts with configurable threshold (moved from Settings)
|
||||||
- 📦 **Message archiving** - Automatic daily archiving with browse-by-date selector
|
- 📦 **Message archiving** - Automatic daily archiving with browse-by-date selector
|
||||||
- ⚡ **Efficient polling** - Lightweight update checks every 10s, UI refreshes only when needed
|
- ⚡ **Efficient polling** - Lightweight update checks every 10s, UI refreshes only when needed
|
||||||
|
|||||||
@@ -974,13 +974,23 @@ function createExistingContactCard(contact, index) {
|
|||||||
copyBtn.innerHTML = '<i class="bi bi-clipboard"></i> Copy Key';
|
copyBtn.innerHTML = '<i class="bi bi-clipboard"></i> Copy Key';
|
||||||
copyBtn.onclick = () => copyContactKey(contact.public_key_prefix, copyBtn);
|
copyBtn.onclick = () => copyContactKey(contact.public_key_prefix, copyBtn);
|
||||||
|
|
||||||
|
actionsDiv.appendChild(copyBtn);
|
||||||
|
|
||||||
|
// Map button (only if GPS coordinates available)
|
||||||
|
if (contact.adv_lat && contact.adv_lon && (contact.adv_lat !== 0 || contact.adv_lon !== 0)) {
|
||||||
|
const mapBtn = document.createElement('button');
|
||||||
|
mapBtn.className = 'btn btn-sm btn-outline-primary';
|
||||||
|
mapBtn.innerHTML = '<i class="bi bi-geo-alt"></i> Map';
|
||||||
|
mapBtn.onclick = () => openGoogleMaps(contact.adv_lat, contact.adv_lon);
|
||||||
|
actionsDiv.appendChild(mapBtn);
|
||||||
|
}
|
||||||
|
|
||||||
// Delete button
|
// Delete button
|
||||||
const deleteBtn = document.createElement('button');
|
const deleteBtn = document.createElement('button');
|
||||||
deleteBtn.className = 'btn btn-sm btn-outline-danger';
|
deleteBtn.className = 'btn btn-sm btn-outline-danger';
|
||||||
deleteBtn.innerHTML = '<i class="bi bi-trash"></i> Delete';
|
deleteBtn.innerHTML = '<i class="bi bi-trash"></i> Delete';
|
||||||
deleteBtn.onclick = () => showDeleteModal(contact);
|
deleteBtn.onclick = () => showDeleteModal(contact);
|
||||||
|
|
||||||
actionsDiv.appendChild(copyBtn);
|
|
||||||
actionsDiv.appendChild(deleteBtn);
|
actionsDiv.appendChild(deleteBtn);
|
||||||
|
|
||||||
// Assemble card
|
// Assemble card
|
||||||
@@ -1014,6 +1024,14 @@ function copyContactKey(publicKeyPrefix, buttonEl) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openGoogleMaps(lat, lon) {
|
||||||
|
// Create Google Maps URL with coordinates
|
||||||
|
const mapsUrl = `https://www.google.com/maps?q=${lat},${lon}`;
|
||||||
|
|
||||||
|
// Open in new tab
|
||||||
|
window.open(mapsUrl, '_blank');
|
||||||
|
}
|
||||||
|
|
||||||
function showDeleteModal(contact) {
|
function showDeleteModal(contact) {
|
||||||
contactToDelete = contact;
|
contactToDelete = contact;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user