Browse Source

Add a refresh button for displayed logs.

master
flabbergast 9 years ago
parent
commit
eb8e38fcf9
  1. 3
      modules/socket_server.js
  2. 6
      public/js/index.js
  3. 3
      views/index.jade

3
modules/socket_server.js

@ -72,5 +72,8 @@ var onUserConnected = function(socket)
socket.emit('received-TM-batt', { content: ("Batt: "+TMbatt+" V") });
logger.emit_latest_logs(socket);
socket.on('requesting-logs-refresh', function (data) {
logger.emit_latest_logs(socket);
});
// here comes socket.on('something-happens', ...)
}

6
public/js/index.js

@ -21,4 +21,10 @@ $(document).ready(function(){
$('#serialtalk #serialtalk-text').keyup(function(e){
if (e.keyCode==13) { sendLLAPmessageEvent(e); }
});
$('#refresh-logs-btn').click(function(e){
if( socket && socket_connected ){
socket.emit('requesting-logs-refresh', {});
}
});
});

3
views/index.jade

@ -25,7 +25,8 @@ block main-column
block right-column
#logs.well
h5 Logs
h5 Latest Logs
button.btn.btn-small#refresh-logs-btn Refresh
div#logs-content
block footer

Loading…
Cancel
Save