From 9af9e7b4d76be1fd3bd79bd37bfa52c4777881e6 Mon Sep 17 00:00:00 2001 From: Christopher Mayor Date: Wed, 4 Mar 2026 00:25:37 +0000 Subject: [PATCH] feat: add agent dropdown for task assignment (#1) Co-authored-by: Christopher Mayor Co-committed-by: Christopher Mayor --- public/app.js | 29 +++++++++++++++++++++++++++++ public/index.html | 4 +++- public/styles.css | 27 +++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) 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

- +