Update admin.html

This commit is contained in:
pancakes-proxy 2025-03-11 10:31:34 -04:00 committed by GitHub
parent 1c9e597b7d
commit 49e9c67a74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -94,6 +94,21 @@
}
});
</script>
<!-- Add this to the admin controls: -->
<input id="message-input" placeholder="Type a message as admin...">
<button id="send-message-button">Send</button>
<script>
const sendMessageButton = document.getElementById('send-message-button');
const adminUsername = 'admin'; // Or dynamically set during login
sendMessageButton.addEventListener('click', () => {
const message = document.getElementById('message-input').value.trim();
if (message) {
socket.emit('chat message', message); // Sends as admin
}
});
</script>
</body>
</html>