misc_pterodactyl-panel/app/Http/Controllers/Admin/ServersController.php
Dane Everitt 47235b670a Push some basic add server functionality
Doesn’t support adding the server, but adds improved support for
handling picking server location, node, and ip+port
2015-12-07 00:47:19 -05:00

50 lines
1.1 KiB
PHP

<?php
namespace Pterodactyl\Http\Controllers\Admin;
use Debugbar;
use Pterodactyl\Models\Server;
use Pterodactyl\Models\Node;
use Pterodactyl\Models\Location;
use Pterodactyl\Http\Controllers\Controller;
use Illuminate\Http\Request;
class ServersController extends Controller
{
/**
* Controller Constructor
*/
public function __construct()
{
// All routes in this controller are protected by the authentication middleware.
$this->middleware('auth');
$this->middleware('admin');
}
public function getIndex(Request $request)
{
return view('admin.servers.index', [
'servers' => Server::select('servers.*', 'nodes.name as a_nodeName', 'users.email as a_ownerEmail')
->join('nodes', 'servers.node', '=', 'nodes.id')
->join('users', 'servers.owner', '=', 'users.id')
->paginate(20),
]);
}
public function getNew(Request $request)
{
return view('admin.servers.new', [
'locations' => Location::all()
]);
}
public function getView(Request $request, $id)
{
//
}
}