OpenManus2 / template /index.html
Ken Sang Tang
Create template/index.html
3408f15 verified
<!DOCTYPE html>
<html>
<head>
<title>OpenManus2</title>
</head>
<body>
<h1>Welcome to OpenManus2</h1>
<p><a href="/chat?theme=openmanus">Start Chat</a></p>
</body>
</html>
# templates/chat.html
<!DOCTYPE html>
<html>
<head>
<title>OpenManus Chat</title>
</head>
<body>
<h2>Chat with OpenManus</h2>
<form id="prompt-form">
<textarea id="prompt" rows="4" cols="50" placeholder="Type your prompt..."></textarea>
<br>
<button type="submit">Submit</button>
</form>
<div id="output"></div>
<script>
document.getElementById("prompt-form").addEventListener("submit", async function(e) {
e.preventDefault();
const prompt = document.getElementById("prompt").value;
const res = await fetch("/tasks", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ prompt })
});
const { task_id } = await res.json();
const events = new EventSource(`/tasks/${task_id}/events`);
events.onmessage = function(event) {
const data = JSON.parse(event.data);
document.getElementById("output").innerText += `\n${data.result || data.message || JSON.stringify(data)}`;
};
});
</script>
</body>
</html>
# static/themes/openmanus/theme.json
{
"name": "OpenManus",
"description": "Default theme for OpenManus2 agent UI."
}
# static/themes/openmanus/templates/chat.html
<!-- Optional custom theme chat.html -->
<!-- Copy of /templates/chat.html or custom variant -->
<!DOCTYPE html>
<html>
<head>
<title>OpenManus - Themed Chat</title>
</head>
<body>
<h2>Welcome to the themed chat interface</h2>
<p>Use the default chat UI or customize this page.</p>
</body>
</html>