diff --git a/src/mindcraft/public/index.html b/src/mindcraft/public/index.html index fd9f10b..d9690a2 100644 --- a/src/mindcraft/public/index.html +++ b/src/mindcraft/public/index.html @@ -25,8 +25,8 @@ background: #363636; border-radius: 4px; display: flex; - justify-content: space-between; - align-items: center; + flex-direction: column; + align-items: flex-start; } .restart-btn, .start-btn, .stop-btn { color: white; @@ -102,6 +102,13 @@ border: none; margin-left: 10px; } + .last-message { + font-style: italic; + color: #aaa; + margin-top: 5px; + white-space: pre-wrap; + word-break: break-word; + } .start-btn:disabled { opacity: 0.4; cursor: not-allowed; @@ -135,6 +142,7 @@ let settingsSpec = {}; let profileData = null; const agentSettings = {}; + const agentLastMessage = {}; fetch('/settings_spec.json') .then(r => r.json()) @@ -229,6 +237,14 @@ }); }); + socket.on('bot-output', (agentName, message) => { + agentLastMessage[agentName] = message; + const messageDiv = document.getElementById(`lastMessage-${agentName}`); + if (messageDiv) { + messageDiv.textContent = message; + } + }); + function fetchAgentSettings(name) { return new Promise((resolve) => { if (agentSettings[name]) { resolve(agentSettings[name]); return; } @@ -250,9 +266,10 @@ const cfg = agentSettings[agent.name] || {}; const showViewer = cfg.render_bot_view === true; const viewerHTML = showViewer ? `
` : ''; + const lastMessage = agentLastMessage[agent.name] || ''; return `
-
+
${agent.name}
${agent.in_game ? ` @@ -265,6 +282,7 @@ `}
+
${lastMessage}
${viewerHTML}
`; }).join('') +