redirect if no locations

This commit is contained in:
Dane Everitt 2016-09-30 16:05:39 -04:00
parent 2e88c51ac7
commit 16222d1bd7
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 6 additions and 0 deletions

View file

@ -12,6 +12,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
### Changed
* Prevent clicking server start button until server is completely off, not just stopping.
* Upon successful creation of a node it will redirect to the allocation tab and display a clearer message to add allocations.
* Trying to add a new node if no location exists redirects user to location management page and alerts them to add a location first.
### Fixed
* Team Fortress named 'Insurgency' in panel in database seeder. ([#96](https://github.com/Pterodactyl/Panel/issues/96), PR by [@MeltedLux](https://github.com/MeltedLux))

View file

@ -65,6 +65,11 @@ class NodesController extends Controller
public function getNew(Request $request)
{
if (!Models\Location::all()->count()) {
Alert::warning('You must add a location before you can add a new node.')->flash();
return redirect()->route('admin.locations');
}
return view('admin.nodes.new', [
'locations' => Models\Location::all()
]);