Skip to content

Commit 6b89dbd

Browse files
committed
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.
1 parent ad906e0 commit 6b89dbd

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

resources/views/admin/nodes/view.blade.php

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@
552552
title: 'Memory Usage (MB)',
553553
data: [{
554554
'date': new Date(),
555-
'memory': -1
555+
'memory': 0
556556
}],
557557
full_width: true,
558558
full_height: true,
@@ -567,7 +567,7 @@
567567
title: 'CPU Usage (%)',
568568
data: [{
569569
'date': new Date(),
570-
'cpu': -1
570+
'cpu': 0
571571
}],
572572
full_width: true,
573573
full_height: true,
@@ -582,7 +582,7 @@
582582
title: 'Players Online',
583583
data: [{
584584
'date': new Date(),
585-
'players': -1
585+
'players': 0
586586
}],
587587
full_width: true,
588588
full_height: true,
@@ -628,35 +628,35 @@
628628
629629
socket.on('live-stats', function (data) {
630630
631-
// if (typeof memoryGraphSettings.data[0][100] !== 'undefined' || memoryGraphSettings.data[0][0].memory === -1) {
632-
// memoryGraphSettings.data[0].shift();
633-
// }
634-
// if (typeof cpuGraphSettings.data[0][100] !== 'undefined' || cpuGraphSettings.data[0][0].cpu === -1) {
635-
// cpuGraphSettings.data[0].shift();
636-
// }
637-
// if (typeof playersGraphSettings.data[0][100] !== 'undefined' || playersGraphSettings.data[0][0].players === -1) {
638-
// playersGraphSettings.data[0].shift();
639-
// }
631+
if (typeof memoryGraphSettings.data[0][100] !== 'undefined' || memoryGraphSettings.data[0][0].memory === -1) {
632+
memoryGraphSettings.data[0].shift();
633+
}
634+
if (typeof cpuGraphSettings.data[0][100] !== 'undefined' || cpuGraphSettings.data[0][0].cpu === -1) {
635+
cpuGraphSettings.data[0].shift();
636+
}
637+
if (typeof playersGraphSettings.data[0][100] !== 'undefined' || playersGraphSettings.data[0][0].players === -1) {
638+
playersGraphSettings.data[0].shift();
639+
}
640+
641+
memoryGraphSettings.data[0].push({
642+
'date': new Date(),
643+
'memory': parseInt(data.stats.memory / (1024 * 1024))
644+
});
645+
646+
cpuGraphSettings.data[0].push({
647+
'date': new Date(),
648+
'cpu': data.stats.cpu
649+
});
650+
651+
playersGraphSettings.data[0].push({
652+
'date': new Date(),
653+
'players': data.stats.players
654+
});
640655
641-
// memoryGraphSettings.data[0].push({
642-
// 'date': new Date(),
643-
// 'memory': parseInt(data.stats.memory / (1024 * 1024))
644-
// });
645-
//
646-
// cpuGraphSettings.data[0].push({
647-
// 'date': new Date(),
648-
// 'cpu': data.stats.cpu
649-
// });
650-
//
651-
// playersGraphSettings.data[0].push({
652-
// 'date': new Date(),
653-
// 'players': data.stats.players
654-
// });
656+
MG.data_graphic(memoryGraphSettings);
657+
MG.data_graphic(cpuGraphSettings);
658+
MG.data_graphic(playersGraphSettings);
655659
656-
// MG.data_graphic(memoryGraphSettings);
657-
// MG.data_graphic(cpuGraphSettings);
658-
// MG.data_graphic(playersGraphSettings);
659-
//
660660
$.each(data.servers, function (uuid, info) {
661661
var element = $('tr[data-server="' + uuid + '"]');
662662
element.find('[data-action="status"]').html(Status[info.status]);

0 commit comments

Comments
 (0)