INIT: initial commit

This commit is contained in:
Michal Kváček
2017-09-23 00:46:53 +02:00
commit ed32a1c27b
29 changed files with 935 additions and 0 deletions
@@ -0,0 +1,31 @@
@if(count($requests) > 0)
<table class="item-list content-overview full-width table striped">
<thead>
<tr>
<td>@lang('profiler::module.index.calledTotal')</td>
<td>@lang('profiler::module.index.httpMethod')</td>
<td>@lang('profiler::module.index.url')</td>
<td>@lang('profiler::module.index.timeAvg')</td>
<td></td>
</tr>
</thead>
<tbody>
@foreach($requests as $request)
<tr>
<td>{{$request->total}}</td>
<td><a href="{{route('profiler.index', ['method' => $request->method])}}">{{$request->method}}</a></td>
<td><a href="{{route('profiler.index', ['url' => $request->url])}}">{{$request->url}}</a></td>
<td>{{number_format($request->time_avg, 2)}} ms</td>
<td>
<a href="{{route('request.detail', ['httpLog' => $request])}}" data-toggle="tooltip"
title="@lang('profiler::module.request.info')">
<i class="fa fa-info"></i>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
@lang('admin/common.empty')
@endif
@@ -0,0 +1,60 @@
@if(count($requests) > 0)
<table class="item-list content-overview full-width table striped">
<thead>
<tr>
<td>@lang('profiler::module.index.createdAt')</td>
<td>@lang('profiler::module.index.httpMethod')</td>
<td>@lang('profiler::module.index.url')</td>
<td>@lang('profiler::module.index.time')</td>
<td>@lang('profiler::module.index.systemLoad')</td>
<td></td>
</tr>
</thead>
<tbody>
@foreach($requests as $request)
<tr>
<td>{{$request->created_at->format('d.m.Y G:i')}}</td>
<td><a href="{{route('profiler.index', ['method' => $request->method])}}">{{$request->method}}</a></td>
<td><a href="{{route('profiler.index', ['url' => $request->url])}}">{{$request->url}}</a></td>
<td>{{number_format($request->time, 3)}} ms</td>
<td>{{$request->load_1}}, {{$request->load_5}}, {{$request->load_15}}</td>
<td>
<div class="item-actions-dropdown">
<a class="item-actions-toggle-btn">
<span class="inactive">
<i class="fa fa-cog"></i>
</span>
<span class="active">
<i class="fa fa-chevron-circle-right"></i>
</span>
</a>
<div class="item-actions-block">
<ul class="item-actions-list">
<li>
<a href="{{route('request.detail', ['httpLog' => $request])}}" data-toggle="tooltip"
title="@lang('profiler::module.request.info')">
<i class="fa fa-info"></i>
</a>
</li>
<li>
<a href="{{route('queries.index', ['httpLog' => $request])}}" data-toggle="tooltip"
title="@lang('profiler::module.request.sql')">
<i class="fa fa-database"></i></a>
</li>
</ul>
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
@lang('admin/common.empty')
@endif
+44
View File
@@ -0,0 +1,44 @@
@extends('admin.layoutWithNavigation')
@section('pageHeading', trans('profiler::module.name'))
@section('headerButtons')
@if($displayGrouped == false)
<a class="btn btn-sm rounded btn-primary" href="{{route('profiler.index')}}"><i class="fa fa-list"></i></a>
@endif
<div class="pull-right">
@foreach(['0' => 'today', '7' => 'days', '30' => 'days', 'inf' => 'overall'] as $pastDay => $name)
@php $filter['pastDays'] = $pastDay; @endphp
<a class="btn btn-sm rounded @if($pastDays === (string)$pastDay) btn-primary @else btn-secondary @endif"
href="{{route('profiler.index', $filter)}}">{{trans_choice('profiler::module.index.pastDays.'.$name, $pastDay)}}</a>
@endforeach
</div>
@endsection
@if($displayGrouped == false)
@section('pageDescription', trans('profiler::module.listDescription'))
@else
@section('pageDescription', trans('profiler::module.groupedListDescription'))
@endif
@section('content')
<div class="card">
<div class="card-block">
@if ($displayGrouped == true)
@include('profiler::_partials.groupedRequestList', ['requests' => $httpLog])
@else
@include('profiler::_partials.requestList', ['requests' => $httpLog])
@endif
</div>
<div class="card-footer">
{!! $httpLog->render() !!}
</div>
</div>
@endsection
+41
View File
@@ -0,0 +1,41 @@
@extends('admin.layoutWithNavigation')
@section('pageHeading', trans('profiler::module.name'))
@section('content')
<div class="card">
<div class="card-block">
<table class="table stripped">
<thead>
<tr>
<td>@lang('profiler::module.queries.sql')</td>
<td>@lang('profiler::module.queries.time')</td>
<td></td>
</tr>
</thead>
<tbody>
@foreach($queries as $query)
<tr>
<td>
@php $sql = $query->query; @endphp
@foreach($query->bindings as $value)
@php
if (is_array($value) && isset($value['date']))
{$value = \Carbon\Carbon::parse($value['date'])->toDateTimeString();}
$sql = preg_replace('/\?/', $value, $sql, 1);
@endphp
@endforeach
{{$sql}}
</td>
<td>{{number_format($query->time, 3)}} ms</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
+111
View File
@@ -0,0 +1,111 @@
@extends('admin.layoutWithNavigation')
@section('pageHeading', trans('profiler::module.requestDetail'))
@section('headerButtons')
<a class="btn btn-sm rounded btn-primary" href="{{route('profiler.index')}}"><i class="fa fa-list"></i></a>
<div class="pull-right">
@foreach(['0' => 'today', '7' => 'days', '30' => 'days', 'inf' => 'overall'] as $pastDay => $name)
@php $filter['httpLog'] = $httpLog ;$filter['pastDays'] = $pastDay; @endphp
<a class="btn btn-sm rounded @if($pastDays === (string)$pastDay) btn-primary @else btn-secondary @endif"
href="{{route('request.detail', $filter)}}">{{trans_choice('profiler::module.index.pastDays.'.$name, $pastDay)}}</a>
@endforeach
</div>
@endsection
@section('content')
<div class="row">
<div class="col-md-5">
<div class="card">
<div class="card-header">
<div class="header-block">
<p class="title">@lang('profiler::module.request.detail')</p>
</div>
</div>
<div class="card-block">
<div class="row">
<ul>
<li>@lang('profiler::module.index.httpMethod'): {{$httpLog->method}}</li>
<li>@lang('profiler::module.index.url'): <a
href="{{route('profiler.index', ['url' => $httpLog->url])}}">{{$httpLog->url}}</a>
</li>
<li>@lang('profiler::module.index.time'): {{number_format($httpLog->time, 2)}} ms</li>
<li>@lang('profiler::module.index.systemLoad'): {{$httpLog->load_1}}, {{$httpLog->load_5}}
, {{$httpLog->load_15}}</li>
</ul>
</div>
<div class="row text-center">
<div class="col-sm-3"><h5>
{{count($sameRequests)}} &times;</h5> @lang('profiler::module.index.calledTotal')</div>
<div class="col-sm-3"><h5>{{number_format($times['min'], 2)}}
ms</h5> @lang('profiler::module.index.timeMin')</div>
<div class="col-sm-3"><h5>{{number_format($times['max'], 2)}}
ms</h5> @lang('profiler::module.index.timeMax')</div>
<div class="col-sm-3"><h5>{{number_format($times['avg'], 2)}}
ms</h5> @lang('profiler::module.index.timeAvg')</div>
</div>
</div>
</div>
</div>
<div class="col-md-7">
<div class="card">
<div class="card-header">
<div class="header-block">
<p class="title">@lang('profiler::module.graphs.responseTime')</p>
</div>
</div>
<div class="card-block">
<canvas id="responseTimeHistory" height="100"></canvas>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<div class="header-block">
<p class="title">@lang('profiler::module.request.sameRequests')</p>
</div>
</div>
<div class="card-block">
@include('profiler::_partials.requestList', ['requests' => $sameRequests])
</div>
</div>
@endsection
@section('javascripts')
<script>
var ctx = $ ("#responseTimeHistory");
var myChart = new Chart (ctx, {
type: 'bubble',
data: {
datasets: [
{
label: '@lang('profiler::module.graphs.responseTime')',
data: [
@foreach($sameRequests as $i => $request)
{
x: '{{$i}}',
y: '{{number_format($request->time, 2)}}',
r: 5
},
@endforeach
],
backgroundColor: "#413e39",
hoverBackgroundColor: "#515151",
}]
}
});
</script>
@endsection
@@ -0,0 +1,65 @@
<div class="row">
<div class="col-lg-9">
@php $profileVisitorArea = old('useProfilerInVisitorArea', isset($settings->useProfilerInVisitorArea) ? $settings->useProfilerInVisitorArea['val'] : null); @endphp
<span class="control-label">@lang('profiler::module.settings.useProfilerInVisitorArea')</span>
<label>
<input class="radio" type="radio" name="useProfilerInVisitorArea"
value="1"
@if($profileVisitorArea === "1") checked @endif />
<span>@lang('common.yes')</span>
</label>
<label>
<input class="radio" type="radio" name="useProfilerInVisitorArea"
value="0"
@if($profileVisitorArea === "0") checked @endif />
<span>@lang('common.no')</span>
</label>
</div>
<div class="col-lg-3">
@include('admin.settings.snippets.commonSettings', ['field' => 'useProfilerInVisitorArea'])
</div>
</div>
<div class="row">
<div class="col-lg-9">
@php $profileAdmin = old('useProfilerInAdmin', isset($settings->useProfilerInAdmin) ? $settings->useProfilerInAdmin['val'] : false); @endphp
<span class="control-label">@lang('profiler::module.settings.useProfilerInAdmin')</span>
<label>
<input class="radio" type="radio" name="useProfilerInAdmin"
value="1"
@if($profileAdmin) checked @endif />
<span>@lang('common.yes')</span>
</label>
<label>
<input class="radio" type="radio" name="useProfilerInAdmin"
value="0"
@if(!$profileAdmin) checked @endif />
<span>@lang('common.no')</span>
</label>
</div>
<div class="col-lg-3">
@include('admin.settings.snippets.commonSettings', ['field' => 'useProfilerInAdmin'])
</div>
</div>
<div class="row text-center">
<a href="{{route('profiler.deleteAll')}}" class="btn btn-danger remove confirm">
<i class="fa fa-trash-o"></i> @lang('profiler::module.deleteAllData')
</a>
<a href="{{route('profiler.deleteAll', ['olderThan' => 30])}}" class="btn btn-danger remove confirm">
<i class="fa fa-trash-o"></i> @lang('profiler::module.deleteOld')
</a>
</div>