Apply node maintenance mode to servers (#4421)
This commit is contained in:
parent
4032481a4f
commit
032e4f2e31
11 changed files with 29 additions and 5 deletions
|
@ -186,6 +186,11 @@ class Node extends Model
|
|||
);
|
||||
}
|
||||
|
||||
public function isUnderMaintenance(): bool
|
||||
{
|
||||
return $this->maintenance_mode;
|
||||
}
|
||||
|
||||
public function mounts(): HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(Mount::class, MountNode::class, 'node_id', 'id', 'id', 'mount_id');
|
||||
|
|
|
@ -354,6 +354,7 @@ class Server extends Model
|
|||
{
|
||||
if (
|
||||
$this->isSuspended() ||
|
||||
$this->node->isUnderMaintenance() ||
|
||||
!$this->isInstalled() ||
|
||||
$this->status === self::STATUS_RESTORING_BACKUP ||
|
||||
!is_null($this->transfer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue