Add some error state pages and installer fixes

This commit is contained in:
Nabeel Shahzad 2017-12-15 11:22:46 -06:00
parent 9607c0a27f
commit b97b47cd8c
7 changed files with 164 additions and 4 deletions

View File

@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Database\QueryException;
class HomeController extends AppBaseController
{
@ -11,7 +12,12 @@ class HomeController extends AppBaseController
*/
public function index()
{
try {
$users = User::orderBy('created_at', 'desc')->take(4)->get();
} catch (QueryException $e) {
return view('system/errors/not_installed');
}
return $this->view('home', [
'users' => $users,
]);

View File

@ -11,6 +11,11 @@
return [
/**
* Check for if we're "installed" or not
*/
'installed' => env('PHPVMS_INSTALLED', false),
/**
* The skin to use for the front-end
*/

View File

@ -56,7 +56,7 @@ class InstallerController extends AppBaseController
$message = 'Failed! ' . $e->getMessage();
}
return view('installer::flash/message', [
return view('installer::flash/dbtest', [
'status' => $status,
'message' => $message,
]);

View File

@ -6,11 +6,13 @@
APP_ENV={!! $APP_ENV !!}
APP_URL=http://localhost
APP_SKIN=default
VACENTRAL_API_KEY=
APP_KEY=base64:{!! $APP_KEY !!}
APP_DEBUG=true
APP_LOCALE=en
PHPVMS_INSTALLED=true
VACENTRAL_API_KEY=
APP_LOG=daily
APP_LOG_LEVEL=debug
APP_LOG_MAX_FILES=3

View File

@ -51,7 +51,7 @@ class EnvironmentService
if(\extension_loaded('apc')) {
$opts['CACHE_DRIVER'] = 'apc';
} else {
$opts['CACHE_DRIVER'] = 'file';
$opts['CACHE_DRIVER'] = 'array';
}
return $opts;

View File

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<link rel="apple-touch-icon" sizes="76x76" href="/assets/frontend/img/apple-icon.png">
<link rel="icon" type="image/png" href="/assets/frontend/img/favicon.png">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>@yield('title') - installer</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
name='viewport'/>
<!-- Fonts and icons -->
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet"/>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css"/>
<!-- CSS Files -->
<link href="/assets/frontend/css/bootstrap.min.css" rel="stylesheet"/>
<link href="/assets/frontend/css/now-ui-kit.css" rel="stylesheet"/>
<link href="/assets/frontend/css/styles.css" rel="stylesheet"/>
{{--<link href="/assets/frontend/css/installer.css" rel="stylesheet"/>--}}
<link rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">
<style>
.table tr:first-child td {
border-top: 0px;
}
</style>
@yield('css')
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-toggleable-md" style="background: #067ec1;">
<div class="container" style="width: 85%!important;">
<div class="navbar-translate">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
data-target="#navigation" aria-controls="navigation-index" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-bar bar1"></span>
<span class="navbar-toggler-bar bar2"></span>
<span class="navbar-toggler-bar bar3"></span>
</button>
<p class="navbar-brand text-white" data-placement="bottom" target="_blank">
<a href="{!! url('/') !!}">
<img src="/assets/frontend/img/logo_blue_bg.svg" width="135px" style=""/>
</a>
</p>
</div>
<div class="justify-content-center" id="navigation"
style="margin-left: 50px; color: white; font-size: 20px;">
@yield('title')
</div>
</div>
</nav>
<!-- End Navbar -->
{{--<div class="clearfix" style="height: 25px;"></div>--}}
<div class="wrapper">
<div class="clear"></div>
<div class="container" style="width: 50%">
<div class="row">
<div class="col-12">
<h2>Database Error</h2>
@yield('content')
</div>
</div>
</div>
<div class="clearfix" style="height: 200px;"></div>
</div>
@yield('scripts')
</body>
</html>

View File

@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<link rel="apple-touch-icon" sizes="76x76" href="/assets/frontend/img/apple-icon.png">
<link rel="icon" type="image/png" href="/assets/frontend/img/favicon.png">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>welcome to phpvms</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
name='viewport'/>
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet"/>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css"/>
<link href="/assets/frontend/css/bootstrap.min.css" rel="stylesheet"/>
<link href="/assets/frontend/css/now-ui-kit.css" rel="stylesheet"/>
<link href="/assets/frontend/css/styles.css" rel="stylesheet"/>
<style>
.table tr:first-child td {
border-top: 0px;
}
</style>
@yield('css')
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-toggleable-md" style="background: #067ec1;">
<div class="container" style="width: 85%!important;">
<div class="navbar-translate">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
data-target="#navigation" aria-controls="navigation-index" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-bar bar1"></span>
<span class="navbar-toggler-bar bar2"></span>
<span class="navbar-toggler-bar bar3"></span>
</button>
<p class="navbar-brand text-white" data-placement="bottom" target="_blank">
<a href="{!! url('/') !!}">
<img src="/assets/frontend/img/logo_blue_bg.svg" width="135px" style=""/>
</a>
</p>
</div>
<div class="justify-content-center" id="navigation"
style="margin-left: 50px; color: white; font-size: 20px;">
@yield('title')
</div>
</div>
</nav>
<!-- End Navbar -->
{{--<div class="clearfix" style="height: 25px;"></div>--}}
<div class="wrapper">
<div class="clear"></div>
<div class="container" style="width: 50%">
<div class="row">
<div class="col-12">
<h2>phpVMS Not Installed</h2>
<p style="text-align: right">
<a href="{!! url('/install') !!}" class="btn btn-success">Head on to the installer ></a>
</p>
@yield('content')
</div>
</div>
</div>
<div class="clearfix" style="height: 200px;"></div>
</div>
@yield('scripts')
</body>
</html>