forked from Rockachopa/Timmy-time-dashboard
fix: dashboard bugs and clean up build artifacts (#145)
* chore: stop tracking runtime-generated self-modify reports These 65 files in data/self_modify_reports/ are auto-generated at runtime and already listed in .gitignore. Tracking them caused conflicts when pulling from main. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: resolve 8 dashboard bugs from Round 4 testing report - Fix Ollama timeout regression: request_timeout → timeout (agno API) - Add Bootstrap JS to base.html (fixes creative UI tab switching) - Send initial_state on Swarm Live WebSocket connect - Add /api/queue/status endpoint (stops 404 log spam from chat panel) - Populate agent tools from registry on /tools page - Add notification bell dropdown with /api/notifications endpoint - All 1157 tests pass Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Trip T <trip@local> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
e36a1dc939
commit
248af9ed03
@@ -63,7 +63,14 @@
|
||||
<a href="/mobile/local" class="mc-test-link" title="Local AI on iPhone">LOCAL AI</a>
|
||||
</div>
|
||||
</div>
|
||||
<button id="enable-notifications" class="mc-test-link" style="background:none;cursor:pointer;" title="Enable notifications">🔔</button>
|
||||
<div class="mc-nav-dropdown" id="notif-dropdown">
|
||||
<button id="enable-notifications" class="mc-test-link mc-dropdown-toggle" style="background:none;cursor:pointer;position:relative;" title="Notifications" aria-expanded="false">🔔<span id="notif-badge" class="notif-badge" style="display:none;"></span></button>
|
||||
<div class="mc-dropdown-menu" style="right:0;left:auto;min-width:280px;max-height:350px;overflow-y:auto;">
|
||||
<div id="notif-list" style="padding:6px;">
|
||||
<div style="color:var(--text-dim);font-size:0.8rem;text-align:center;padding:12px;">Loading...</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="mc-time" id="clock"></span>
|
||||
</div>
|
||||
|
||||
@@ -150,25 +157,56 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Desktop "More" dropdown toggle
|
||||
var dropdownToggle = document.querySelector('.mc-dropdown-toggle');
|
||||
if (dropdownToggle) {
|
||||
dropdownToggle.addEventListener('click', function(e) {
|
||||
// Desktop dropdown toggles (More menu + Notification bell)
|
||||
document.querySelectorAll('.mc-dropdown-toggle').forEach(function(toggle) {
|
||||
toggle.addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
var dd = this.closest('.mc-nav-dropdown');
|
||||
// Close other dropdowns first
|
||||
document.querySelectorAll('.mc-nav-dropdown.open').forEach(function(other) {
|
||||
if (other !== dd) {
|
||||
other.classList.remove('open');
|
||||
var btn = other.querySelector('.mc-dropdown-toggle');
|
||||
if (btn) btn.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
});
|
||||
var isOpen = dd.classList.toggle('open');
|
||||
this.setAttribute('aria-expanded', isOpen);
|
||||
// Load notifications when opening the bell
|
||||
if (isOpen && dd.id === 'notif-dropdown') { loadNotifications(); }
|
||||
});
|
||||
document.addEventListener('click', function() {
|
||||
var dd = document.querySelector('.mc-nav-dropdown');
|
||||
if (dd) {
|
||||
dd.classList.remove('open');
|
||||
var btn = dd.querySelector('.mc-dropdown-toggle');
|
||||
if (btn) btn.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
});
|
||||
document.addEventListener('click', function() {
|
||||
document.querySelectorAll('.mc-nav-dropdown.open').forEach(function(dd) {
|
||||
dd.classList.remove('open');
|
||||
var btn = dd.querySelector('.mc-dropdown-toggle');
|
||||
if (btn) btn.setAttribute('aria-expanded', 'false');
|
||||
});
|
||||
});
|
||||
|
||||
// Notification loader
|
||||
function loadNotifications() {
|
||||
fetch('/api/notifications')
|
||||
.then(function(r) { return r.json(); })
|
||||
.then(function(data) {
|
||||
var list = document.getElementById('notif-list');
|
||||
if (!data.length) {
|
||||
list.innerHTML = '<div style="color:var(--text-dim);font-size:0.8rem;text-align:center;padding:12px;">No recent notifications</div>';
|
||||
return;
|
||||
}
|
||||
list.innerHTML = data.map(function(n) {
|
||||
return '<div style="padding:6px 8px;border-bottom:1px solid var(--border);font-size:0.8rem;">'
|
||||
+ '<div style="color:var(--text-bright);">' + (n.title || n.event_type || 'Event') + '</div>'
|
||||
+ '<div style="color:var(--text-dim);font-size:0.7rem;">' + (n.timestamp || '') + '</div>'
|
||||
+ '</div>';
|
||||
}).join('');
|
||||
var badge = document.getElementById('notif-badge');
|
||||
if (badge) { badge.style.display = 'none'; }
|
||||
})
|
||||
.catch(function() {});
|
||||
}
|
||||
</script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
<script src="/static/notifications.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user