Skip to content

Commit 0c6e6f3

Browse files
committed
Fix multiple clients causing all consoles to refresh
1 parent 202dd52 commit 0c6e6f3

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
2323
* `[pre.4]` — Fixes non-admin users being unable to create personal API keys.
2424
* Fixes bug where daemon was unable to register that certain games had fully booted and were ready to play on.
2525
* Fixes bug causing MySQL user accounts to be corrupted when resetting a password via the panel.
26+
* `[pre.4]` — Multiple clients refreshing the console no longer clears the console for all parties involved... sorry about that.
2627

2728
### Added
2829
* Ability to assign multiple allocations at once when creating a new server.

public/themes/pterodactyl/js/frontend/console.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var Console = (function () {
2424

2525
var terminalQueue;
2626
var terminal;
27+
var recievedInitialLog = false;
2728

2829
var cpuChart;
2930
var cpuData;
@@ -159,11 +160,12 @@ var Console = (function () {
159160
function addSocketListeners() {
160161
// Update Listings on Initial Status
161162
Socket.on('initial status', function (data) {
162-
updateServerPowerControls(data.status);
163+
if (! recievedInitialLog) {
164+
updateServerPowerControls(data.status);
163165

164-
terminal.clear();
165-
if (data.status === 1 || data.status === 2) {
166-
Socket.emit('send server log');
166+
if (data.status === 1 || data.status === 2) {
167+
Socket.emit('send server log');
168+
}
167169
}
168170
});
169171

@@ -172,6 +174,14 @@ var Console = (function () {
172174
updateServerPowerControls(data.status);
173175
});
174176

177+
Socket.on('server log', function (data) {
178+
if (! recievedInitialLog) {
179+
terminal.clear();
180+
terminalQueue.push(data);
181+
recievedInitialLog = true;
182+
}
183+
});
184+
175185
Socket.on('console', function (data) {
176186
terminalQueue.push(data.line);
177187
});

0 commit comments

Comments
 (0)