Skip to content

Commit ff93d6c

Browse files
committed
Rebase
1 parent 6fd7c78 commit ff93d6c

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ APP_THEME=default
55
APP_TIMEZONE=UTC
66
APP_CLEAR_TASKLOG=720
77
APP_DELETE_MINUTES=10
8+
CONSOLE_PUSH_FREQ=250
9+
CONSOLE_PUSH_COUNT=10
810

911
DB_HOST=localhost
1012
DB_PORT=3306

public/themes/default/css/pterodactyl.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,3 +271,17 @@ li.btn.btn-default.pill:active,li.btn.btn-default.pill:focus,li.btn.btn-default.
271271
.fuelux .wizard .steps-container {
272272
background-color: #eee;
273273
}
274+
275+
#consoleThrottled {
276+
z-index: 999;
277+
top: 0px;
278+
opacity: 0.6;
279+
left: 0;
280+
position: absolute;
281+
margin: 0 15px;
282+
border-radius: 4px 4px 0 0;
283+
}
284+
285+
#consoleThrottled:hover {
286+
opacity: 1;
287+
}

resources/views/server/index.blade.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@
4848
<div class="panel-body">
4949
<div class="row">
5050
<div class="col-md-12">
51-
<div id="terminal"></div>
51+
<div class="alert alert-info hidden" id="consoleThrottled">
52+
The console is currently being throttled due to the speed at which data is being sent. Messages are being queued and will appear as the queue is worked through.
53+
</div>
54+
<div id="terminal">
55+
</div>
5256
</div>
5357
<div class="col-md-12" style="text-align:center;">
5458
<hr />
@@ -364,10 +368,27 @@ function (callback) {
364368
});
365369
366370
// New Console Data Recieved
371+
var outputQueue = [];
367372
socket.on('console', function (data) {
368-
terminal.echo(data.line);
373+
outputQueue.push(data.line);
369374
});
370375
376+
window.setInterval(pushOutputQueue, {{ env('CONSOLE_PUSH_FREQ', 250) }});
377+
function pushOutputQueue()
378+
{
379+
if (outputQueue.length > {{ env('CONSOLE_PUSH_COUNT', 10) }}) {
380+
$('#consoleThrottled').removeClass('hidden');
381+
} else {
382+
$('#consoleThrottled').addClass('hidden');
383+
}
384+
385+
for (var i = 0; i < {{ env('CONSOLE_PUSH_COUNT', 10) }}; i++)
386+
{
387+
terminal.echo(outputQueue[0]);
388+
outputQueue.shift();
389+
}
390+
}
391+
371392
// Update Listings on Initial Status
372393
socket.on('initial_status', function (data) {
373394
currentStatus = data.status;

0 commit comments

Comments
 (0)