diff --git a/public/app.js b/public/app.js index a9dbee0..fd111f6 100644 --- a/public/app.js +++ b/public/app.js @@ -270,3 +270,32 @@ ws.onmessage = (event) => { loadTasks(); } }; + +// Populate agent dropdown +async function populateAgentDropdown() { + try { + const res = await fetch('/api/agents'); + const agents = await res.json(); + + const select = document.getElementById('assignee'); + if (!select) return; + + // Clear existing options except the first placeholder + select.innerHTML = ''; + + // Add agent options + agents.forEach(agent => { + const option = document.createElement('option'); + option.value = agent.name; + option.textContent = agent.name; + select.appendChild(option); + }); + } catch (err) { + console.error('Failed to load agents for dropdown:', err); + } +} + +// Populate dropdown on page load +document.addEventListener('DOMContentLoaded', () => { + populateAgentDropdown(); +}); diff --git a/public/index.html b/public/index.html index 54699ff..a44d276 100644 --- a/public/index.html +++ b/public/index.html @@ -30,7 +30,9 @@

Create Task

- +