Restore vminfo menu (#10303)

This commit is contained in:
Tony Murray
2019-06-03 19:15:13 -05:00
committed by GitHub
parent 6f6e8e9f1c
commit 1c1b07fee5
3 changed files with 15 additions and 0 deletions

View File

@ -33,6 +33,7 @@ use App\Models\Location;
use App\Models\Notification;
use App\Models\Package;
use App\Models\User;
use App\Models\Vminfo;
use App\Models\WirelessSensor;
use Auth;
use Illuminate\View\View;
@ -68,6 +69,7 @@ class MenuComposer
$vars['locations'] = (Config::get('show_locations') && Config::get('show_locations_dropdown')) ?
Location::hasAccess($user)->where('location', '!=', '')->orderBy('location')->get(['location', 'id']) :
collect();
$vars['show_vmwinfo'] = Vminfo::hasAccess($user)->exists();
// Service menu
if (Config::get('show_services')) {

9
app/Models/Vminfo.php Normal file
View File

@ -0,0 +1,9 @@
<?php
namespace App\Models;
class Vminfo extends DeviceRelatedModel
{
protected $table = 'vminfo';
public $timestamps = false;
}

View File

@ -140,6 +140,10 @@
<li><a href="{{ url('device-groups') }}"><i class="fa fa-th fa-fw fa-lg" aria-hidden="true"></i> Manage Groups</a></li>
@endconfig
<li><a href="{{ url('device-dependencies') }}"><i class="fa fa-group fa-fw fa-lg"></i> Device Dependencies</a></li>
@if($show_vmwinfo)
<li><a href="{{ url('vminfo') }}"><i
class="fa fa-cog fa-fw fa-lg"></i> @lang('Virtual Machines')</a></li>
@endif
<li role="presentation" class="divider"></li>
<li><a href="{{ url('addhost') }}"><i class="fa fa-plus fa-fw fa-lg" aria-hidden="true"></i> Add Device</a></li>
<li><a href="{{ url('delhost') }}"><i class="fa fa-trash fa-fw fa-lg" aria-hidden="true"></i> Delete Device</a></li>