Skip to content

Commit 0bb44a4

Browse files
committed
Fix server startup dropdown for egg being incorrect, fixes pterodactyl#778
1 parent 34db410 commit 0bb44a4

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
66
## v0.7.0-beta.3 (Derelict Dermodactylus)
77
### Fixed
88
* `[beta.2]` — Fixes a bug that would cause an endless exception message stream in the console when attemping to setup environment settings in certain instances.
9+
* `[beta.2]` — Fixes a bug causing the dropdown menu for a server's egg to display the wrong selected value.
910

1011
## v0.7.0-beta.2 (Derelict Dermodactylus)
1112
### Fixed

app/Http/Controllers/Admin/ServersController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,21 +319,22 @@ public function viewBuild($server)
319319
/**
320320
* Display startup configuration page for a server.
321321
*
322-
* @param int $server
322+
* @param \Pterodactyl\Models\Server $server
323323
* @return \Illuminate\View\View
324324
*
325325
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
326326
*/
327-
public function viewStartup($server)
327+
public function viewStartup(Server $server)
328328
{
329-
$parameters = $this->repository->getVariablesWithValues($server, true);
329+
$parameters = $this->repository->getVariablesWithValues($server->id, true);
330330
if (! $parameters->server->installed) {
331331
abort(404);
332332
}
333333

334334
$nests = $this->nestRepository->getWithEggs();
335335

336336
Javascript::put([
337+
'server' => $server,
337338
'nests' => $nests->map(function ($item) {
338339
return array_merge($item->toArray(), [
339340
'eggs' => $item->eggs->keyBy('id')->toArray(),

resources/lang/en/admin/server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
'default_allocation_not_found' => 'The requested default allocation was not found in this server\'s allocations.',
1717
],
1818
'alerts' => [
19-
'startup_changed' => 'The startup configuration for this server has been updated. If this server\'s service or option was changed a reinstall will be occuring now.',
19+
'startup_changed' => 'The startup configuration for this server has been updated. If this server\'s nest or egg was changed a reinstall will be occuring now.',
2020
'server_deleted' => 'Server has successfully been deleted from the system.',
2121
'server_created' => 'Server was successfully created on the panel. Please allow the daemon a few minutes to completely install this server.',
2222
'build_updated' => 'The build details for this server have been updated. Some changes may require a restart to take effect.',

resources/themes/pterodactyl/admin/servers/view/startup.blade.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
text: item.name,
149149
};
150150
}),
151-
}).change();
151+
}).val(Pterodactyl.server.egg_id).change();
152152
});
153153
154154
$('#pEggId').on('change', function (event) {
@@ -157,8 +157,8 @@
157157
158158
$('#setDefaultImage').html(_.get(objectChain, 'docker_image', 'undefined'));
159159
$('#pDockerImage').val(_.get(objectChain, 'docker_image', 'undefined'));
160-
if (objectChain.id === parseInt('{{ $server->egg_id }}')) {
161-
$('#pDockerImage').val('{{ $server->image }}');
160+
if (objectChain.id === parseInt(Pterodactyl.server.egg_id)) {
161+
$('#pDockerImage').val(Pterodactyl.server.image);
162162
}
163163
164164
if (!_.get(objectChain, 'startup', false)) {
@@ -178,9 +178,9 @@
178178
),
179179
});
180180
181-
@if(! is_null($server->pack_id))
182-
$('#pPackId').val({{ $server->pack_id }});
183-
@endif
181+
if (Pterodactyl.server.pack_id !== null) {
182+
$('#pPackId').val(Pterodactyl.server.pack_id);
183+
}
184184
185185
$('#appendVariablesTo').html('');
186186
$.each(_.get(objectChain, 'variables', []), function (i, item) {

0 commit comments

Comments
 (0)