diff --git a/server/src/dashboard.html b/server/src/dashboard.html index b639bb1..36ec5c2 100644 --- a/server/src/dashboard.html +++ b/server/src/dashboard.html @@ -412,7 +412,25 @@ border-color: #2ecc71; background: rgba(46, 204, 113, 0.1); } - + + /* Sticky Notes */ + .sticky-note { + background-color: #f1c40f; + color: #2c3e50; + padding: 15px; + border-radius: 4px; + width: 250px; + box-shadow: 2px 2px 8px rgba(0,0,0,0.15); + position: relative; + font-size: 0.9em; + line-height: 1.4; + } + .sticky-note:hover { + transform: scale(1.02); + box-shadow: 2px 4px 12px rgba(0,0,0,0.2); + transition: all 0.2s ease; + } + .activity-panel { flex: 1; display: flex; @@ -456,6 +474,7 @@ + @@ -508,6 +527,13 @@ +
+
+

Sticky Notes

+
+
+
+
@@ -812,9 +838,34 @@ }; } + async function loadStickyNotes() { + try { + const res = await fetch('/api/sticky'); + const sticky = await res.json(); + + const container = document.getElementById('sticky-notes-container'); + container.innerHTML = ''; + + sticky.forEach(note => { + const card = document.createElement('div'); + card.className = 'sticky-note'; + + const date = new Date(note.timestamp * 1000).toLocaleString(); + + card.innerHTML = `
${date}
+
${note.content}
`; + + container.appendChild(card); + }); + } catch (err) { + console.error("Failed to load sticky notes", err); + } + } + // --- Start --- loadGraph(); loadTasks(); + loadStickyNotes(); setupWS(); // Listen to theme toggle changes to update graph font colors @@ -824,6 +875,7 @@ setInterval(() => { loadGraph(); loadTasks(); + loadStickyNotes(); }, 5000); diff --git a/server/src/main.rs b/server/src/main.rs index 435c4fa..9529e46 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -375,6 +375,13 @@ fn run_server(state: Arc) -> Result<(), Box> axum::Json(tasks.clone()) } })) + .route("/api/sticky", get({ + let state_clone = app_state.handler.state.clone(); + move || async move { + let sticky = state_clone.sticky.read(); + axum::Json(sticky.clone()) + } + })) .route("/api/search", get({ let state_clone = app_state.handler.state.clone(); move |axum::extract::Query(params): axum::extract::Query>| async move {