feat : stop button integration

This commit is contained in:
martin legrand
2025-05-20 16:47:35 +02:00
parent 102dc60efb
commit e3d01083d9
12 changed files with 122 additions and 22 deletions
+16
View File
@@ -122,6 +122,19 @@ function App() {
}));
};
const handleStop = async (e) => {
e.preventDefault();
checkHealth();
setIsLoading(false);
setError(null);
try {
const res = await axios.get('http://127.0.0.1:8000/stop');
setStatus("Requesting stop...");
} catch (err) {
console.error('Error stopping the agent:', err);
}
}
const handleSubmit = async (e) => {
e.preventDefault();
checkHealth();
@@ -214,6 +227,9 @@ function App() {
<button type="submit" disabled={isLoading}>
Send
</button>
<button onClick={handleStop}>
Stop
</button>
</form>
</div>