diff --git a/public/themes/pterodactyl/js/admin/new-server.js b/public/themes/pterodactyl/js/admin/new-server.js
index d52502f33..3e0718a46 100644
--- a/public/themes/pterodactyl/js/admin/new-server.js
+++ b/public/themes/pterodactyl/js/admin/new-server.js
@@ -101,8 +101,11 @@ $('#pEggId').on('change', function (event) {
),
});
+ const variableIds = {};
$('#appendVariablesTo').html('');
$.each(_.get(objectChain, 'variables', []), function (i, item) {
+ variableIds[item.env_variable] = 'var_ref_' + item.id;
+
let isRequired = (item.required === 1) ? 'Required ' : '';
let dataAppend = ' \
\
@@ -115,6 +118,10 @@ $('#pEggId').on('change', function (event) {
';
$('#appendVariablesTo').append(dataAppend);
});
+
+ // If you receive a warning on this line, it should be fine to ignore. this function is
+ // defined in "resources/views/admin/servers/new.blade.php" near the bottom of the file.
+ serviceVariablesUpdated($('#pEggId').val(), variableIds);
});
$('#pAllocation').on('change', function () {
diff --git a/resources/views/admin/servers/new.blade.php b/resources/views/admin/servers/new.blade.php
index b3418347e..1d61f1a50 100644
--- a/resources/views/admin/servers/new.blade.php
+++ b/resources/views/admin/servers/new.blade.php
@@ -309,11 +309,31 @@
@section('footer-scripts')
@parent
{!! Theme::js('vendor/lodash/lodash.js') !!}
+
+
+
{!! Theme::js('js/admin/new-server.js') !!}
@endsection