mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
Add mount_server table, fix wrong field type on other many to many tables, add routes for mounting and unmounting mounts on a server, finish server admin mounts page
This commit is contained in:
@@ -12,8 +12,9 @@ namespace Pterodactyl\Models;
|
||||
* @property bool $read_only
|
||||
* @property bool $user_mountable
|
||||
*
|
||||
* @property \Illuminate\Database\Eloquent\Relations\BelongsToMany $eggs
|
||||
* @property \Illuminate\Database\Eloquent\Relations\BelongsToMany $nodes
|
||||
* @property \Pterodactyl\Models\Egg[]|\Illuminate\Database\Eloquent\Collection $eggs
|
||||
* @property \Pterodactyl\Models\Node[]|\Illuminate\Database\Eloquent\Collection $nodes
|
||||
* @property \Pterodactyl\Models\Server[]|\Illuminate\Database\Eloquent\Collection $servers
|
||||
*/
|
||||
class Mount extends Model
|
||||
{
|
||||
@@ -94,4 +95,14 @@ class Mount extends Model
|
||||
{
|
||||
return $this->belongsToMany(Node::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all servers that have this mount assigned.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function servers()
|
||||
{
|
||||
return $this->belongsToMany(Server::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ use Znck\Eloquent\Traits\BelongsToThrough;
|
||||
* @property \Pterodactyl\Models\DaemonKey[]|\Illuminate\Database\Eloquent\Collection $keys
|
||||
* @property \Pterodactyl\Models\ServerTransfer $transfer
|
||||
* @property \Pterodactyl\Models\Backup[]|\Illuminate\Database\Eloquent\Collection $backups
|
||||
* @property \Pterodactyl\Models\Mount[]|\Illuminate\Database\Eloquent\Collection $mounts
|
||||
*/
|
||||
class Server extends Model
|
||||
{
|
||||
@@ -351,4 +352,14 @@ class Server extends Model
|
||||
{
|
||||
return $this->hasMany(Backup::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all mounts that have this server has mounted.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function mounts()
|
||||
{
|
||||
return $this->belongsToMany(Mount::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user