Add Blade directives for common Url functions (#10995)

This commit is contained in:
Jellyfrog
2020-01-04 16:14:50 +01:00
committed by GitHub
parent d21eb10af6
commit 0094940283
6 changed files with 20 additions and 8 deletions

View File

@@ -81,7 +81,7 @@
@foreach($ungrouped_devices as $device)
<tr id="row_{{ $device->device_id }}">
<td><img alt="{{ $device->os }}" src="{{ asset($device->icon) }}" width="32px" height="32px" title="{{ $device->os }}"></td>
<td>{!! \LibreNMS\Util\Url::deviceLink($device) !!}<br />{{ $device->sysName }}</td>
<td>@deviceLink($device)<br />{{ $device->sysName }}</td>
<td>{{ $device->hardware }}</td>
<td>{{ $device->os }} {{ $device->version }} @if($device->features) ({{ $device->features }}) @endif </td>
</tr>

View File

@@ -170,7 +170,7 @@
<strong class="green">@lang('Global Viewing Access')</strong>
@else
@forelse($devices as $device)
{!! \LibreNMS\Util\Url::deviceLink($device) !!} <br />
@deviceLink($device) <br />
@empty
<strong class="red">@lang('No access!')</strong>
@endforelse

View File

@@ -23,7 +23,7 @@
<br style="clear:both;">
@foreach($devices as $device)
<a href="{{ \LibreNMS\Util\Url::deviceUrl($device) }}" title="{{ $device->displayName() }}@if($device->formatUptime(true)) - @endif{{ $device->formatUptime(true) }}">
<a href="@deviceUrl($device)" title="{{ $device->displayName() }}@if($device->formatUptime(true)) - @endif{{ $device->formatUptime(true) }}">
@if($type == 0)
@if($color_only_select)
<span class="label {{ $device->labelClass }} widget-availability-fixed widget-availability label-font-border"> </span>
@@ -37,7 +37,7 @@
@endforeach
@foreach($services as $service)
<a href="{{ \LibreNMS\Util\Url::deviceUrl($service->device, ['tab' => 'services']) }}" title="{{ $service->device->displayName() }} - {{ $service->service_type }} - {{ $service->service_desc }}">
<a href="@deviceUrl($service->device, ['tab' => 'services'])" title="{{ $service->device->displayName() }} - {{ $service->service_type }} - {{ $service->service_desc }}">
@if($type == 0)
@if($color_only_select)
<span class="label {{ $service->labelClass }} widget-availability-fixed widget-availability label-font-border"> </span>

View File

@@ -11,9 +11,9 @@
<tbody>
@foreach($ports as $port)
<tr>
<td class="text-left">{!! \LibreNMS\Util\Url::deviceLink($port->device, $port->device->shortDisplayName()) !!}</td>
<td class="text-left">{!! \LibreNMS\Util\Url::portLink($port, $port->getShortLabel()) !!}</td>
<td class="text-left">{!! \LibreNMS\Util\Url::portLink($port, \LibreNMS\Util\Url::portThumbnail($port)) !!}</td>
<td class="text-left">@deviceLink($port->device, $port->device->shortDisplayName())</td>
<td class="text-left">@portLink($port, $port->getShortLabel())</td>
<td class="text-left">@portLink($port, \LibreNMS\Util\Url::portThumbnail($port))</td>
</tr>
@endforeach
</tbody>

View File

@@ -41,7 +41,7 @@
@foreach($devices as $device)
@if($status != '0' or !$device->isUnderMaintenance())
var title = '<a href="{{ \LibreNMS\Util\Url::deviceUrl($device) }}"><img src="{{ $device->icon }}" width="32" height="32" alt=""> {{ $device->displayName() }}</a>';
var title = '<a href="@deviceUrl($device)"><img src="{{ $device->icon }}" width="32" height="32" alt=""> {{ $device->displayName() }}</a>';
var tooltip = '{{ $device->displayName() }}';
var marker = L.marker(new L.LatLng('{{ $device->location->lat }}', '{{ $device->location->lng }}'), {title: tooltip, icon: {{ $device->markerIcon }}, zIndexOffset: {{ $device->zOffset }}});
marker.bindPopup(title);