Skip to content

Commit

Permalink
added admin routing and admin php info mvc's
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremykenedy committed Apr 5, 2017
1 parent 4c3d441 commit 65ab50a
Show file tree
Hide file tree
Showing 15 changed files with 199 additions and 33 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Laravel 5.4 with user authentication, registration with email confirmation, soci
|User Password Reset via Email Token|
|User Login with remember password|
|User roles implementation|
|Admin Routing Details UI|
|Admin PHP Information UI|
|Eloquent user profiles|
|User Themes|
|404 Page|
Expand Down Expand Up @@ -146,6 +148,9 @@ npm install

#### Admin Tools Routes
* ```/logs```
* ```/php```
* ```/routes```


### Socialite

Expand Down Expand Up @@ -325,6 +330,8 @@ INSTAGRAM_REDIRECT_URI=http://laravel-auth.local/social/handle/instagram
* https://laravel.com/docs/5.4/errors

###### Updates:
* Added Admin Routing Details
* Admin PHP Information
* Added Robust [Laravel Logging](https://laravel.com/docs/5.4/errors#logging) with admin UI using MonoLog
* Added Active Nav states using [Laravel Requests](https://laravel.com/docs/5.4/requests)
* Added [Laravel Debugger](https://github.com/barryvdh/laravel-debugbar) with Service Provider to manage status in `.env` file.
Expand Down
43 changes: 43 additions & 0 deletions app/Http/Controllers/AdminDetailsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Requests;
use File;

class AdminDetailsController extends Controller
{

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}

/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function listRoutes()
{
$routes = Route::getRoutes();
$data = [
'routes' => $routes
];

return view('pages.admin.route-details', $data);
}

public function listPHPInfo()
{
return view('pages.admin.php-details');
}

}
8 changes: 8 additions & 0 deletions public/css/app.1e901db56615a997fdf1.css

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions public/css/app.e3d440c5f94fc35318a5.css

This file was deleted.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/js/app.js": "/js/app.1136fcfd9dc71ebd00e6.js",
"/css/app.css": "/css/app.e3d440c5f94fc35318a5.css"
"/css/app.css": "/css/app.1e901db56615a997fdf1.css"
}
14 changes: 14 additions & 0 deletions resources/assets/sass/_badges.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.badge {
&.badge-primary {
background-color: $brand-primary;
}
}

// A Good time for an @extend
.panel-default > .panel-heading {
.badge {
&.badge-primary {
background-color: $brand-primary;
}
}
}
8 changes: 5 additions & 3 deletions resources/assets/sass/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@
.active {
color: green;
}

.switch {
cursor: pointer;

.fa {
vertical-align: -5px;
margin-right: .25em;
}

.active {
display: none;
}

input[type="radio"] {
position: relative;
z-index: -1;
Expand All @@ -32,10 +36,9 @@
.inactive {
display: none;
}

}

}

.disabled {
color: #dcdbdb;
pointer-events: none;
Expand All @@ -46,5 +49,4 @@
pointer-events: none;
cursor: not-allowed;
}

}
23 changes: 23 additions & 0 deletions resources/assets/sass/_logs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.logs-container {
.stack {
font-size: 0.85em;
}
.date {
min-width: 75px;
}
.text {
word-break: break-all;
}
a.llv-active {
z-index: 2;
background-color: $brand-primary;
border-color: $brand-primary;
color: $white;

.badge {
background: $white;
color: $text-color;
margin-top: .2em;
}
}
}
8 changes: 7 additions & 1 deletion resources/assets/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
// Buttons
@import "buttons";

// Badges
@import "badges";

// Components
@import "modals";

Expand All @@ -43,4 +46,7 @@
@import "lists";

// Avatars
@import "avatar";
@import "avatar";

// Logs
@import "logs";
2 changes: 2 additions & 0 deletions resources/lang/en/titles.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@
'adminThemesAdd' => 'Add New Theme',

'adminLogs' => 'Log Files',
'adminPHP' => 'PHP Information',
'adminRoutes' => 'Routing Details',

];
26 changes: 26 additions & 0 deletions resources/views/pages/admin/php-details.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@extends('layouts.app')

@section('template_title')
PHP Information
@endsection

@section('content')
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
PHP Information
</div>
<div class="panel-body">
<div class="table-responsive">
@php
phpinfo();
@endphp
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
47 changes: 47 additions & 0 deletions resources/views/pages/admin/route-details.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@extends('layouts.app')

@section('template_title')
Routing Information
@endsection

@section('content')
<div class="container">
<div class="row">
<div class="col-md-12">

@include('partials.form-status')

<div class="panel panel-default">
<div class="panel-heading">
Routing Information
<span class="badge badge-primary pull-right">{{ count($routes) }} routes</span>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-condensed data-table">
<thead>
<tr class="success">
<th>URI</th>
<th>Name</th>
<th>Type</th>
<th>Method</th>
</tr>
</thead>
<tbody>
@foreach ($routes as $route)
<tr>
<td>{{$route->uri}}</td>
<td>{{$route->getName()}}</td>
<td>{{$route->getPrefix()}}</td>
<td>{{$route->getActionMethod()}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
4 changes: 3 additions & 1 deletion resources/views/partials/nav.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<li {{ Request::is('users/create') ? 'class=active' : null }}>{!! HTML::link(url('/users/create'), Lang::get('titles.adminNewUser')) !!}</li>
<li {{ Request::is('themes','themes/create') ? 'class=active' : null }}>{!! HTML::link(url('/themes'), Lang::get('titles.adminThemesList')) !!}</li>
<li {{ Request::is('logs') ? 'class=active' : null }}>{!! HTML::link(url('/logs'), Lang::get('titles.adminLogs')) !!}</li>
<li {{ Request::is('php') ? 'class=active' : null }}>{!! HTML::link(url('/php'), Lang::get('titles.adminPHP')) !!}</li>
<li {{ Request::is('routes') ? 'class=active' : null }}>{!! HTML::link(url('/routes'), Lang::get('titles.adminRoutes')) !!}</li>
</ul>
</li>
@endrole
Expand Down Expand Up @@ -71,4 +73,4 @@
</ul>
</div>
</div>
</nav>
</nav>
30 changes: 11 additions & 19 deletions resources/views/vendor/laravel-log-viewer/log.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,30 @@
@section('template_linked_css')

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css">
<style type="text/css">
.stack {
font-size: 0.85em;
}
.date {
min-width: 75px;
}
.text {
word-break: break-all;
}
a.llv-active {
z-index: 2;
background-color: #f5f5f5;
border-color: #777;
}
</style>

@endsection

@section('content')

<div class="container-fluid">
<div class="container-fluid logs-container">
<div class="row">

<div class="col-sm-3 col-md-2 sidebar">
<h4><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span> Log Files</h4>
<h4><span class="fa fa-fw fa-file-code-o" aria-hidden="true"></span> Log Files</h4>
<div class="list-group">
@foreach($files as $file)
<a href="?l={{ base64_encode($file) }}" class="list-group-item @if ($current_file == $file) llv-active @endif">
{{$file}}
@if ($current_file == $file)
<span class="badge pull-right">
{{ count($logs) }}
</span>
@endif
</a>
@endforeach
</div>
</div>

<div class="col-sm-9 col-md-10 table-container">
@if ($logs === null)
<div>
Expand All @@ -55,7 +47,6 @@
</tr>
</thead>
<tbody>

@foreach($logs as $key => $log)
<tr>
<td class="text-{{{$log['level_class']}}}"><span class="glyphicon glyphicon-{{{$log['level_img']}}}-sign" aria-hidden="true"></span> &nbsp;{{$log['level']}}</td>
Expand Down Expand Up @@ -86,6 +77,7 @@
@endif
</div>
</div>

</div>
</div>

Expand Down
2 changes: 2 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,7 @@
]);

Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');
Route::get('php', 'AdminDetailsController@listPHPInfo');
Route::get('routes', 'AdminDetailsController@listRoutes');

});

0 comments on commit 65ab50a

Please sign in to comment.