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