2015-12-06 18:58:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Controllers\Admin;
|
|
|
|
|
|
|
|
use Debugbar;
|
|
|
|
use Pterodactyl\Models\Server;
|
|
|
|
use Pterodactyl\Models\Node;
|
2015-12-07 05:47:19 +00:00
|
|
|
use Pterodactyl\Models\Location;
|
2015-12-06 18:58:49 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2015-12-07 05:47:19 +00:00
|
|
|
return view('admin.servers.new', [
|
|
|
|
'locations' => Location::all()
|
|
|
|
]);
|
2015-12-06 18:58:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getView(Request $request, $id)
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|