Update gui.js

pull/3/head
tricopterY 10 years ago
parent 45283388aa
commit 3ed04866f6

@ -207,11 +207,20 @@ GUI_control.prototype.timeout_kill_all = function () {
GUI_control.prototype.log = function (message) {
var command_log = $('div#log');
var d = new Date();
var year = d.getFullYear();
var month = ((d.getMonth() < 9) ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1));
var date = ((d.getDate() < 10) ? '0' + d.getDate() : d.getDate());
var time = ((d.getHours() < 10) ? '0' + d.getHours(): d.getHours())
+ ':' + ((d.getMinutes() < 10) ? '0' + d.getMinutes(): d.getMinutes())
+ ':' + ((d.getSeconds() < 10) ? '0' + d.getSeconds(): d.getSeconds());
$('div.wrapper', command_log).append('<p>' + time + ' -- ' + message + '</p>');
+ ':' + ((d.getMinutes() < 10) ? '0' + d.getMinutes(): d.getMinutes())
+ ':' + ((d.getSeconds() < 10) ? '0' + d.getSeconds(): d.getSeconds());
var formattedDate = "{0}-{1}-{2} {3}".format(
year,
month,
date,
' @ ' + time
);
$('div.wrapper', command_log).append('<p>' + formattedDate + ' -- ' + message + '</p>');
command_log.scrollTop($('div.wrapper', command_log).height());
};
@ -230,4 +239,4 @@ GUI_control.prototype.tab_switch_cleanup = function (callback) {
};
// initialize object into GUI variable
var GUI = new GUI_control();
var GUI = new GUI_control();

Loading…
Cancel
Save