Fix errors on node graphs

These graphs will be removed in a future release, so I’m not going to
make them look pretty right now.
This commit is contained in:
Dane Everitt 2016-10-21 17:37:47 -04:00
parent ad906e0680
commit 6b89dbd451
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -552,7 +552,7 @@ $(document).ready(function () {
title: 'Memory Usage (MB)', title: 'Memory Usage (MB)',
data: [{ data: [{
'date': new Date(), 'date': new Date(),
'memory': -1 'memory': 0
}], }],
full_width: true, full_width: true,
full_height: true, full_height: true,
@ -567,7 +567,7 @@ $(document).ready(function () {
title: 'CPU Usage (%)', title: 'CPU Usage (%)',
data: [{ data: [{
'date': new Date(), 'date': new Date(),
'cpu': -1 'cpu': 0
}], }],
full_width: true, full_width: true,
full_height: true, full_height: true,
@ -582,7 +582,7 @@ $(document).ready(function () {
title: 'Players Online', title: 'Players Online',
data: [{ data: [{
'date': new Date(), 'date': new Date(),
'players': -1 'players': 0
}], }],
full_width: true, full_width: true,
full_height: true, full_height: true,
@ -628,35 +628,35 @@ $(document).ready(function () {
socket.on('live-stats', function (data) { socket.on('live-stats', function (data) {
// if (typeof memoryGraphSettings.data[0][100] !== 'undefined' || memoryGraphSettings.data[0][0].memory === -1) { if (typeof memoryGraphSettings.data[0][100] !== 'undefined' || memoryGraphSettings.data[0][0].memory === -1) {
// memoryGraphSettings.data[0].shift(); memoryGraphSettings.data[0].shift();
// } }
// if (typeof cpuGraphSettings.data[0][100] !== 'undefined' || cpuGraphSettings.data[0][0].cpu === -1) { if (typeof cpuGraphSettings.data[0][100] !== 'undefined' || cpuGraphSettings.data[0][0].cpu === -1) {
// cpuGraphSettings.data[0].shift(); cpuGraphSettings.data[0].shift();
// } }
// if (typeof playersGraphSettings.data[0][100] !== 'undefined' || playersGraphSettings.data[0][0].players === -1) { if (typeof playersGraphSettings.data[0][100] !== 'undefined' || playersGraphSettings.data[0][0].players === -1) {
// playersGraphSettings.data[0].shift(); playersGraphSettings.data[0].shift();
// } }
// memoryGraphSettings.data[0].push({ memoryGraphSettings.data[0].push({
// 'date': new Date(), 'date': new Date(),
// 'memory': parseInt(data.stats.memory / (1024 * 1024)) 'memory': parseInt(data.stats.memory / (1024 * 1024))
// }); });
//
// cpuGraphSettings.data[0].push({ cpuGraphSettings.data[0].push({
// 'date': new Date(), 'date': new Date(),
// 'cpu': data.stats.cpu 'cpu': data.stats.cpu
// }); });
//
// playersGraphSettings.data[0].push({ playersGraphSettings.data[0].push({
// 'date': new Date(), 'date': new Date(),
// 'players': data.stats.players 'players': data.stats.players
// }); });
MG.data_graphic(memoryGraphSettings);
MG.data_graphic(cpuGraphSettings);
MG.data_graphic(playersGraphSettings);
// MG.data_graphic(memoryGraphSettings);
// MG.data_graphic(cpuGraphSettings);
// MG.data_graphic(playersGraphSettings);
//
$.each(data.servers, function (uuid, info) { $.each(data.servers, function (uuid, info) {
var element = $('tr[data-server="' + uuid + '"]'); var element = $('tr[data-server="' + uuid + '"]');
element.find('[data-action="status"]').html(Status[info.status]); element.find('[data-action="status"]').html(Status[info.status]);