Skip to content

Commit

Permalink
Updating random stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Apr 3, 2017
1 parent 051e1f7 commit e154eab
Show file tree
Hide file tree
Showing 20 changed files with 188 additions and 168 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
<div class="box">
<div class="box-header with-border">
<h2 class="box-title">PHP Extensions</h2>
</div>
<div class="box-body">
@foreach(get_loaded_extensions() as $extension)
<span class="label label-default">{{ $extension }}</span>
@endforeach
</div>
</div>

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<div class="box">
<div class="box-header">
<h2 class="box-title">PHP</h2>
</div>
<div class="box-body no-padding">
<table class="table table-condensed table-hover no-margin">
<tr>
<th>Version</th>
<td class="text-right">
<span class="label label-primary">{{ $phpInfo['version'] }}</span>
</td>
</tr>
@foreach($phpInfo['requirements'] as $requirement => $enabled)
<tr>
<th>{{ ucfirst($requirement) }} Ext</th>
<td class="text-right">
@if ($enabled)
<span class="label label-success"><i class="fa fa-fw fa-check"></i></span>
@else
<span class="label label-danger"><i class="fa fa-fw fa-times"></i></span>
@endif
</td>
</tr>
@endforeach
</table>
</div>
</div>

<div class="box">
<div class="box-header with-border">
<h2 class="box-title">PHP Loaded Extensions</h2>
</div>
<div class="box-body">
@foreach($phpInfo['extensions'] as $extension)
<span class="label label-default">{{ $extension }}</span>
@endforeach
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
<div class="box">
<div class="box-header">
<h2 class="box-title">PHP</h2>
</div>
<div class="box-body no-padding">
<table class="table table-condensed table-hover no-margin">
<tr>
<th>Version</th>
<td class="text-right">
<span class="label label-primary">{{ $requirements['php']['version'] }}</span>
</td>
</tr>
@foreach($requirements['php']['requirements'] as $requirement => $enabled)
<tr>
<th>{{ ucfirst($requirement) }} Ext</th>
<td class="text-right">
@if ($enabled)
<span class="label label-success"><i class="fa fa-fw fa-check"></i></span>
@else
<span class="label label-danger"><i class="fa fa-fw fa-times"></i></span>
@endif
</td>
</tr>
@endforeach
</table>
</div>
</div>

<div class="box">
<div class="box-header">
<h2 class="box-title">WebServer</h2>
Expand Down
6 changes: 4 additions & 2 deletions resources/views/admin/system/information/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
</div>
<div class="col-md-4">
@include(Arcanesoft\Foundation\ViewComposers\System\ServerRequirementsComposer::VIEW)
@include(Arcanesoft\Foundation\ViewComposers\System\FoldersPermissionsComposer::VIEW)
</div>
<div class="col-md-4">
@include(Arcanesoft\Foundation\ViewComposers\System\FoldersPermissionsComposer::VIEW)
@include(Arcanesoft\Foundation\ViewComposers\System\PhpInfoComposer::VIEW)
@include('foundation::admin.system.information._includes.php-extensions')
</div>
</div>

@include('foundation::admin.system.information._includes.php-extensions')

@endsection

@section('modals')
Expand Down
4 changes: 4 additions & 0 deletions src/Contracts/Foundation.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
*/
interface Foundation
{
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/
/**
* Get the package version.
*
Expand Down
7 changes: 7 additions & 0 deletions src/Http/Controllers/Admin/Controller.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php namespace Arcanesoft\Foundation\Http\Controllers\Admin;

use Arcanesoft\Core\Http\Controllers\AdminController;
use Arcanesoft\Core\Traits\Notifyable;

/**
* Class Controller
Expand All @@ -10,6 +11,12 @@
*/
abstract class Controller extends AdminController
{
/* -----------------------------------------------------------------
| Traits
| -----------------------------------------------------------------
*/
use Notifyable;

/* -----------------------------------------------------------------
| Properties
| -----------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Controllers/Admin/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
*/
class DashboardController extends Controller
{
/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/
/**
* Show the foundation dashboard.
Expand Down
18 changes: 5 additions & 13 deletions src/Http/Controllers/Admin/SettingsController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php namespace Arcanesoft\Foundation\Http\Controllers\Admin;

use Arcanesoft\Core\Traits\Notifyable;

/**
* Class SettingsController
*
Expand All @@ -10,15 +8,9 @@
*/
class SettingsController extends Controller
{
/* ------------------------------------------------------------------------------------------------
| Traits
| ------------------------------------------------------------------------------------------------
*/
use Notifyable;

/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/
/**
* SettingsController constructor.
Expand All @@ -31,9 +23,9 @@ public function __construct()
$this->addBreadcrumbRoute('Settings', 'admin::foundation.settings.index');
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/
public function index()
{
Expand Down
47 changes: 17 additions & 30 deletions src/Http/Controllers/Admin/System/BackupsController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php namespace Arcanesoft\Foundation\Http\Controllers\Admin\System;

use Arcanesoft\Core\Traits\Notifyable;
use Arcanesoft\Foundation\Services\Backups;

/**
Expand All @@ -11,15 +10,9 @@
*/
class BackupsController extends Controller
{
/* ------------------------------------------------------------------------------------------------
| Traits
| ------------------------------------------------------------------------------------------------
*/
use Notifyable;

/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/
/**
* BackupsController constructor.
Expand All @@ -32,9 +25,9 @@ public function __construct()
$this->addBreadcrumbRoute('Backups', 'admin::foundation.system.backups.index');
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/
public function index()
{
Expand Down Expand Up @@ -68,18 +61,15 @@ public function backup()
self::onlyAjax();

if (Backups::runBackups()) {
$ajax = ['status' => 'success'];
$this->notifySuccess('The Backups was created successfully !', 'Backups created !');

$this->notifySuccess('', 'Backups created !');
}
else {
$ajax = [
'status' => 'error',
'message' => 'There is an error while running the backups.'
];
return response()->json(['status' => 'success']);
}

return response()->json($ajax);
return response()->json([
'status' => 'error',
'message' => 'There is an error while running the backups.'
]);
}

public function clear()
Expand All @@ -88,17 +78,14 @@ public function clear()
self::onlyAjax();

if (Backups::clearBackups()) {
$ajax = ['status' => 'success'];

$this->notifySuccess('The Backups was cleared successfully !', 'Backups cleared !');
}
else {
$ajax = [
'status' => 'error',
'message' => 'There is an error while clearing the backups.'
];

return response()->json(['status' => 'success']);
}

return response()->json($ajax);
return response()->json([
'status' => 'error',
'message' => 'There is an error while clearing the backups.'
]);
}
}
6 changes: 3 additions & 3 deletions src/Http/Controllers/Admin/System/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
*/
abstract class Controller extends BaseController
{
/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Constructor
| -----------------------------------------------------------------
*/
/**
* Controller constructor.
Expand Down
10 changes: 5 additions & 5 deletions src/Http/Controllers/Admin/System/InformationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
*/
class InformationController extends Controller
{
/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/
/**
* InformationController constructor.
Expand All @@ -23,9 +23,9 @@ public function __construct()
$this->addBreadcrumbRoute('Information', 'admin::foundation.system.information.index');
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/
public function index()
{
Expand Down
31 changes: 11 additions & 20 deletions src/Http/Controllers/Admin/System/LogViewerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use Arcanedev\LogViewer\Contracts\LogViewer as LogViewerContract;
use Arcanedev\LogViewer\Entities\Log;
use Arcanedev\LogViewer\Exceptions\LogNotFoundException;
use Arcanesoft\Core\Traits\Notifyable;
use Arcanesoft\Foundation\Policies\LogViewerPolicy;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
Expand All @@ -17,15 +16,9 @@
*/
class LogViewerController extends Controller
{
/* ------------------------------------------------------------------------------------------------
| Traits
| ------------------------------------------------------------------------------------------------
*/
use Notifyable;

/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Properties
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/
/**
* The LogViewer instance.
Expand All @@ -41,9 +34,9 @@ class LogViewerController extends Controller
*/
protected $perPage = 30;

/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/
/**
* LogViewerController constructor.
Expand Down Expand Up @@ -149,9 +142,8 @@ public function showByLevel($date, $level)

$log = $this->getLogOrFail($date);

if ($level == 'all') {
if ($level == 'all')
return redirect()->route('admin::foundation.system.log-viewer.logs.show', [$date]);
}

$levels = $this->logViewer->levelsNames();
$entries = $this->logViewer->entries($date, $level)->paginate($this->perPage);
Expand Down Expand Up @@ -193,23 +185,22 @@ public function delete(Request $request)
$this->authorize(LogViewerPolicy::PERMISSION_DELETE);

$date = $request->get('date');
$ajax = ['status' => 'error'];

if ($this->logViewer->delete($date)) {
$ajax = ['status' => 'success'];

$this->notifySuccess(
"The log [$date] was deleted successfully !",
"Log [$date] deleted !"
);

return response()->json(['status' => 'success']);
}

return response()->json($ajax);
return response()->json(['status' => 'error']);
}

/* ------------------------------------------------------------------------------------------------
| Other Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Other Methods
| -----------------------------------------------------------------
*/
/**
* Get a log or fail.
Expand Down
Loading

0 comments on commit e154eab

Please sign in to comment.