mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
More Widget fixes (#9559)
* limit worldmap to active devices, use scope in availability map * Linkable totals and better option description for disabled/ignored. * fix disabled / ignore enabled display * better? links * style improvements. Not important enough to bump version * fix top interfaces query
This commit is contained in:
@@ -102,9 +102,9 @@ class AvailabilityMapController extends WidgetController
|
||||
}
|
||||
|
||||
if (!$settings['show_disabled_and_ignored']) {
|
||||
$device_query->where('disabled', 0)->where('ignore', 0);
|
||||
$device_query->isActive();
|
||||
}
|
||||
$devices = $device_query->select('devices.device_id', 'hostname', 'sysName', 'status', 'uptime')->get();
|
||||
$devices = $device_query->select('devices.device_id', 'hostname', 'sysName', 'status', 'uptime', 'disabled', 'ignore')->get();
|
||||
|
||||
// process status
|
||||
$uptime_warn = Config::get('uptime_warning', 84600);
|
||||
|
@@ -52,7 +52,8 @@ class TopInterfacesController extends WidgetController
|
||||
}])
|
||||
->select('port_id', 'device_id', 'ifName', 'ifDescr', 'ifAlias')
|
||||
->groupBy('port_id', 'device_id', 'ifName', 'ifDescr', 'ifAlias')
|
||||
->where('poll_time', '>', Carbon::now()->subMinutes($data['time_interval']))
|
||||
->where('poll_time', '>', Carbon::now()->subMinutes($data['time_interval'])->timestamp)
|
||||
->has('device')
|
||||
->orderByRaw('SUM(ifInOctets_rate + ifOutOctets_rate) DESC')
|
||||
->limit($data['interface_count']);
|
||||
|
||||
|
@@ -58,7 +58,7 @@ class WorldMapController extends WidgetController
|
||||
|
||||
$devices = Device::hasAccess($request->user())
|
||||
->with('location')
|
||||
->where('disabled', 0)
|
||||
->isActive()
|
||||
->whereIn('status', $status)
|
||||
->get()
|
||||
->filter(function ($device) use ($status) {
|
||||
|
@@ -1917,6 +1917,7 @@ label {
|
||||
overflow-y: auto;
|
||||
width: 100%;
|
||||
height: calc(100% - 38px);
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.device-availability, .service-availability {
|
||||
@@ -2007,7 +2008,6 @@ label {
|
||||
.widget-availability {
|
||||
float:left;
|
||||
margin:2px;
|
||||
curosr: pointer;
|
||||
}
|
||||
|
||||
.widget-availability-fixed {
|
||||
@@ -2021,6 +2021,10 @@ label {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.widget-availability-host a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.widget-availability-service {
|
||||
float:right;
|
||||
margin-bottom: 10px;
|
||||
|
@@ -2,12 +2,12 @@
|
||||
<div class="widget-availability-host">
|
||||
<span>@lang('Total hosts')</span>
|
||||
@if($show_disabled_and_ignored)
|
||||
<span class="label label-default label-font-border label-border">@lang('ignored'): {{ $device_totals['ignored'] }}</span>
|
||||
<span class="label blackbg label-font-border label-border">@lang('disabled'): {{ $device_totals['disabled'] }}</span>
|
||||
<a href="{{ url('devices/ignore=1') }}"><span class="label label-default label-font-border label-border">@lang('ignored'): {{ $device_totals['ignored'] }}</span></a>
|
||||
<a href="{{ url('devices/disabled=1') }}"><span class="label blackbg label-font-border label-border">@lang('disabled'): {{ $device_totals['disabled'] }}</span></a>
|
||||
@endif
|
||||
<span class="label label-success label-font-border label-border">@lang('up'): {{ $device_totals['up'] }}</span>
|
||||
<a href="{{ url('devices/state=up') }}"><span class="label label-success label-font-border label-border">@lang('up'): {{ $device_totals['up'] }}</span></a>
|
||||
<span class="label label-warning label-font-border label-border">@lang('warn'): {{ $device_totals['warn'] }}</span>
|
||||
<span class="label label-danger label-font-border label-border">@lang('down'): {{ $device_totals['down'] }}</span>
|
||||
<a href="{{ url('devices/state=down') }}"><span class="label label-danger label-font-border label-border">@lang('down'): {{ $device_totals['down'] }}</span></a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
@@ -30,8 +30,8 @@
|
||||
<div class="form-group">
|
||||
<label for="show_disabled_and_ignored-{{ $id }}" class="control-label">@lang('Disabled/ignored')</label>
|
||||
<select class="form-control" name="show_disabled_and_ignored" id="show_disabled_and_ignored-{{ $id }}">
|
||||
<option value="1" @if($show_disabled_and_ignored) selected @endif>@lang('yes')</option>
|
||||
<option value="0" @unless($show_disabled_and_ignored) selected @endunless>@lang('no')</option>
|
||||
<option value="1" @if($show_disabled_and_ignored) selected @endif>@lang('Show')</option>
|
||||
<option value="0" @unless($show_disabled_and_ignored) selected @endunless>@lang('Hide')</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user