diff --git a/app/Console/Commands/InfoCommand.php b/app/Console/Commands/InfoCommand.php index 42f6df2b0..926b06ef1 100644 --- a/app/Console/Commands/InfoCommand.php +++ b/app/Console/Commands/InfoCommand.php @@ -30,6 +30,11 @@ use Illuminate\Contracts\Config\Repository as ConfigRepository; class InfoCommand extends Command { + /** + * @var string + */ + protected $description = 'Displays the application, database, and email configurations along with the panel version.'; + /** * @var \Illuminate\Contracts\Config\Repository */ diff --git a/app/Console/Commands/Location/DeleteLocationCommand.php b/app/Console/Commands/Location/DeleteLocationCommand.php index b75c186f0..90dd533a9 100644 --- a/app/Console/Commands/Location/DeleteLocationCommand.php +++ b/app/Console/Commands/Location/DeleteLocationCommand.php @@ -35,6 +35,11 @@ class DeleteLocationCommand extends Command */ protected $deletionService; + /** + * @var string + */ + protected $description = 'Deletes a location from the Panel.'; + /** * @var \Illuminate\Support\Collection */ diff --git a/app/Console/Commands/User/MakeUserCommand.php b/app/Console/Commands/User/MakeUserCommand.php index 02bdd1baf..0bb681456 100644 --- a/app/Console/Commands/User/MakeUserCommand.php +++ b/app/Console/Commands/User/MakeUserCommand.php @@ -34,6 +34,11 @@ class MakeUserCommand extends Command */ protected $creationService; + /** + * @var string + */ + protected $description = 'Creates a user on the system via the CLI.'; + /** * @var string */ diff --git a/app/Http/Controllers/Admin/ServersController.php b/app/Http/Controllers/Admin/ServersController.php index db84291be..b87539951 100644 --- a/app/Http/Controllers/Admin/ServersController.php +++ b/app/Http/Controllers/Admin/ServersController.php @@ -226,6 +226,13 @@ class ServersController extends Controller */ public function create() { + $nodes = $this->nodeRepository->all(); + if (count($nodes) < 1) { + $this->alert->warning(trans('admin/server.alerts.node_required'))->flash(); + + return redirect()->route('admin.nodes'); + } + $services = $this->serviceRepository->getWithOptions(); Javascript::put([ diff --git a/app/Models/Server.php b/app/Models/Server.php index b31a89a7c..2dd37c5f9 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -81,6 +81,8 @@ class Server extends Model implements CleansAttributes, ValidableContract 'disk' => 'required', 'service_id' => 'required', 'option_id' => 'required', + 'node_id' => 'required', + 'allocation_id' => 'required', 'pack_id' => 'sometimes', 'auto_deploy' => 'sometimes', 'custom_id' => 'sometimes', diff --git a/public/themes/pterodactyl/js/admin/new-server.js b/public/themes/pterodactyl/js/admin/new-server.js index ecc0b9fb7..2501a4cc9 100644 --- a/public/themes/pterodactyl/js/admin/new-server.js +++ b/public/themes/pterodactyl/js/admin/new-server.js @@ -27,9 +27,6 @@ $(document).ready(function() { $('#pPackId').select2({ placeholder: 'Select a Service Pack', }); - $('#pLocationId').select2({ - placeholder: 'Select a Location', - }).change(); $('#pNodeId').select2({ placeholder: 'Select a Node', }); @@ -100,29 +97,9 @@ $(document).on('click', function (event) { lastActiveBox.addClass('box-primary'); }); -var currentLocation = null; var curentNode = null; var NodeData = []; -$('#pLocationId').on('change', function (event) { - showLoader(); - currentLocation = $(this).val(); - currentNode = null; - - $.ajax({ - method: 'POST', - url: Router.route('admin.servers.new.nodes'), - headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') }, - data: { location: currentLocation }, - }).done(function (data) { - NodeData = data; - $('#pNodeId').html('').select2({data: data}).change(); - }).fail(function (jqXHR) { - cosole.error(jqXHR); - currentLocation = null; - }).always(hideLoader); -}); - $('#pNodeId').on('change', function (event) { currentNode = $(this).val(); $.each(NodeData, function (i, v) { diff --git a/resources/lang/en/admin/server.php b/resources/lang/en/admin/server.php index 6cf48223a..4f5840b59 100644 --- a/resources/lang/en/admin/server.php +++ b/resources/lang/en/admin/server.php @@ -41,5 +41,6 @@ return [ 'server_reinstalled' => 'This server has been queued for a reinstallation beginning now.', 'details_updated' => 'Server details have been successfully updated.', 'docker_image_updated' => 'Successfully changed the default Docker image to use for this server. A reboot is required to apply this change.', + 'node_required' => 'You must have at least one node configured before you can add a server to this panel.', ], ]; diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index cc2d737c9..ebaee6243 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -3,7 +3,7 @@ return [ 'not_authorized' => 'You are not authorized to perform this action.', 'auth_error' => 'There was an error while attempting to login.', - 'authentication_required' => 'Authentication is required in order to continue.', + 'authentication_required' => 'Authentication is required to continue.', 'remember_me' => 'Remember Me', 'sign_in' => 'Sign In', 'forgot_password' => 'I\'ve forgotten my password!', diff --git a/resources/themes/pterodactyl/admin/servers/new.blade.php b/resources/themes/pterodactyl/admin/servers/new.blade.php index 1fafa0e0f..fce6f538a 100644 --- a/resources/themes/pterodactyl/admin/servers/new.blade.php +++ b/resources/themes/pterodactyl/admin/servers/new.blade.php @@ -78,21 +78,20 @@
- - @foreach($locations as $location) - + + @foreach($location->nodes as $node) + + + + @endforeach + @endforeach -

The location in which this server will be deployed.

-
-
- -

The node which this server will be deployed to.

@@ -100,7 +99,7 @@

The main allocation that will be assigned to this server.

-
+

Additional allocations to assign to this server on creation.

diff --git a/resources/themes/pterodactyl/admin/users/new.blade.php b/resources/themes/pterodactyl/admin/users/new.blade.php index 3debd78ee..926c3866a 100644 --- a/resources/themes/pterodactyl/admin/users/new.blade.php +++ b/resources/themes/pterodactyl/admin/users/new.blade.php @@ -82,8 +82,8 @@

Setting this to 'Yes' gives a user full administrative access.

diff --git a/resources/themes/pterodactyl/admin/users/view.blade.php b/resources/themes/pterodactyl/admin/users/view.blade.php index 3e23bb26d..83d445a5b 100644 --- a/resources/themes/pterodactyl/admin/users/view.blade.php +++ b/resources/themes/pterodactyl/admin/users/view.blade.php @@ -99,8 +99,8 @@

Setting this to 'Yes' gives a user full administrative access.

diff --git a/resources/themes/pterodactyl/layouts/admin.blade.php b/resources/themes/pterodactyl/layouts/admin.blade.php index b86896936..eb309b1ee 100644 --- a/resources/themes/pterodactyl/layouts/admin.blade.php +++ b/resources/themes/pterodactyl/layouts/admin.blade.php @@ -79,7 +79,7 @@
  • -
  • +
  • @@ -196,9 +196,18 @@ @endif diff --git a/resources/themes/pterodactyl/layouts/master.blade.php b/resources/themes/pterodactyl/layouts/master.blade.php index 6cf727961..41e82fbb8 100644 --- a/resources/themes/pterodactyl/layouts/master.blade.php +++ b/resources/themes/pterodactyl/layouts/master.blade.php @@ -75,15 +75,15 @@ {{--
  • --}} - {{----}} + {{----}} {{--
  • --}} @if(Auth::user()->root_admin)
  • -
  • +
  • @endif
  • -
  • +
  • @@ -289,9 +289,18 @@ @endif diff --git a/resources/themes/pterodactyl/server/files/edit.blade.php b/resources/themes/pterodactyl/server/files/edit.blade.php index 0d29e2c6c..e881aa289 100644 --- a/resources/themes/pterodactyl/server/files/edit.blade.php +++ b/resources/themes/pterodactyl/server/files/edit.blade.php @@ -40,7 +40,7 @@

    {{ $file }}

    @@ -49,7 +49,7 @@