Tony Murray 055abcf443 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>
2020-04-29 07:25:13 -05:00

59 lines
2.5 KiB
PHP

@extends('layouts.librenmsv1')
@section('title', $device->displayName() . ' ' . $title)
@section('content')
<div class="container-fluid">
@include('device.header')
<ul class="nav nav-tabs">
@foreach($tabs as $tab)
@if($tab->visible($device))
<li role="presentation" @if( $current_tab == $tab->slug() ) class="active" @endif>
<a href="{{ route('device', [$device_id, $tab->slug()]) }}">
<i class="fa {{ $tab->icon() }} fa-lg icon-theme" aria-hidden="true"></i>&nbsp;{{ $tab->name() }}&nbsp;</a>
</li>
@endif
@endforeach
<div class="btn-group pull-right" role="group">
<a href="{{ $primary_device_link['url'] }}"
class="btn btn-default"
type="button"
@if(isset($primary_device_link['onclick']))onclick="{{ $primary_device_link['onclick'] }}" @endif
@if($primary_device_link['external'])target="_blank" rel="noopener" @endif
title="{{ $primary_device_link['title'] }}"
> <i class="fa {{ $primary_device_link['icon'] }} fa-lg icon-theme"></i>
</a>
<div class="btn-group" role="group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
&nbsp;<i class="fa fa-ellipsis-v fa-lg icon-theme"></i>&nbsp;
</button>
<ul class="dropdown-menu dropdown-menu-right">
@foreach($device_links as $link)
<li><a href="{{ $link['url'] }}"
@if(isset($link['onclick']))onclick="{{ $link['onclick'] }}" @endif
@if($link['external'])target="_blank" rel="noopener" @endif
><i class="fa {{ $link['icon'] }} fa-lg fa-fw icon-theme" aria-hidden="true"></i> {{ $link['title'] }}</a></li>
@endforeach
</ul>
</div>
</div>
</ul>
<div class="tab-content">
<div class="tab-pane active">
@yield('tab')
</div>
</div>
</div>
@endsection
@section('css')
<style>
.tab-content {
margin-top: 8px;
}
</style>
@endsection