adds support for viewing server stats from 'Your Servers' page
http://s3.pterodactyl.io/bnSTK.png
This commit is contained in:
parent
69f0340c48
commit
09d28bf145
5 changed files with 65 additions and 38 deletions
|
@ -79,10 +79,10 @@ class Server extends Model
|
|||
*
|
||||
* @return \Illuminate\Database\Eloquent\Collection
|
||||
*/
|
||||
public static function getUserServers()
|
||||
public static function getUserServers($paginate = null)
|
||||
{
|
||||
|
||||
$query = self::select('servers.*', 'nodes.name as nodeName', 'locations.long as location')
|
||||
$query = self::select('servers.*', 'nodes.name as nodeName', 'locations.short as a_locationShort')
|
||||
->join('nodes', 'servers.node', '=', 'nodes.id')
|
||||
->join('locations', 'nodes.location', '=', 'locations.id')
|
||||
->where('active', 1);
|
||||
|
@ -91,6 +91,10 @@ class Server extends Model
|
|||
$query->whereIn('servers.id', Subuser::accessServers());
|
||||
}
|
||||
|
||||
if (is_numeric($paginate)) {
|
||||
return $query->paginate($paginate);
|
||||
}
|
||||
|
||||
return $query->get();
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue