Cleanup mount code; automatically include the mount in the configuration
This commit is contained in:
parent
8c6c271916
commit
9a21584c42
8 changed files with 69 additions and 20 deletions
|
@ -33,6 +33,7 @@ use Illuminate\Contracts\Encryption\Encrypter;
|
|||
* @property \Carbon\Carbon $updated_at
|
||||
*
|
||||
* @property \Pterodactyl\Models\Location $location
|
||||
* @property \Pterodactyl\Models\Mount[]|\Illuminate\Database\Eloquent\Collection $mounts
|
||||
* @property \Pterodactyl\Models\Server[]|\Illuminate\Database\Eloquent\Collection $servers
|
||||
* @property \Pterodactyl\Models\Allocation[]|\Illuminate\Database\Eloquent\Collection $allocations
|
||||
*/
|
||||
|
@ -182,6 +183,7 @@ class Node extends Model
|
|||
'bind_port' => $this->daemonSFTP,
|
||||
],
|
||||
],
|
||||
'allowed_mounts' => $this->mounts->pluck('source')->toArray(),
|
||||
'remote' => route('index'),
|
||||
];
|
||||
}
|
||||
|
@ -219,6 +221,14 @@ class Node extends Model
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||
*/
|
||||
public function mounts()
|
||||
{
|
||||
return $this->hasManyThrough(Mount::class, MountNode::class, 'node_id', 'id', 'id', 'mount_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location associated with a node.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue