Convert blade to panel component (#11957)

This commit is contained in:
Jellyfrog
2020-07-24 06:13:00 +02:00
committed by GitHub
parent 020c5fd7e1
commit 6dba2555a7
18 changed files with 659 additions and 681 deletions

View File

@@ -14,15 +14,31 @@ class Panel extends Component
*/ */
public $title; public $title;
/**
* The Panel body class.
*
* @var string
*/
public $body_class;
/**
* The Panel footer class.
*
* @var string
*/
public $footer_class;
/** /**
* Create a new component instance. * Create a new component instance.
* *
* @return void * @return void
*/ */
public function __construct($title = null) public function __construct($title = null, $bodyClass = null, $footerClass = null)
{ {
$this->title = $title; $this->title = $title;
$this->body_class = $bodyClass;
$this->footer_class = $footerClass;
} }
/** /**

View File

@@ -8,99 +8,95 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">
<div class="panel panel-default"> <x-panel>
<div class="panel-heading"> <x-slot name="title">
<h3 class="panel-title center-block"> <img class="logon-logo img-responsive" src="{{ asset(\LibreNMS\Config::get('title_image', 'images/librenms_logo_light.svg')) }}">
<img class="logon-logo img-responsive" src="{{ asset(\LibreNMS\Config::get('title_image', 'images/librenms_logo_light.svg')) }}"> </x-slot>
</h3>
</div>
<div class="panel-body">
<div class="container-fluid">
@if(session('twofactoradd'))
<div class="row">
<div id="twofactorqrcontainer" class="col-md-12">
<h4>Scan with your Two Factor Authenticator.</h4>
<div class="col-md-12 text-center" id="twofactorqr"></div>
<div class="col-md-12 text-center">
<button class="btn btn-default" onclick="$('#twofactorqrcontainer').hide(); $('#twofactorkeycontainer').show();">Manual</button>
</div>
</div>
<div id="twofactorkeycontainer" style="display: none" class="col-md-12"> <div class="container-fluid">
<div class="col-sm-12"> @if(session('twofactoradd'))
<h4 style="user-select: none;">Secret Key:</h4> <div class="row">
</div> <div id="twofactorqrcontainer" class="col-md-12">
<div class="col-sm-12 text-center" style="padding: 32px 0; font-size: medium;"> <h4>Scan with your Two Factor Authenticator.</h4>
{{ $key }} <div class="col-md-12 text-center" id="twofactorqr"></div>
</div> <div class="col-md-12 text-center">
<div class="col-sm-12 text-center"> <button class="btn btn-default" onclick="$('#twofactorqrcontainer').hide(); $('#twofactorkeycontainer').show();">Manual</button>
<button class="btn btn-default" onclick="$('#twofactorkeycontainer').hide(); $('#twofactorqrcontainer').show();">QR</button>
</div>
</div> </div>
<script>$("#twofactorqr").qrcode({"text": "{!! $uri !!}"});</script>
</div> </div>
@endif
<div class="row"> <div id="twofactorkeycontainer" style="display: none" class="col-md-12">
<div class="col-md-12"> <div class="col-sm-12">
<form class="form-horizontal" role="form" action="{{ route('2fa.verify') }}" method="post" name="twofactorform"> <h4 style="user-select: none;">Secret Key:</h4>
{{ csrf_field() }} </div>
<div class="form-group"> <div class="col-sm-12 text-center" style="padding: 32px 0; font-size: medium;">
<div class="col-md-8 col-md-offset-2"> {{ $key }}
<div id="twoFactorErrors" class="help-block"> </div>
@foreach($errors->all() as $error) <div class="col-sm-12 text-center">
<strong>{{ $error }}</strong> <button class="btn btn-default" onclick="$('#twofactorkeycontainer').hide(); $('#twofactorqrcontainer').show();">QR</button>
@endforeach </div>
</div> </div>
@if(!$errors->has('lockout')) <script>$("#twofactorqr").qrcode({"text": "{!! $uri !!}"});</script>
<input type="text" </div>
name="twofactor" @endif
id="twofactor" <div class="row">
class="form-control" <div class="col-md-12">
autocomplete="off" <form class="form-horizontal" role="form" action="{{ route('2fa.verify') }}" method="post" name="twofactorform">
aria-describedby="twoFactorErrors" {{ csrf_field() }}
placeholder="@lang('Please enter auth token')" <div class="form-group">
required autofocus> <div class="col-md-8 col-md-offset-2">
@endif <div id="twoFactorErrors" class="help-block">
@foreach($errors->all() as $error)
<strong>{{ $error }}</strong>
@endforeach
</div> </div>
</div>
<div class="form-group">
@if(!$errors->has('lockout')) @if(!$errors->has('lockout'))
<div class="col-md-12" style="margin:8px"> <input type="text"
<button type="submit" class="btn btn-primary btn-block" name="submit"> name="twofactor"
<i class="fa fa-btn fa-sign-in"></i> @lang('Submit') id="twofactor"
</button> class="form-control"
</div> autocomplete="off"
@endif aria-describedby="twoFactorErrors"
@if(!$errors->isEmpty()) placeholder="@lang('Please enter auth token')"
<div class="col-md-12" style="margin:8px"> required autofocus>
<button type="submit" class="btn btn-default btn-block" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
<i class="fa fa-btn fa-sign-out" aria-hidden="true"></i>
@lang('Logout')
</button>
</div>
@endif
@if(session('twofactoradd'))
<div class="col-md-12" style="margin:8px">
<button type="submit" class="btn btn-danger btn-block" onclick="event.preventDefault(); document.getElementById('cancel-form').submit();">
<i class="fa fa-btn fa-sign-out" aria-hidden="true"></i>
@lang('Cancel')
</button>
</div>
@endif @endif
</div> </div>
</form> </div>
</div> <div class="form-group">
@if(!$errors->has('lockout'))
<div class="col-md-12" style="margin:8px">
<button type="submit" class="btn btn-primary btn-block" name="submit">
<i class="fa fa-btn fa-sign-in"></i> @lang('Submit')
</button>
</div>
@endif
@if(!$errors->isEmpty())
<div class="col-md-12" style="margin:8px">
<button type="submit" class="btn btn-default btn-block" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
<i class="fa fa-btn fa-sign-out" aria-hidden="true"></i>
@lang('Logout')
</button>
</div>
@endif
@if(session('twofactoradd'))
<div class="col-md-12" style="margin:8px">
<button type="submit" class="btn btn-danger btn-block" onclick="event.preventDefault(); document.getElementById('cancel-form').submit();">
<i class="fa fa-btn fa-sign-out" aria-hidden="true"></i>
@lang('Cancel')
</button>
</div>
@endif
</div>
</form>
</div> </div>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;"> </div>
{{ csrf_field() }} <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
</form> {{ csrf_field() }}
<form id="cancel-form" action="{{ route('2fa.cancel') }}" method="POST" style="display: none;"> </form>
{{ csrf_field() }} <form id="cancel-form" action="{{ route('2fa.cancel') }}" method="POST" style="display: none;">
</form> {{ csrf_field() }}
</div> </form>
</div> </div>
</div> </x-panel>
</div>
</div> </div>
</div> </div>
@endsection @endsection

View File

@@ -1,53 +1,53 @@
<div class="panel panel-default"> <x-panel footer-class="text-center">
<div class="panel-heading"> <x-slot name="title">
<h3 class="panel-title center-block"> <img class="logon-logo img-responsive" src="{{ asset(\LibreNMS\Config::get('title_image', 'images/librenms_logo_light.svg')) }}">
<img class="logon-logo img-responsive" src="{{ asset(\LibreNMS\Config::get('title_image', 'images/librenms_logo_light.svg')) }}"> </x-slot>
</h3>
</div>
<div class="panel-body">
<div class="container-fluid">
<form class="form-horizontal" role="form" action="{{ url('login') }}" method="post" name="logonform">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
<div class="col-md-12">
<input type="text" name="username" id="username" value="{{ old('username') }}" class="form-control" placeholder="@lang('Username')" required autofocus />
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('username') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<div class="col-md-12">
<input type="password" name="password" id="password" class="form-control" placeholder="@lang('Password')" />
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<div class="checkbox">
<label>
<input type="checkbox" name="remember" id="remember" /> @lang('Remember Me')
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<button type="submit" id="login" class="btn btn-primary btn-block" name="submit">
<i class="fa fa-btn fa-sign-in"></i> @lang('Login')
</button>
</div>
</div>
</form>
</div>
</div>
@config('login_message') @config('login_message')
<div class="panel-footer" align="center">{{ \LibreNMS\Config::get('login_message') }}</div> <x-slot name="footer">
{{ \LibreNMS\Config::get('login_message') }}
</x-slot>
@endconfig @endconfig
</div>
<div class="container-fluid">
<form class="form-horizontal" role="form" action="{{ url('login') }}" method="post" name="logonform">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
<div class="col-md-12">
<input type="text" name="username" id="username" value="{{ old('username') }}" class="form-control" placeholder="@lang('Username')" required autofocus />
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('username') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<div class="col-md-12">
<input type="password" name="password" id="password" class="form-control" placeholder="@lang('Password')" />
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<div class="checkbox">
<label>
<input type="checkbox" name="remember" id="remember" /> @lang('Remember Me')
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<button type="submit" id="login" class="btn btn-primary btn-block" name="submit">
<i class="fa fa-btn fa-sign-in"></i> @lang('Login')
</button>
</div>
</div>
</form>
</div>
</x-panel>

View File

@@ -15,7 +15,7 @@
<button class="btn btn-default pull-right" type="submit" id="ToggleLogon">@lang('Logon')</button> <button class="btn btn-default pull-right" type="submit" id="ToggleLogon">@lang('Logon')</button>
</div> </div>
</div> </div>
<div class="panel panel-default panel-condensed"> <x-panel>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-condensed"> <table class="table table-condensed">
<tr> <tr>
@@ -37,7 +37,7 @@
@endforeach @endforeach
</table> </table>
</div> </div>
</div> </x-panel>
</div> </div>
<div id="public-logon" style="display:none;"> <div id="public-logon" style="display:none;">

View File

@@ -1,10 +1,27 @@
<div {{ $attributes->merge(['class' => 'panel panel-default']) }}> <div {{ $attributes->merge(['class' => 'panel panel-default']) }}>
@isset($title) @if (isset($heading))
<div class="panel-heading">
{{ $heading }}
</div>
@elseif (isset($title))
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">{{ $title }}</h3> <h3 class="panel-title">{{ $title }}</h3>
</div> </div>
@endisset @endif
<div class="panel-body">
@if (isset($slot) && !empty($slot->toHtml()))
<div class="panel-body {{ $body_class }}">
{{ $slot }} {{ $slot }}
</div> </div>
@endif
@isset($table)
{{ $table }}
@endisset
@isset($footer)
<div class="panel-footer {{ $footer_class }}">
{{ $footer }}
</div>
@endisset
</div> </div>

View File

@@ -4,93 +4,84 @@
@section('content') @section('content')
<div class="container-fluid"> <div class="container-fluid">
<div id="manage-device-groups-panel" class="panel panel-default"> <x-panel id="manage-device-groups-panel">
<div class="panel-heading"> <x-slot name="title">
<h4 class="panel-title"> <i class="fa fa-th fa-fw fa-lg" aria-hidden="true"></i> @lang('Device Groups')
<i class="fa fa-th fa-fw fa-lg" aria-hidden="true"></i> @lang('Device Groups') </x-slot>
</h4>
</div> <div class="row">
<div class="panel-body"> <div class="col-md-12">
<div class="row"> <a type="button" class="btn btn-primary" href="{{ route('device-groups.create') }}">
<div class="col-md-12"> <i class="fa fa-plus"></i> @lang('New Device Group')
<a type="button" class="btn btn-primary" href="{{ route('device-groups.create') }}"> </a>
<i class="fa fa-plus"></i> @lang('New Device Group')
</a>
</div>
</div> </div>
<div class="table-responsive"> </div>
<table id="manage-device-groups-table" class="table table-condensed table-hover"> <div class="table-responsive">
<thead> <table id="manage-device-groups-table" class="table table-condensed table-hover">
<tr> <thead>
<th>@lang('Name')</th> <tr>
<th>@lang('Description')</th> <th>@lang('Name')</th>
<th>@lang('Type')</th> <th>@lang('Description')</th>
<th>@lang('Devices')</th> <th>@lang('Type')</th>
<th>@lang('Pattern')</th> <th>@lang('Devices')</th>
<th>@lang('Actions')</th> <th>@lang('Pattern')</th>
<th>@lang('Actions')</th>
</tr>
</thead>
<tbody>
@foreach($device_groups as $device_group)
<tr id="row_{{ $device_group->id }}">
<td>{{ $device_group->name }}</td>
<td>{{ $device_group->desc }}</td>
<td>{{ __(ucfirst($device_group->type)) }}</td>
<td>
<a href="{{ url("/devices/group=$device_group->id") }}">{{ $device_group->devices_count }}</a>
</td>
<td>{{ $device_group->type == 'dynamic' ? $device_group->getParser()->toSql(false) : '' }}</td>
<td>
<button type="button" title="@lang('Rediscover all Devices of Device Group')" class="btn btn-warning btn-sm" aria-label="@lang('Rediscover Group')"
onclick="discover_dg(this, '{{ $device_group->id }}')">
<i
class="fa fa-retweet" aria-hidden="true"></i></button>
<a type="button" title="@lang('edit Device Group')" class="btn btn-primary btn-sm" aria-label="@lang('Edit')"
href="{{ route('device-groups.edit', $device_group->id) }}">
<i class="fa fa-pencil" aria-hidden="true"></i></a>
<button type="button" class="btn btn-danger btn-sm" title="@lang('delete Device Group')" aria-label="@lang('Delete')"
onclick="delete_dg(this, '{{ $device_group->name }}', '{{ route('device-groups.destroy', $device_group->id) }}')">
<i
class="fa fa-trash" aria-hidden="true"></i></button>
</td>
</tr> </tr>
</thead> @endforeach
<tbody> </tbody>
@foreach($device_groups as $device_group) </table>
<tr id="row_{{ $device_group->id }}">
<td>{{ $device_group->name }}</td>
<td>{{ $device_group->desc }}</td>
<td>{{ __(ucfirst($device_group->type)) }}</td>
<td>
<a href="{{ url("/devices/group=$device_group->id") }}">{{ $device_group->devices_count }}</a>
</td>
<td>{{ $device_group->type == 'dynamic' ? $device_group->getParser()->toSql(false) : '' }}</td>
<td>
<button type="button" title="@lang('Rediscover all Devices of Device Group')" class="btn btn-warning btn-sm" aria-label="@lang('Rediscover Group')"
onclick="discover_dg(this, '{{ $device_group->id }}')">
<i
class="fa fa-retweet" aria-hidden="true"></i></button>
<a type="button" title="@lang('edit Device Group')" class="btn btn-primary btn-sm" aria-label="@lang('Edit')"
href="{{ route('device-groups.edit', $device_group->id) }}">
<i class="fa fa-pencil" aria-hidden="true"></i></a>
<button type="button" class="btn btn-danger btn-sm" title="@lang('delete Device Group')" aria-label="@lang('Delete')"
onclick="delete_dg(this, '{{ $device_group->name }}', '{{ route('device-groups.destroy', $device_group->id) }}')">
<i
class="fa fa-trash" aria-hidden="true"></i></button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div> </div>
</div> </x-panel>
<div id="unmanaged-devices-panel" class="panel panel-default">
<div class="panel-heading"> <x-panel id="unmanaged-devices-panel" title="{{ __('Ungrouped Devices') }} ({{ $ungrouped_devices->count() }})">
<h4 class="panel-title"> <div class="table-responsive">
@lang('Ungrouped Devices') ({{ $ungrouped_devices->count() }}) <table id="ungrouped-devices-table" class="table table-condensed table-hover">
</h4> <thead>
</div> <tr>
<div class="panel-body"> <th style="width:32px">@lang('Vendor')</th>
<div class="table-responsive"> <th>@lang('Device')</th>
<table id="ungrouped-devices-table" class="table table-condensed table-hover"> <th>@lang('Platform')</th>
<thead> <th>@lang('Operating System')</th>
<tr> </tr>
<th style="width:32px">@lang('Vendor')</th> </thead>
<th>@lang('Device')</th> <tbody>
<th>@lang('Platform')</th> @foreach($ungrouped_devices as $device)
<th>@lang('Operating System')</th> <tr id="row_{{ $device->device_id }}">
<td><img alt="{{ $device->os }}" src="{{ asset($device->icon) }}" width="32px" height="32px" title="{{ $device->os }}"></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> </tr>
</thead> @endforeach
<tbody> </tbody>
@foreach($ungrouped_devices as $device) </table>
<tr id="row_{{ $device->device_id }}">
<td><img alt="{{ $device->os }}" src="{{ asset($device->icon) }}" width="32px" height="32px" title="{{ $device->os }}"></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>
@endforeach
</tbody>
</table>
</div>
</div> </div>
</div> </x-panel>
</div> </div>
@endsection @endsection

View File

@@ -1,24 +1,22 @@
<div class="panel panel-default"> <x-panel body-class="{{ $alert_class }}">
<div class="panel-body {{ $alert_class }}"> <img src="{{ url($device->logo()) }}" title="{{ $device->logo() }}" class="device-icon-header pull-left" style="max-height: 100px">
<img src="{{ url($device->logo()) }}" title="{{ $device->logo() }}" class="device-icon-header pull-left" style="max-height: 100px"> <div class="pull-left" style="margin-top: 5px;">
<div class="pull-left" style="margin-top: 5px;"> @if($parent_id)
@if($parent_id) <a href="{{ route('device', $parent_id) }}" title="@lang('VM Host')"><i class="fa fa-server fa-fw fa-lg"></i></a>
<a href="{{ route('device', $parent_id) }}" title="@lang('VM Host')"><i class="fa fa-server fa-fw fa-lg"></i></a> @endif
@endif @if($device->isUnderMaintenance())
@if($device->isUnderMaintenance()) <span title="@lang('Scheduled Maintenance')" class="fa fa-wrench fa-fw fa-lg"></span>
<span title="@lang('Scheduled Maintenance')" class="fa fa-wrench fa-fw fa-lg"></span> @endif
@endif <span style="font-size: 20px;">@deviceLink($device)</span><br/>
<span style="font-size: 20px;">@deviceLink($device)</span><br/> <a href="{{ url('/devices/location=' . $device->location) }}">{{ $device->location }}</a>
<a href="{{ url('/devices/location=' . $device->location) }}">{{ $device->location }}</a>
</div>
<div class="pull-right">
@foreach($overview_graphs as $graph)
<div style='float: right; text-align: center; padding: 1px 5px; margin: 0 1px; ' class='rounded-5px'>
<div style="width: {{ $graph['width'] }}px; height: {{ $graph['height'] }}px;">{!! \LibreNMS\Util\Url::graphPopup($graph) !!}</div>
<div style='font-weight: bold; font-size: 7pt; margin: -3px;'>{{ $graph['popup_title'] }}</div>
</div>
@endforeach
<br style="clear: both;"/>
</div>
</div> </div>
</div> <div class="pull-right">
@foreach($overview_graphs as $graph)
<div style='float: right; text-align: center; padding: 1px 5px; margin: 0 1px; ' class='rounded-5px'>
<div style="width: {{ $graph['width'] }}px; height: {{ $graph['height'] }}px;">{!! \LibreNMS\Util\Url::graphPopup($graph) !!}</div>
<div style='font-weight: bold; font-size: 7pt; margin: -3px;'>{{ $graph['popup_title'] }}</div>
</div>
@endforeach
<br style="clear: both;"/>
</div>
</x-panel>

View File

@@ -1,82 +1,80 @@
@extends('device.index') @extends('device.index')
@section('tab') @section('tab')
@if($data['smokeping']->hasGraphs()) @if(!$data['smokeping']->hasGraphs())
<div class="panel with-nav-tabs panel-default"> <x-panel class="with-nav-tabs">
<div class="panel-heading"> <x-slot name="heading">
<a href="{{ \LibreNMS\Config::get('smokeping.url') }}?target={{ $device->type }}.{{ str_replace('.','_',$device->hostname) }}" target="_blank"><span class="panel-title">@lang('Smokeping') <i class="glyphicon glyphicon-share-alt"></i></span></a> <a href="{{ \LibreNMS\Config::get('smokeping.url') }}?target={{ $device->type }}.{{ str_replace('.','_',$device->hostname) }}" target="_blank"><span class="panel-title">@lang('Smokeping') <i class="glyphicon glyphicon-share-alt"></i></span></a>
<ul class="nav nav-tabs" style="display: inline-block"> <ul class="nav nav-tabs" style="display: inline-block">
@foreach($data['smokeping_tabs'] as $tab) @foreach($data['smokeping_tabs'] as $tab)
<li @if($loop->first) class="active" @endif><a href="#{{ $tab }}" data-toggle="tab">@lang('smokeping.' . $tab)</a></li> <li @if($loop->first) class="active" @endif><a href="#{{ $tab }}" data-toggle="tab">@lang('smokeping.' . $tab)</a></li>
@endforeach @endforeach
</ul> </ul>
</div> </x-slot>
<div class="panel-body">
<div class="tab-content"> <div class="tab-content">
@foreach($data['smokeping_tabs'] as $direction) @foreach($data['smokeping_tabs'] as $direction)
<div class="tab-pane fade in @if($loop->first) active @endif" id="{{ $direction }}"> <div class="tab-pane fade in @if($loop->first) active @endif" id="{{ $direction }}">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h3>Average</h3> <h3>Average</h3>
</div>
</div> </div>
<div class="row"> </div>
@foreach(\LibreNMS\Util\Html::graphRow(['type' => "device_smokeping_{$direction}_all_avg", 'device' => $device->device_id]) as $graph) <div class="row">
<div class='col-md-3'>{!! $graph !!}</div> @foreach(\LibreNMS\Util\Html::graphRow(['type' => "device_smokeping_{$direction}_all_avg", 'device' => $device->device_id]) as $graph)
@endforeach <div class='col-md-3'>{!! $graph !!}</div>
</div>
<div class="row">
<div class="col-md-12">
<h3>Aggregate</h3>
</div>
</div>
<div class="row">
@foreach(\LibreNMS\Util\Html::graphRow(['type' => "device_smokeping_{$direction}_all", 'device' => $device->device_id, 'legend' => 'no']) as $graph)
<div class='col-md-3'>{!! $graph !!}</div>
@endforeach
</div>
@foreach($data['smokeping']->otherGraphs($direction) as $info)
<div class="row">
<div class="col-md-12">
<h3>@deviceLink($info['device'])</h3>
</div>
</div>
<div class="row">
@foreach(\LibreNMS\Util\Html::graphRow($info['graph']) as $graph)
<div class='col-md-3'>{!! $graph !!}</div>
@endforeach
</div>
@endforeach @endforeach
</div> </div>
@endforeach <div class="row">
</div> <div class="col-md-12">
<h3>Aggregate</h3>
</div>
</div>
<div class="row">
@foreach(\LibreNMS\Util\Html::graphRow(['type' => "device_smokeping_{$direction}_all", 'device' => $device->device_id, 'legend' => 'no']) as $graph)
<div class='col-md-3'>{!! $graph !!}</div>
@endforeach
</div>
@foreach($data['smokeping']->otherGraphs($direction) as $info)
<div class="row">
<div class="col-md-12">
<h3>@deviceLink($info['device'])</h3>
</div>
</div>
<div class="row">
@foreach(\LibreNMS\Util\Html::graphRow($info['graph']) as $graph)
<div class='col-md-3'>{!! $graph !!}</div>
@endforeach
</div>
@endforeach
</div>
@endforeach
</div> </div>
</div> </x-panel>
@endif @endif
<div class="panel panel-default"> <x-panel title="{{ __('Performance') }}">
<div class="panel-heading"> <x-slot name="heading">
<span class="panel-title" style="line-height: 34px">@lang('Performance')</span> <span class="panel-title" style="line-height: 34px">@lang('Performance')</span>
<span class="pull-right"> <span class="pull-right">
<form method="post" role="form" id="map" class="form-inline"> <form method="post" role="form" id="map" class="form-inline">
@csrf @csrf
<div class="form-group"> <div class="form-group">
<label for="dtpickerfrom">@lang('From')</label> <label for="dtpickerfrom">@lang('From')</label>
<input type="text" class="form-control" id="dtpickerfrom" name="dtpickerfrom" maxlength="16" <input type="text" class="form-control" id="dtpickerfrom" name="dtpickerfrom" maxlength="16"
value="{{ $data['dtpickerfrom'] }}" data-date-format="YYYY-MM-DD HH:mm"> value="{{ $data['dtpickerfrom'] }}" data-date-format="YYYY-MM-DD HH:mm">
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="dtpickerto">@lang('To')</label> <label for="dtpickerto">@lang('To')</label>
<input type="text" class="form-control" id="dtpickerto" name="dtpickerto" maxlength=16 <input type="text" class="form-control" id="dtpickerto" name="dtpickerto" maxlength=16
value="{{ $data['dtpickerto'] }} " data-date-format="YYYY-MM-DD HH:mm"> value="{{ $data['dtpickerto'] }} " data-date-format="YYYY-MM-DD HH:mm">
</div> </div>
<input type="submit" class="btn btn-default" id="submit" value="Update"> <input type="submit" class="btn btn-default" id="submit" value="Update">
</form> </form>
</span> </span>
</div> </x-slot>
<div class="panel-body">
<div id="performance"></div> <div id="performance"></div>
</div> </x-panel>
</div>
@endsection @endsection
@section('javascript') @section('javascript')

View File

@@ -16,28 +16,24 @@
</tr> </tr>
</script> </script>
<x-panel title="{{ __('Locations') }}" id="locations-panel">
<div id="locations-panel" class="panel panel-default"> <div class="table-responsive">
<div class="panel-heading"><h4 class="panel-title">@lang('Locations')</h4></div> <table id="locations" class="table table-hover table-condensed table-striped">
<div class="panel-body"> <thead>
<div class="table-responsive"> <tr>
<table id="locations" class="table table-hover table-condensed table-striped"> <th data-column-id="location" data-formatter="location" data-order="asc">@lang('Location')</th>
<thead> <th data-column-id="coordinates" data-formatter="coordinates" data-sortable="false">@lang('Coordinates')</th>
<tr> <th data-column-id="devices" data-formatter="primaryLabel">@lang('Devices')</th>
<th data-column-id="location" data-formatter="location" data-order="asc">@lang('Location')</th> <th data-column-id="network" data-formatter="defaultLabel">@lang('Network')</th>
<th data-column-id="coordinates" data-formatter="coordinates" data-sortable="false">@lang('Coordinates')</th> <th data-column-id="servers" data-formatter="defaultLabel">@lang('Servers')</th>
<th data-column-id="devices" data-formatter="primaryLabel">@lang('Devices')</th> <th data-column-id="firewalls" data-formatter="defaultLabel">@lang('Firewalls')</th>
<th data-column-id="network" data-formatter="defaultLabel">@lang('Network')</th> <th data-column-id="down" data-formatter="down">@lang('Down')</th>
<th data-column-id="servers" data-formatter="defaultLabel">@lang('Servers')</th> <th data-column-id="actions" data-formatter="actions" data-sortable="false">@lang('Actions')</th>
<th data-column-id="firewalls" data-formatter="defaultLabel">@lang('Firewalls')</th> </tr>
<th data-column-id="down" data-formatter="down">@lang('Down')</th> </thead>
<th data-column-id="actions" data-formatter="actions" data-sortable="false">@lang('Actions')</th> </table>
</tr>
</thead>
</table>
</div>
</div> </div>
</div> </x-panel>
<div class="modal fade" id="edit-location" tabindex="-1" role="dialog" aria-labelledby="edit-location-title"> <div class="modal fade" id="edit-location" tabindex="-1" role="dialog" aria-labelledby="edit-location-title">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">

View File

@@ -95,20 +95,19 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="panel panel-default panel-condensed"> <x-panel title="{{ __('Syslog entries') }}">
<div class="panel-heading"> <x-slot name="table">
<strong>@lang('Syslog entries')</strong> <table class="table table-hover table-condensed table-striped">
</div> @foreach ($syslog as $entry)
<table class="table table-hover table-condensed table-striped"> <tr>
@foreach ($syslog as $entry) <td>{{ $entry->date }}</td>
<tr> <td><strong>{!! \LibreNMS\Util\Url::deviceLink($entry->device) !!}</strong></td>
<td>{{ $entry->date }}</td> <td><strong>{{ $entry->program }} : </strong> {{ $entry->msg }}</td>
<td><strong>{!! \LibreNMS\Util\Url::deviceLink($entry->device) !!}</strong></td> </tr>
<td><strong>{{ $entry->program }} : </strong> {{ $entry->msg }}</td> @endforeach
</tr> </table>
@endforeach </x-slot>
</table> </x-panel>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -6,23 +6,14 @@
@parent @parent
<div class="panel panel-default"> <x-panel title="{{ __('Total Poller Time') }}">
<div class="panel-heading"> <?php \LibreNMS\Util\Html::graphRow(['type' => 'global_poller_perf',
<h3 class="panel-title">Total Poller Time</h3> 'legend' => 'yes', 'height' => 100], true); ?>
</div> </x-panel>
<div class="panel-body">
<?php \LibreNMS\Util\Html::graphRow(['type' => 'global_poller_perf', <x-panel title="{{ __('Total Poller Time Per Module') }}">
'legend' => 'yes', 'height' => 100], true); ?> <?php \LibreNMS\Util\Html::graphRow(['type' => 'global_poller_modules_perf',
</div> 'legend' => 'yes', 'height' => 100], true); ?>
</div> </x-panel>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Total Poller Time Per Module</h3>
</div>
<div class="panel-body">
<?php \LibreNMS\Util\Html::graphRow(['type' => 'global_poller_modules_perf',
'legend' => 'yes', 'height' => 100], true); ?>
</div>
</div>
@endsection @endsection

View File

@@ -7,87 +7,77 @@
@parent @parent
@if( $pollers->isNotEmpty() ) @if( $pollers->isNotEmpty() )
<div class="panel panel-default"> <x-panel title="{{ __('Standard Pollers') }}">
<div class="panel-heading"> <div class="table-responsive">
<h3 class="panel-title">@lang('Standard Pollers')</h3> <table class="table table-striped table-bordered table-hover table-condensed">
<tr>
<th>@lang('Poller Name')</th>
<th>@lang('Devices Polled')</th>
<th>@lang('Total Poll Time')</th>
<th>@lang('Last Run')</th>
<th>@lang('Actions')</th>
</tr>
@foreach($pollers as $poller)
<tr class="{{ $poller['row_class'] }}" id="row_{{ $poller['id'] }}">
<td>{{ $poller['poller_name'] }}</td>
<td>{{ $poller['devices'] }}</td>
<td>{{ $poller['time_taken'] }} Seconds</td>
<td>{{ $poller['last_polled'] }}</td>
<td>@if( $poller['long_not_polled'] )<button type='button' class='btn btn-danger btn-sm' aria-label=@lang('Delete') data-toggle='modal' data-target='#confirm-delete' data-id='{{ $poller['id'] }}' data-pollertype='delete-poller' name='delete-poller'><i class='fa fa-trash' aria-hidden='true'></i></button>@endif</td>
</tr>
@endforeach
</table>
</div> </div>
<div class="panel-body"> </x-panel>
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<tr>
<th>@lang('Poller Name')</th>
<th>@lang('Devices Polled')</th>
<th>@lang('Total Poll Time')</th>
<th>@lang('Last Run')</th>
<th>@lang('Actions')</th>
</tr>
@foreach($pollers as $poller)
<tr class="{{ $poller['row_class'] }}" id="row_{{ $poller['id'] }}">
<td>{{ $poller['poller_name'] }}</td>
<td>{{ $poller['devices'] }}</td>
<td>{{ $poller['time_taken'] }} Seconds</td>
<td>{{ $poller['last_polled'] }}</td>
<td>@if( $poller['long_not_polled'] )<button type='button' class='btn btn-danger btn-sm' aria-label=@lang('Delete') data-toggle='modal' data-target='#confirm-delete' data-id='{{ $poller['id'] }}' data-pollertype='delete-poller' name='delete-poller'><i class='fa fa-trash' aria-hidden='true'></i></button>@endif</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
@endif @endif
@if( $poller_cluster->isNotEmpty() ) @if( $poller_cluster->isNotEmpty() )
<div class="panel panel-default"> <x-panel title="{{ __('Poller Cluster Health') }}">
<div class="panel-heading"> <div class="table-responsive">
<h3 class="panel-title">@lang('Poller Cluster Health')</h3> <table class="table table-striped table-bordered table-condensed">
</div> <tr>
<div class="panel-body"> <th>@lang('Name')</th>
<div class="table-responsive"> <th>@lang('Node ID')</th>
<table class="table table-striped table-bordered table-condensed"> <th>@lang('Version')</th>
<tr> <th>@lang('Groups Served')</th>
<th>@lang('Name')</th> <th>@lang('Last Checkin')</th>
<th>@lang('Node ID')</th> <th>@lang('Cluster Master')</th>
<th>@lang('Version')</th> <th>@lang('Job')</th>
<th>@lang('Groups Served')</th> <th>@lang('Workers')</th>
<th>@lang('Last Checkin')</th> <th>@lang('Devices Actioned')<br><small>@lang('Last Interval')</small></th>
<th>@lang('Cluster Master')</th> <th>@lang('Devices Pending')</th>
<th>@lang('Job')</th> <th>@lang('Worker Seconds')<br><small>@lang('Consumed/Maximum')</small></th>
<th>@lang('Workers')</th> <th>@lang('Actions')</th>
<th>@lang('Devices Actioned')<br><small>@lang('Last Interval')</small></th> </tr>
<th>@lang('Devices Pending')</th> @foreach($poller_cluster as $poller)
<th>@lang('Worker Seconds')<br><small>@lang('Consumed/Maximum')</small></th> @foreach($poller->stats as $stat)
<th>@lang('Actions')</th> <tr class="{{ $poller['row_class'] }}" id="row_{{ $poller->id }}">
@if( $loop->first )
<td rowspan="{{ $poller->stats->count() }}">{{ $poller->poller_name }}</td>
<td rowspan="{{ $poller->stats->count() }}" @if($poller->node_id == '') class="danger" @endif>{{ $poller->node_id }}</td>
<td rowspan="{{ $poller->stats->count() }}">{{ $poller->poller_version }}</td>
<td rowspan="{{ $poller->stats->count() }}">{{ $poller->poller_groups }}</td>
<td rowspan="{{ $poller->stats->count() }}">{{ $poller->last_report }}</td>
<td rowspan="{{ $poller->stats->count() }}">@lang($poller->master ? 'Yes' : 'No')</td>
@endif
<td>{{ $stat->poller_type }}</td>
<td>{{ $stat->workers }}</td>
<td>{{ $stat->devices }}</td>
<td>{{ $stat->depth }}</td>
<td>{{ $stat->worker_seconds }} / {{ $stat->frequency * $stat->workers }}</td>
@if( $loop->first )
<td rowspan="{{ $poller->stats->count() }}">@if($poller->long_not_polled)<button type='button' class='btn btn-danger btn-sm' aria-label=@lang('Delete') data-toggle='modal' data-target='#confirm-delete' data-id='{{ $poller->id }}' data-pollertype='delete-cluster-poller' name='delete-cluster-poller'><i class='fa fa-trash' aria-hidden='true'></i></button>@endif</td>
@endif
</tr> </tr>
@foreach($poller_cluster as $poller)
@foreach($poller->stats as $stat)
<tr class="{{ $poller['row_class'] }}" id="row_{{ $poller->id }}">
@if( $loop->first )
<td rowspan="{{ $poller->stats->count() }}">{{ $poller->poller_name }}</td>
<td rowspan="{{ $poller->stats->count() }}" @if($poller->node_id == '') class="danger" @endif>{{ $poller->node_id }}</td>
<td rowspan="{{ $poller->stats->count() }}">{{ $poller->poller_version }}</td>
<td rowspan="{{ $poller->stats->count() }}">{{ $poller->poller_groups }}</td>
<td rowspan="{{ $poller->stats->count() }}">{{ $poller->last_report }}</td>
<td rowspan="{{ $poller->stats->count() }}">@lang($poller->master ? 'Yes' : 'No')</td>
@endif
<td>{{ $stat->poller_type }}</td>
<td>{{ $stat->workers }}</td>
<td>{{ $stat->devices }}</td>
<td>{{ $stat->depth }}</td>
<td>{{ $stat->worker_seconds }} / {{ $stat->frequency * $stat->workers }}</td>
@if( $loop->first )
<td rowspan="{{ $poller->stats->count() }}">@if($poller->long_not_polled)<button type='button' class='btn btn-danger btn-sm' aria-label=@lang('Delete') data-toggle='modal' data-target='#confirm-delete' data-id='{{ $poller->id }}' data-pollertype='delete-cluster-poller' name='delete-cluster-poller'><i class='fa fa-trash' aria-hidden='true'></i></button>@endif</td>
@endif
</tr>
@endforeach
@endforeach @endforeach
</table> @endforeach
<small> </table>
Worker seconds indicates the maximum polling throughput a node can achieve in perfect conditions. If the consumed is close to the maximum, consider adding more threads, or better tuning your groups.<br> <small>
If there are devices pending but consumed worker seconds is low, your hardware is not sufficient for the number of devices and the poller cannot reach maximum throughput. Worker seconds indicates the maximum polling throughput a node can achieve in perfect conditions. If the consumed is close to the maximum, consider adding more threads, or better tuning your groups.<br>
</small> If there are devices pending but consumed worker seconds is low, your hardware is not sufficient for the number of devices and the poller cannot reach maximum throughput.
</div> </small>
</div> </div>
</div> </x-panel>
@endif @endif
@if(auth()->user()->isAdmin()) @if(auth()->user()->isAdmin())

View File

@@ -4,36 +4,36 @@
@section('content') @section('content')
<div class="container-fluid"> <div class="container-fluid">
<div id="manage-authlog-panel" class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-user-circle-o fa-fw fa-lg" aria-hidden="true"></i> @lang('Authlog')</h4> <x-panel id="manage-authlog-panel">
</div> <x-slot name="title">
<div class="panel-body"> <i class="fa fa-user-circle-o fa-fw fa-lg" aria-hidden="true"></i> @lang('Authlog')
<div class="table-responsive"> </x-slot>
<table id="authlog" class="table table-hover table-condensed table-striped" style="display: none;">
<thead> <div class="table-responsive">
<table id="authlog" class="table table-hover table-condensed table-striped" style="display: none;">
<thead>
<tr>
<th data-column-id='timestamp'>@lang('Timestamp')</th>
<th data-column-id='user'>@lang('User')</th>
<th data-column-id='ip'>@lang('IP Address')</th>
<th data-column-id='authres'>@lang('Result')</th>
</tr>
</thead>
<tbody id="authlog_rows">
@foreach($authlog as $log)
<tr> <tr>
<th data-column-id='timestamp'>@lang('Timestamp')</th> <td>{{ $log->datetime }}</td>
<th data-column-id='user'>@lang('User')</th> <td>{{ $log->user }}</td>
<th data-column-id='ip'>@lang('IP Address')</th> <td>{{ $log->address }}</td>
<th data-column-id='authres'>@lang('Result')</th> <td>{{ $log->result }}</td>
</tr> </tr>
</thead> @endforeach
<tbody id="authlog_rows"> </tbody>
@foreach($authlog as $log) </table>
<tr>
<td>{{ $log->datetime }}</td>
<td>{{ $log->user }}</td>
<td>{{ $log->address }}</td>
<td>{{ $log->result }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div> </div>
</div> </x-panel>
@endsection @endsection
@section('scripts') @section('scripts')

View File

@@ -15,12 +15,7 @@
@config('twofactor') @config('twofactor')
<br/> <br/>
<div class="panel panel-default col-sm-offset-3"> <x-panel title="{{ __('Two-Factor Authentication') }}" class="col-sm-offset-3">
<div class="panel-heading">
<h3 class="panel-title">Two-Factor Authentication</h3>
</div>
<div class="panel-body">
@if($twofactor_enabled) @if($twofactor_enabled)
@if($twofactor_locked) @if($twofactor_locked)
<div class="form-group" id="twofactor-unlock-form"> <div class="form-group" id="twofactor-unlock-form">
@@ -34,8 +29,7 @@
@else @else
<p>@lang('No TwoFactor key generated for this user, Nothing to do.')</p> <p>@lang('No TwoFactor key generated for this user, Nothing to do.')</p>
@endif @endif
</div> </x-panel>
</div>
@endconfig @endconfig
<div class="form-group"> <div class="form-group">

View File

@@ -4,47 +4,48 @@
@section('content') @section('content')
<div class="container-fluid"> <div class="container-fluid">
<div id="manage-users-panel" class="panel panel-default"> <x-panel>
<div class="panel-heading"><h4 class="panel-title"><i class="fa fa-user-circle-o fa-fw fa-lg" aria-hidden="true"></i> @lang('Manage Users')</h4></div> <x-slot name="title">
<div class="panel-body"> <i class="fa fa-user-circle-o fa-fw fa-lg" aria-hidden="true"></i> @lang('Manage Users')
<div class="table-responsive"> </x-slot>
<table id="users" class="table table-bordered table-condensed" style="display: none;">
<thead> <div class="table-responsive">
<tr> <table id="users" class="table table-bordered table-condensed" style="display: none;">
<th data-column-id="user_id" data-visible="false" data-identifier="true" data-type="numeric">@lang('ID')</th> <thead>
<th data-column-id="username">@lang('Username')</th> <tr>
<th data-column-id="realname">@lang('Real Name')</th> <th data-column-id="user_id" data-visible="false" data-identifier="true" data-type="numeric">@lang('ID')</th>
<th data-column-id="level" data-formatter="level" data-type="numeric">@lang('Access')</th> <th data-column-id="username">@lang('Username')</th>
<th data-column-id="auth_type" data-visible="{{ $multiauth ? 'true' : 'false' }}">@lang('auth.title')</th> <th data-column-id="realname">@lang('Real Name')</th>
<th data-column-id="email">@lang('Email')</th> <th data-column-id="level" data-formatter="level" data-type="numeric">@lang('Access')</th>
@if(\LibreNMS\Authentication\LegacyAuth::getType() == 'mysql') <th data-column-id="auth_type" data-visible="{{ $multiauth ? 'true' : 'false' }}">@lang('auth.title')</th>
<th data-column-id="enabled" data-formatter="enabled">@lang('Enabled')</th> <th data-column-id="email">@lang('Email')</th>
@endif @if(\LibreNMS\Authentication\LegacyAuth::getType() == 'mysql')
<th data-column-id="descr">@lang('Description')</th> <th data-column-id="enabled" data-formatter="enabled">@lang('Enabled')</th>
<th data-column-id="action" data-formatter="actions" data-sortable="false" data-searchable="false">@lang('Actions')</th> @endif
</tr> <th data-column-id="descr">@lang('Description')</th>
</thead> <th data-column-id="action" data-formatter="actions" data-sortable="false" data-searchable="false">@lang('Actions')</th>
<tbody id="users_rows"> </tr>
@foreach($users as $user) </thead>
<tr> <tbody id="users_rows">
<td>{{ $user->user_id }}</td> @foreach($users as $user)
<td>{{ $user->username }}</td> <tr>
<td>{{ $user->realname }}</td> <td>{{ $user->user_id }}</td>
<td>{{ $user->level }}</td> <td>{{ $user->username }}</td>
<td>{{ $user->auth_type }}</td> <td>{{ $user->realname }}</td>
<td>{{ $user->email }}</td> <td>{{ $user->level }}</td>
@if(\LibreNMS\Authentication\LegacyAuth::getType() == 'mysql') <td>{{ $user->auth_type }}</td>
<td>{{ $user->enabled }}</td> <td>{{ $user->email }}</td>
@endif @if(\LibreNMS\Authentication\LegacyAuth::getType() == 'mysql')
<td>{{ $user->descr }}</td> <td>{{ $user->enabled }}</td>
<td></td> @endif
</tr> <td>{{ $user->descr }}</td>
@endforeach <td></td>
</tbody> </tr>
</table> @endforeach
</div> </tbody>
</table>
</div> </div>
</div> </x-panel>
</div> </div>
@endsection @endsection
@@ -132,7 +133,6 @@
@section('css') @section('css')
<style> <style>
#manage-users-panel .panel-title { font-size: 18px; }
#users form { display:inline; } #users form { display:inline; }
</style> </style>
@endsection @endsection

View File

@@ -19,94 +19,86 @@
@endif @endif
@if($can_change_password) @if($can_change_password)
<div class="panel panel-default panel-condensed"> <x-panel title="{{ __('Change Password') }}">
<div class="panel-heading">@lang('Change Password')</div> <form method="POST" action="{{ route('users.update', [$user->user_id]) }}" class="form-horizontal" role="form">
<div class="panel-body"> <input type="hidden" name="_method" value="PATCH">
<form method="POST" action="{{ route('users.update', [$user->user_id]) }}" class="form-horizontal" role="form"> @csrf
<input type="hidden" name="_method" value="PATCH"> <div class="form-group">
@csrf <label for="old_password" class="col-sm-4 control-label">@lang('Current Password')</label>
<div class="form-group"> <div class="col-sm-4">
<label for="old_password" class="col-sm-4 control-label">@lang('Current Password')</label> <input type="password" name="old_password" autocomplete="off" class="form-control input-sm">
<div class="col-sm-4">
<input type="password" name="old_password" autocomplete="off" class="form-control input-sm">
</div>
</div> </div>
<div class="form-group"> </div>
<label for="new_password" class="col-sm-4 control-label">@lang('New Password')</label> <div class="form-group">
<div class="col-sm-4"> <label for="new_password" class="col-sm-4 control-label">@lang('New Password')</label>
<input type="password" name="new_password" autocomplete="off" class="form-control input-sm"> <div class="col-sm-4">
</div> <input type="password" name="new_password" autocomplete="off" class="form-control input-sm">
</div> </div>
<div class="form-group"> </div>
<label for="new_password_confirmation" class="col-sm-4 control-label">@lang('Verify New Password')</label> <div class="form-group">
<div class="col-sm-4"> <label for="new_password_confirmation" class="col-sm-4 control-label">@lang('Verify New Password')</label>
<input type="password" name="new_password_confirmation" autocomplete="off" class="form-control input-sm"> <div class="col-sm-4">
</div> <input type="password" name="new_password_confirmation" autocomplete="off" class="form-control input-sm">
</div> </div>
<div class="form-group"> </div>
<div class="col-sm-4 col-sm-offset-3"> <div class="form-group">
<button type="submit" class="btn btn-default">@lang('Change Password')</button> <div class="col-sm-4 col-sm-offset-3">
</div> <button type="submit" class="btn btn-default">@lang('Change Password')</button>
</div> </div>
</form> </div>
</div> </form>
</div> </x-panel>
@endif @endif
<div class="panel panel-default panel-condensed"> <x-panel title="{{ __('preferences.title') }}">
<div class="panel-heading">@lang('preferences.title')</div> <form class="form-horizontal" role="form">
<div class="panel-body"> @csrf
<form class="form-horizontal" role="form"> <div class="form-group">
@csrf <label for="dashboard" class="col-sm-4 control-label">@lang('Dashboard')</label>
<div class="form-group"> <div class="col-sm-4">
<label for="dashboard" class="col-sm-4 control-label">@lang('Dashboard')</label> <select class="form-control ajax-select" name="dashboard" data-pref="dashboard" data-previous="{{ $default_dashboard }}">
<div class="col-sm-4"> @foreach($dashboards as $dash)
<select class="form-control ajax-select" name="dashboard" data-pref="dashboard" data-previous="{{ $default_dashboard }}"> <option value="{{ $dash->dashboard_id }}" @if($dash->dashboard_id == $default_dashboard) selected @endif>{{ $dash->user ? $dash->user->username : __('<deleted>') }}:{{ $dash->dashboard_name }}</option>
@foreach($dashboards as $dash) @endforeach
<option value="{{ $dash->dashboard_id }}" @if($dash->dashboard_id == $default_dashboard) selected @endif>{{ $dash->user ? $dash->user->username : __('<deleted>') }}:{{ $dash->dashboard_name }}</option> </select>
@endforeach
</select>
</div>
</div> </div>
<div class="form-group"> </div>
<label for="site_style" class="col-sm-4 control-label">@lang('CSS Style')</label> <div class="form-group">
<div class="col-sm-4"> <label for="site_style" class="col-sm-4 control-label">@lang('CSS Style')</label>
<select class="form-control ajax-select" name="site_style" data-pref="site_style" data-previous="{{ $site_style }}"> <div class="col-sm-4">
<option value="default">@lang('Default') ({{ $site_style_default }})</option> <select class="form-control ajax-select" name="site_style" data-pref="site_style" data-previous="{{ $site_style }}">
@foreach($site_styles as $style => $descr) <option value="default">@lang('Default') ({{ $site_style_default }})</option>
<option value="{{ $style }}" @if($style == $site_style) selected @endif>{{ $descr }}</option> @foreach($site_styles as $style => $descr)
@endforeach <option value="{{ $style }}" @if($style == $site_style) selected @endif>{{ $descr }}</option>
</select> @endforeach
</div> </select>
</div> </div>
<div class="form-group"> </div>
<label for="locale" class="col-sm-4 control-label">@lang('Language')</label> <div class="form-group">
<div class="col-sm-4"> <label for="locale" class="col-sm-4 control-label">@lang('Language')</label>
<select class="form-control ajax-select" name="locale" data-pref="locale" data-previous="{{ $locale }}"> <div class="col-sm-4">
<option value="default">@lang('Default') ({{ $locale_default }})</option> <select class="form-control ajax-select" name="locale" data-pref="locale" data-previous="{{ $locale }}">
@foreach($locales as $lang => $descr) <option value="default">@lang('Default') ({{ $locale_default }})</option>
<option value="{{ $lang }}" @if($lang == $locale) selected @endif>{{ $descr }}</option> @foreach($locales as $lang => $descr)
@endforeach <option value="{{ $lang }}" @if($lang == $locale) selected @endif>{{ $descr }}</option>
</select> @endforeach
</div> </select>
<div class="col-sm-4">
<small>* @lang('Translation not fully supported')</small>
</div>
</div> </div>
<div class="form-group"> <div class="col-sm-4">
<label for="notetodevice" class="col-sm-4 control-label">@lang('Add schedule notes to devices notes')</label> <small>* @lang('Translation not fully supported')</small>
<div class="col-sm-4">
<input id="notetodevice" type="checkbox" name="notetodevice" @if($note_to_device) checked @endif>
</div>
</div> </div>
</form> </div>
</div> <div class="form-group">
</div> <label for="notetodevice" class="col-sm-4 control-label">@lang('Add schedule notes to devices notes')</label>
<div class="col-sm-4">
<input id="notetodevice" type="checkbox" name="notetodevice" @if($note_to_device) checked @endif>
</div>
</div>
</form>
</x-panel>
@config('twofactor') @config('twofactor')
<div class="panel panel-default panel-condensed"> <x-panel title="{{ __('Two-Factor Authentication') }}">
<div class="panel-heading">@lang('Two-Factor Authentication')</div>
<div class="panel-body">
@if($twofactor) @if($twofactor)
<div id="twofactorqrcontainer"> <div id="twofactorqrcontainer">
<div id="twofactorqr"></div> <div id="twofactorqr"></div>
@@ -157,26 +149,22 @@
</div> </div>
</form> </form>
@endif @endif
</div> </x-panel>
</div>
@endconfig @endconfig
<div class="panel panel-default panel-condensed"> <x-panel title="{{ __('Device Permissions') }}">
<div class="panel-heading">@lang('Device Permissions')</div> @if(auth()->user()->hasGlobalAdmin())
<div class="panel-body"> <strong class="blue">@lang('Global Administrative Access')</strong>
@if(auth()->user()->hasGlobalAdmin()) @elseif(auth()->user()->hasGlobalRead())
<strong class="blue">@lang('Global Administrative Access')</strong> <strong class="green">@lang('Global Viewing Access')</strong>
@elseif(auth()->user()->hasGlobalRead()) @else
<strong class="green">@lang('Global Viewing Access')</strong> @forelse($devices as $device)
@else @deviceLink($device) <br />
@forelse($devices as $device) @empty
@deviceLink($device) <br /> <strong class="red">@lang('No access!')</strong>
@empty @endforelse
<strong class="red">@lang('No access!')</strong> @endif
@endforelse </x-panel>
@endif
</div>
</div>
</div> </div>
@endsection @endsection

View File

@@ -1,5 +1,6 @@
<div class="panel panel-default panel-condensed table-responsive"> <x-panel class="table-responsive">
<table class="table table-hover table-condensed table-striped"> <x-slot name="table">
<table class="table table-hover table-condensed table-striped">
<thead> <thead>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
@@ -55,4 +56,5 @@
@endif @endif
</tbody> </tbody>
</table> </table>
</div> </x-slot>
</x-panel>

View File

@@ -1,74 +1,76 @@
<div class="panel panel-default panel-condensed table-responsive"> <x-panel class="table-responsive">
<table class="table table-hover table-condensed table-striped"> <x-slot name="table">
<thead> <table class="table table-hover table-condensed table-striped">
<tr> <thead>
<th>@lang('Summary')</th> <tr>
<th><a href="{{ url('devices') }}">@lang('Devices')</a></th> <th>@lang('Summary')</th>
<th><a href="{{ url('ports') }}">@lang('Ports')</a></th> <th><a href="{{ url('devices') }}">@lang('Devices')</a></th>
@if($show_services) <th><a href="{{ url('ports') }}">@lang('Ports')</a></th>
<th><a href="{{ url('services') }}">@lang('Services')</a></th> @if($show_services)
@endif <th><a href="{{ url('services') }}">@lang('Services')</a></th>
</tr> @endif
</thead> </tr>
<tbody> </thead>
<tr> <tbody>
<th><span class="green">@lang('Up')</span></th> <tr>
<td><a href="{{ url('devices/format=list_detail/state=up') }}"><span class="green"> {{ $devices['up'] }}</span></a></td> <th><span class="green">@lang('Up')</span></th>
<td><a href="{{ url('ports/format=list_detail/state=up') }}"><span class="green"> {{ $ports['up'] }}</span></a></td> <td><a href="{{ url('devices/format=list_detail/state=up') }}"><span class="green"> {{ $devices['up'] }}</span></a></td>
@if($show_services) <td><a href="{{ url('ports/format=list_detail/state=up') }}"><span class="green"> {{ $ports['up'] }}</span></a></td>
<td><a href="{{ url('services/view=details/state=ok') }}"><span class="green"> {{ $services['ok'] }}</span></a></td> @if($show_services)
@endif <td><a href="{{ url('services/view=details/state=ok') }}"><span class="green"> {{ $services['ok'] }}</span></a></td>
</tr> @endif
<tr> </tr>
<th><span class="red">@lang('Down')</span></th> <tr>
<td><a href="{{ url('devices/format=list_detail/state=down') }}"><span class="red"> {{ $devices['down'] }}</span></a></td> <th><span class="red">@lang('Down')</span></th>
<td><a href="{{ url('ports/format=list_detail/state=down') }}"><span class="red"> {{ $ports['down'] }}</span></a></td> <td><a href="{{ url('devices/format=list_detail/state=down') }}"><span class="red"> {{ $devices['down'] }}</span></a></td>
@if($show_services) <td><a href="{{ url('ports/format=list_detail/state=down') }}"><span class="red"> {{ $ports['down'] }}</span></a></td>
<td><a href="{{ url('services/view=details/state=critical') }}"><span class="red"> {{ $services['critical'] }}</span></a></td> @if($show_services)
@endif <td><a href="{{ url('services/view=details/state=critical') }}"><span class="red"> {{ $services['critical'] }}</span></a></td>
</tr> @endif
<tr> </tr>
<th><span class="blue">@lang('Ignored tag')</span></th> <tr>
<td><a href="{{ url('devices/format=list_detail/ignore=1') }}"><span class="blue"> {{ $devices['ignored'] }}</span></a></td> <th><span class="blue">@lang('Ignored tag')</span></th>
<td><a href="{{ url('ports/format=list_detail/ignore=1') }}"><span class="blue"> {{ $ports['ignored'] }}</span></a></td> <td><a href="{{ url('devices/format=list_detail/ignore=1') }}"><span class="blue"> {{ $devices['ignored'] }}</span></a></td>
@if($show_services) <td><a href="{{ url('ports/format=list_detail/ignore=1') }}"><span class="blue"> {{ $ports['ignored'] }}</span></a></td>
<td><a href="{{ url('services/view=details/ignore=1') }}"><span class="blue"> {{ $services['ignored'] }}</span></a></td> @if($show_services)
@endif <td><a href="{{ url('services/view=details/ignore=1') }}"><span class="blue"> {{ $services['ignored'] }}</span></a></td>
</tr> @endif
<tr> </tr>
<th><span class="grey">@lang('Alert disabled')</span></th> <tr>
<td><a href="{{ url('devices/format=list_detail/disable_notify=1') }}"><span class="grey"> {{ $devices['disable_notify'] }}</span></a></td> <th><span class="grey">@lang('Alert disabled')</span></th>
<td><span class="grey"> NA</span></a></td> <td><a href="{{ url('devices/format=list_detail/disable_notify=1') }}"><span class="grey"> {{ $devices['disable_notify'] }}</span></a></td>
@if($show_services)
<td><span class="grey"> NA</span></a></td> <td><span class="grey"> NA</span></a></td>
@endif @if($show_services)
</tr> <td><span class="grey"> NA</span></a></td>
<tr> @endif
<th><span class="black">@lang('Disabled')/@lang('Shutdown')</span></th> </tr>
<td><a href="{{ url('devices/format=list_detail/disabled=1') }}"><span class="black"> {{ $devices['disabled'] }}</span></a></td> <tr>
<td><a href="{{ url('ports/format=list_detail/state=admindown') }}"><span class="black"> {{ $ports['shutdown'] }}</span></a></td> <th><span class="black">@lang('Disabled')/@lang('Shutdown')</span></th>
@if($show_services) <td><a href="{{ url('devices/format=list_detail/disabled=1') }}"><span class="black"> {{ $devices['disabled'] }}</span></a></td>
<td><a href="{{ url('services/view=details/disabled=1') }}"><span class="black"> {{ $services['disabled'] }}</span></a></td> <td><a href="{{ url('ports/format=list_detail/state=admindown') }}"><span class="black"> {{ $ports['shutdown'] }}</span></a></td>
@endif @if($show_services)
</tr> <td><a href="{{ url('services/view=details/disabled=1') }}"><span class="black"> {{ $services['disabled'] }}</span></a></td>
@if($summary_errors) @endif
<tr> </tr>
<th><span class="black">@lang('Errored')</span></th> @if($summary_errors)
<td>-</td> <tr>
<td><a href="{{ url('ports/format=list_detail/errors=1') }}"><span class="black"> {{ $ports['errored'] }}</span></a></td> <th><span class="black">@lang('Errored')</span></th>
@if($show_services)
<td>-</td> <td>-</td>
<td><a href="{{ url('ports/format=list_detail/errors=1') }}"><span class="black"> {{ $ports['errored'] }}</span></a></td>
@if($show_services)
<td>-</td>
@endif
</tr>
@endif @endif
</tr> <tr>
@endif <th><span class="grey">@lang('Total')</span></th>
<tr> <td><a href="{{ url('devices') }}"><span> {{ $devices['total'] }}</span></a></td>
<th><span class="grey">@lang('Total')</span></th> <td><a href="{{ url('ports') }}"><span> {{ $ports['total'] }}</span></a></td>
<td><a href="{{ url('devices') }}"><span> {{ $devices['total'] }}</span></a></td> @if($show_services)
<td><a href="{{ url('ports') }}"><span> {{ $ports['total'] }}</span></a></td> <td><a href="{{ url('services') }}"><span> {{ $services['total'] }}</span></a></td>
@if($show_services) @endif
<td><a href="{{ url('services') }}"><span> {{ $services['total'] }}</span></a></td> </tr>
@endif </tbody>
</tr> </table>
</tbody> </x-slot>
</table> </x-panel>
</div>