The nodes create page will redirect you to the locations page if you don't have a location, the concept is the same here (#640)

This commit is contained in:
Lance Pioch 2017-09-21 19:05:55 -04:00 committed by Dane Everitt
parent 7c41a6965b
commit 0f07d6bcf5
2 changed files with 8 additions and 0 deletions

View File

@ -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([

View File

@ -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.',
],
];