mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
Add mounts page to server admin view
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Pterodactyl\Repositories\Eloquent;
|
||||
|
||||
use Pterodactyl\Models\Mount;
|
||||
use Illuminate\Support\Collection;
|
||||
use Pterodactyl\Models\Server;
|
||||
use Pterodactyl\Repositories\Concerns\Searchable;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
|
||||
@@ -48,4 +49,22 @@ class MountRepository extends EloquentRepository
|
||||
throw new RecordNotFoundException;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return mounts available to a server. (ignoring if they are or are not mounted)
|
||||
*
|
||||
* @param Server $server
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getMountListForServer(Server $server): Collection
|
||||
{
|
||||
return $this->getBuilder()
|
||||
->whereHas('eggs', function ($q) use ($server) {
|
||||
$q->where('id', '=', $server->egg_id);
|
||||
})
|
||||
->whereHas('nodes', function ($q) use ($server) {
|
||||
$q->where('id', '=', $server->node_id);
|
||||
})
|
||||
->get($this->getColumns());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user