File size: 565 Bytes
ef103a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
async function triggerReflex() {
    const input = document.getElementById("scenarioInput").value;
    const logWindow = document.getElementById("logWindow");

    if (!input) {
        logWindow.textContent += "\n[Error]: Please enter a scenario description.";
        return;
    }

    const response = await fetch("/run", {
        method: "POST",
        headers: {"Content-Type": "application/json"},
        body: JSON.stringify({ scenario: input })
    });

    const data = await response.json();
    logWindow.textContent += "\n" + data.logs.join("\n");
}