Import nodelists

This commit is contained in:
Deon George
2021-06-25 21:31:57 +10:00
parent 1f04f8374e
commit 64215ebcea
11 changed files with 446 additions and 149 deletions

View File

@@ -59,6 +59,10 @@ class Address extends Model
return 'Host';
case DomainController::NODE_HC;
return 'Hub';
case DomainController::NODE_PVT;
return 'PVT';
case DomainController::NODE_DOWN;
return 'DOWN';
case NULL:
return 'Node';
default:

20
app/Models/Nodelist.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Nodelist extends Model
{
protected $dates = ['date'];
protected $fillable = ['date','domain_id'];
public const definitions = ['Zone','Region','Host','Hub','Pvt','Down'];
/* RELATIONS */
public function addresses()
{
return $this->belongsToMany(Address::class);
}
}

View File

@@ -31,7 +31,7 @@ class System extends Model
* @param Address $o
* @return string
*/
public function name(Address $o): string
public function full_name(Address $o): string
{
switch ($o->attributes['role']) {
case DomainController::NODE_ZC;