Fix/optimise address creation/editing via System AKAs
This commit is contained in:
@@ -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';
|
||||
|
Reference in New Issue
Block a user