Fix/optimise address creation/editing via System AKAs
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 40s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m46s
Create Docker Image / Final Docker Image Manifest (push) Successful in 11s

This commit is contained in:
2024-05-27 21:42:03 +10:00
parent b102fc4d2a
commit 7ef9f2dbd0
5 changed files with 254 additions and 210 deletions

View File

@@ -61,7 +61,7 @@ class Address extends Model
// http://ftsc.org/docs/frl-1002.001
public const ADDRESS_FIELD_MAX = 0x7fff; // Maximum value for a field in the address
protected $visible = ['zone_id','region_id','host_id','node_id','point_id','security'];
protected $visible = ['zone_id','region_id','host_id','hub_id','node_id','point_id','security'];
/* STATIC */
@@ -752,7 +752,7 @@ class Address extends Model
public function getIsPrivateAttribute(): bool
{
return $this->role & self::NODE_PVT;
return (! $this->system->address);
}
/**
@@ -787,6 +787,13 @@ class Address extends Model
*/
public function getRoleNameAttribute(): string
{
if ($this->getIsDownAttribute())
return 'DOWN';
if ($this->getIsHoldAttribute())
return 'HOLD';
if ($this->getIsPrivateAttribute())
return 'PVT';
switch ($this->role_id) {
case self::NODE_ZC:
return 'ZC';