mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Device page dropdown hero button, Performance -> Latency (#11328)
* Throw some shit together, rough outline. * Reorganize tabs, use tab controllers * Implement performance (into the latency tab) * Update resources/views/device/header.blade.php Co-Authored-By: Jellyfrog <Jellyfrog@users.noreply.github.com> * Add more tabs * All controllers created * Implement routes * Implement smokeping * routing and auth * fix smokeping check * Implement device dropdown menu * Update deviceUrl to new style * Use Gates * Fix style * use more appropriate gates * add show-config gate remove Laravel helper * Only show vlan tab if VLANs exist for the device :D * Fix rancid file check will return false * revert over-zealous file name changes * don't need to request the location parameter, just cast to string to avoid bugs when not found * Move latency tab (ping/performance) to the position of performance instead of ping. Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
This commit is contained in:
@@ -582,6 +582,11 @@ class Device extends BaseModel
|
||||
|
||||
// ---- Define Relationships ----
|
||||
|
||||
public function accessPoints()
|
||||
{
|
||||
return $this->hasMany(AccessPoint::class, 'device_id');
|
||||
}
|
||||
|
||||
public function alerts()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Alert::class, 'device_id');
|
||||
@@ -622,6 +627,16 @@ class Device extends BaseModel
|
||||
return $this->hasMany(\App\Models\Component::class, 'device_id');
|
||||
}
|
||||
|
||||
public function hostResources()
|
||||
{
|
||||
return $this->hasMany(HrDevice::class, 'device_id');
|
||||
}
|
||||
|
||||
public function entityPhysical()
|
||||
{
|
||||
return $this->hasMany(EntPhysical::class, 'device_id');
|
||||
}
|
||||
|
||||
public function eventlogs()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Eventlog::class, 'device_id', 'device_id');
|
||||
@@ -632,6 +647,11 @@ class Device extends BaseModel
|
||||
return $this->belongsToMany(\App\Models\DeviceGroup::class, 'device_group_device', 'device_id', 'device_group_id');
|
||||
}
|
||||
|
||||
public function ipsecTunnels()
|
||||
{
|
||||
return $this->hasMany(IpsecTunnel::class, 'device_id');
|
||||
}
|
||||
|
||||
public function ipv4()
|
||||
{
|
||||
return $this->hasManyThrough(\App\Models\Ipv4Address::class, \App\Models\Port::class, 'device_id', 'port_id', 'device_id', 'port_id');
|
||||
@@ -647,11 +667,26 @@ class Device extends BaseModel
|
||||
return $this->belongsTo(\App\Models\Location::class, 'location_id', 'id');
|
||||
}
|
||||
|
||||
public function mefInfo()
|
||||
{
|
||||
return $this->hasMany(MefInfo::class, 'device_id');
|
||||
}
|
||||
|
||||
public function muninPlugins()
|
||||
{
|
||||
return $this->hasMany('App\Models\MuninPlugin', 'device_id');
|
||||
}
|
||||
|
||||
public function ospfInstances()
|
||||
{
|
||||
return $this->hasMany(\App\Models\OspfInstance::class, 'device_id');
|
||||
}
|
||||
|
||||
public function netscalerVservers()
|
||||
{
|
||||
return $this->hasMany(NetscalerVserver::class, 'device_id');
|
||||
}
|
||||
|
||||
public function packages()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Package::class, 'device_id', 'device_id');
|
||||
@@ -687,6 +722,11 @@ class Device extends BaseModel
|
||||
return $this->hasMany(\App\Models\Processor::class, 'device_id');
|
||||
}
|
||||
|
||||
public function routes()
|
||||
{
|
||||
return $this->hasMany(Route::class, 'device_id');
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return $this->belongsToMany(\App\Models\AlertRule::class, 'alert_device_map', 'device_id', 'rule_id');
|
||||
@@ -707,6 +747,11 @@ class Device extends BaseModel
|
||||
return $this->hasMany(\App\Models\Storage::class, 'device_id');
|
||||
}
|
||||
|
||||
public function stpInstances()
|
||||
{
|
||||
return $this->hasMany(Stp::class, 'device_id');
|
||||
}
|
||||
|
||||
public function mempools()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Mempool::class, 'device_id');
|
||||
@@ -752,6 +797,26 @@ class Device extends BaseModel
|
||||
return $this->hasMany(\App\Models\MplsTunnelCHop::class, 'device_id');
|
||||
}
|
||||
|
||||
public function printerSupplies()
|
||||
{
|
||||
return $this->hasMany(Toner::class, 'device_id');
|
||||
}
|
||||
|
||||
public function pseudowires()
|
||||
{
|
||||
return $this->hasMany(Pseudowire::class, 'device_id');
|
||||
}
|
||||
|
||||
public function rServers()
|
||||
{
|
||||
return $this->hasMany(LoadbalancerRserver::class, 'device_id');
|
||||
}
|
||||
|
||||
public function slas()
|
||||
{
|
||||
return $this->hasMany(Sla::class, 'device_id');
|
||||
}
|
||||
|
||||
public function syslogs()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Syslog::class, 'device_id', 'device_id');
|
||||
@@ -768,6 +833,11 @@ class Device extends BaseModel
|
||||
return $this->hasMany(\App\Models\Vminfo::class, 'device_id');
|
||||
}
|
||||
|
||||
public function vlans()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Vlan::class, 'device_id');
|
||||
}
|
||||
|
||||
public function vrfLites()
|
||||
{
|
||||
return $this->hasMany(\App\Models\VrfLite::class, 'device_id');
|
||||
@@ -778,6 +848,11 @@ class Device extends BaseModel
|
||||
return $this->hasMany(\App\Models\Vrf::class, 'device_id');
|
||||
}
|
||||
|
||||
public function vServers()
|
||||
{
|
||||
return $this->hasMany(LoadbalancerVserver::class, 'device_id');
|
||||
}
|
||||
|
||||
public function wirelessSensors()
|
||||
{
|
||||
return $this->hasMany(\App\Models\WirelessSensor::class, 'device_id');
|
||||
|
Reference in New Issue
Block a user