feat(frontend): track the number of messages received / sent
This commit is contained in:
parent
6f68f9f21f
commit
db89dd819b
@ -124,6 +124,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="position: absolute; bottom: 10px; right: 10px;">
|
||||
<p># msg. sent to server: <i id="messageSentCount">0</i></p>
|
||||
<p># msg. received from server: <i id="messageReceivedCount">0</i></p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -43,8 +43,10 @@ function main() {
|
||||
signaling_socket.on('connect', function () {
|
||||
console.log("Websocket connected!");
|
||||
|
||||
let messageReceivedCount = 0;
|
||||
signaling_socket.on('drawToWhiteboard', function (content) {
|
||||
whiteboard.handleEventsAndData(content, true);
|
||||
$('#messageReceivedCount')[0].innerText = String(messageReceivedCount++);
|
||||
});
|
||||
|
||||
signaling_socket.on('refreshUserBadges', function () {
|
||||
@ -69,12 +71,15 @@ function main() {
|
||||
if (getQueryVariable("webdav") == "true") {
|
||||
$("#uploadWebDavBtn").show();
|
||||
}
|
||||
|
||||
let messageSentCount = 0;
|
||||
whiteboard.loadWhiteboard("#whiteboardContainer", { //Load the whiteboard
|
||||
whiteboardId: whiteboardId,
|
||||
username: btoa(myUsername),
|
||||
sendFunction: function (content) {
|
||||
content["at"] = accessToken;
|
||||
signaling_socket.emit('drawToWhiteboard', content);
|
||||
$('#messageSentCount')[0].innerText = String(messageSentCount++);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user