FEATURE: add simple view for requests and queries

This commit is contained in:
Michal Kváček
2017-03-02 20:04:35 +01:00
parent d99c046103
commit 9c90e844b0
23 changed files with 347 additions and 54 deletions
@@ -1,11 +1,37 @@
@extends('profiler::layouts.master')
@extends('admin.layoutWithNavigation')
@section('pageHeading', trans('profiler::module.name'))
@section('content')
<h1>Hello World</h1>
<p>
This view is loaded from module: {!! config('profiler.name') !!}
</p>
<table class="table stripped">
<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($httpLog as $request)
<tr>
<td>{{$request->created_at->format('d.m.Y G:i')}}</td>
<td>{{$request->method}}</td>
<td>{{$request->url}}</td>
<td>{{number_format($request->time, 3)}} ms</td>
<td>{{$request->load_1}}, {{$request->load_5}}, {{$request->load_15}}</td>
<td>
<a href="{{route('queries.index', ['httpLog' => $request])}}">SQL</a>
</td>
</tr>
@endforeach
</tbody>
</table>
{!! $httpLog->render() !!}
@stop
@@ -1,12 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Module Profiler</title>
</head>
<body>
@yield('content')
</body>
</html>
@@ -0,0 +1,33 @@
@extends('admin.layoutWithNavigation')
@section('pageHeading', trans('profiler::module.name'))
@section('content')
<table class="table stripped">
<thead>
<tr>
<td>@lang('profiler::module.queries.createdAt')</td>
<td>@lang('profiler::module.queries.sql')</td>
<td>@lang('profiler::module.queries.binding')</td>
<td>@lang('profiler::module.queries.time')</td>
<td></td>
</tr>
</thead>
<tbody>
@foreach($queries as $query)
<tr>
<td>{{$query->created_at->format('d.m.Y G:i')}}</td>
<td>{{$query->query}}</td>
<td>
{{var_export($query->bindings)}}
</td>
<td>{{number_format($query->time, 3)}} ms</td>
</tr>
@endforeach
</tbody>
</table>
@endsection
@@ -0,0 +1,55 @@
<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>