mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
style reorgs
This commit is contained in:
@@ -25,25 +25,40 @@
|
||||
|
||||
namespace App\Http\Controllers\Install;
|
||||
|
||||
use LibreNMS\Validations\Php;
|
||||
|
||||
class ChecksController extends \App\Http\Controllers\Controller
|
||||
{
|
||||
public function __invoke()
|
||||
{
|
||||
$checks = [
|
||||
['item' => 'test', 'status' => false, 'comment' => 'comment'],
|
||||
$this->checkPhpModule('pdo_mysql'),
|
||||
$this->checkPhpModule('mysqlnd'),
|
||||
$this->checkPhpModule('gd'),
|
||||
];
|
||||
$results = [];
|
||||
$php_ok = version_compare(PHP_VERSION, Php::PHP_MIN_VERSION, '>=');
|
||||
|
||||
return view('install.checks', ['stage' => 1, 'checks' => $checks]);
|
||||
// bitwise and so all checks run
|
||||
if ($php_ok
|
||||
& $this->checkPhpModule($results, 'pdo_mysql')
|
||||
& $this->checkPhpModule($results, 'mysqlnd')
|
||||
& $this->checkPhpModule($results, 'gd')
|
||||
) {
|
||||
session(['install.checks' => true]);
|
||||
}
|
||||
|
||||
return view('install.checks', [
|
||||
'php_version' => PHP_VERSION,
|
||||
'php_required' => Php::PHP_MIN_VERSION,
|
||||
'php_ok' => $php_ok,
|
||||
'modules' => $results
|
||||
]);
|
||||
}
|
||||
|
||||
private function checkPhpModule($module)
|
||||
private function checkPhpModule(&$results, $module)
|
||||
{
|
||||
return [
|
||||
'item' => trans('install.checks.php_module', ['module' => $module]),
|
||||
'status' => extension_loaded("$module"),
|
||||
$status = extension_loaded("$module");
|
||||
$results[] = [
|
||||
'name' => str_replace('install.checks.php_module.', '', trans('install.checks.php_module.' . $module)),
|
||||
'status' => $status,
|
||||
];
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
|
@@ -52,6 +52,7 @@ class DatabaseMigrationController extends Controller
|
||||
throw new \RuntimeException('Migration failed');
|
||||
}
|
||||
echo "\n\nSuccess!";
|
||||
session(['install.user' => true]);
|
||||
} catch (\Exception $e) {
|
||||
echo $e->getMessage() . "\n\nError!";
|
||||
}
|
||||
|
@@ -45,6 +45,7 @@ class MakeUserController extends \App\Http\Controllers\Controller
|
||||
}
|
||||
|
||||
if (isset($user)) {
|
||||
session(['install.user' => true]);
|
||||
return view('install.user-created', [
|
||||
'user' => $user,
|
||||
]);
|
||||
|
@@ -2,15 +2,22 @@
|
||||
return [
|
||||
'title' => 'LibreNMS Install',
|
||||
'install' => 'Install',
|
||||
'stage' => 'Stage :stage of :stages complete',
|
||||
'steps' => [
|
||||
'checks' => 'Pre-Install Checks',
|
||||
'database' => 'Database',
|
||||
'migrate' => 'Build Database',
|
||||
'user' => 'Create User',
|
||||
'finish' => 'Finish Install',
|
||||
],
|
||||
'checks' => [
|
||||
'title' => 'Pre-Install Checks',
|
||||
'php_module' => 'PHP Module: :module',
|
||||
'php_required' => ':version required',
|
||||
'item' => 'Item',
|
||||
'status' => 'Status',
|
||||
'comment' => 'Comment',
|
||||
],
|
||||
'database' => [
|
||||
'title' => 'Configure Database',
|
||||
'status' => 'Status',
|
||||
'test' => 'Test',
|
||||
'host' => 'Host',
|
||||
@@ -22,11 +29,18 @@ return [
|
||||
'socket_empty' => 'Leave empty if using Unix-Socket',
|
||||
'ip_empty' => 'Leave empty if using Host',
|
||||
],
|
||||
'migrate' => [
|
||||
'title' => 'Build Database',
|
||||
],
|
||||
'user' => [
|
||||
'title' => 'Create Admin User',
|
||||
'username' => 'Username',
|
||||
'password' => 'Password',
|
||||
'email' => 'Email',
|
||||
'button' => 'Add User',
|
||||
'created' => 'User Created',
|
||||
],
|
||||
'finish' => [
|
||||
'title' => 'Finish Install'
|
||||
]
|
||||
];
|
||||
|
@@ -1,31 +1,68 @@
|
||||
@extends('layouts.install')
|
||||
|
||||
@section('title', trans('install.checks.title'))
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h4 class="text-center">@lang('install.checks.title')</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<table class="table table-condensed table-bordered">
|
||||
<tr>
|
||||
<th class="col-xs-3">@lang('install.checks.item')</th>
|
||||
<th class="col-xs-1">@lang('install.checks.status')</th>
|
||||
<th class="col-xs-8">@lang('install.checks.comment')</th>
|
||||
</tr>
|
||||
@foreach($checks as $check)
|
||||
<tr class="{{ $check['status'] ? 'success' : 'danger' }}">
|
||||
<td style="white-space: nowrap">{{ $check['item'] }}</td>
|
||||
<td>@if($check['status'])
|
||||
<i class="fa fa-check-circle alert-success"></i>
|
||||
@else
|
||||
<i class="fa fa-times-circle alert-danger"></i>
|
||||
@endif</td>
|
||||
<td>{{ $check['comment'] ?? '' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
<div class=" col-xs-8 col-xs-offset-2">
|
||||
<div class="checks panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-8">
|
||||
PHP <small>(@lang('install.checks.php_required', ['version' => $php_required]))</small>
|
||||
</div>
|
||||
<div class="check-status col-xs-4 text-right @if($php_ok) green @else red @endif">
|
||||
{{ $php_version }}
|
||||
@if($php_ok)
|
||||
<i class="fa fa-lg fa-check-square-o green"></i>
|
||||
@else
|
||||
<i class="fa fa-lg fa-times-rectangle-o red"></i>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@foreach($modules as $module)
|
||||
<div class="check-row row">
|
||||
<div class="col-xs-8">
|
||||
{{ $module['name'] }}
|
||||
</div>
|
||||
<div class="check-status col-xs-4 text-right">
|
||||
@if($module['status'])
|
||||
<i class="fa fa-lg fa-check-square-o green"></i>
|
||||
@else
|
||||
<i class="fa fa-lg fa-times-rectangle-o red"></i>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('style')
|
||||
<style type="text/css">
|
||||
.check-status .fa {
|
||||
vertical-align: middle;
|
||||
}
|
||||
.check-row {
|
||||
margin-top: -1px;
|
||||
padding-top: 11px;
|
||||
padding-bottom: 10px;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
.checks .panel-body {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.checks {
|
||||
font-size: 16pt;
|
||||
}
|
||||
small {
|
||||
font-size: 10pt;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
@@ -1,9 +1,11 @@
|
||||
@extends('layouts.install')
|
||||
|
||||
@section('title', trans('install.database.title'))
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form id="database-form" class="form-horizontal" role="form" method="post" action="{{ route('install.test-database') }}">
|
||||
<form id="database-form" class="form-horizontal" role="form" method="post" action="{{ route('install.acton.test-database') }}">
|
||||
@csrf
|
||||
<div class="form-group">
|
||||
<label for="host" class="col-sm-4 control-label">@lang('install.database.host')</label>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form class="form-horizontal" role="form" method="post" action="{{ route('install.user-create') }}">
|
||||
<form class="form-horizontal" role="form" method="post" action="{{ route('install.action.user') }}">
|
||||
@csrf
|
||||
<div class="form-group">
|
||||
<label for="username" class="col-sm-4 control-label">@lang('install.user.username')</label>
|
||||
|
@@ -23,7 +23,7 @@
|
||||
<script type="text/javascript">
|
||||
var output = document.getElementById("db-update");
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "{{ route('install.migrate') }}", true);
|
||||
xhr.open("GET", "{{ route('install.action.migrate') }}", true);
|
||||
xhr.setRequestHeader('X-Requested-With','XMLHttpRequest');
|
||||
xhr.withCredentials = true;
|
||||
xhr.onprogress = function (e) {
|
||||
|
@@ -2,12 +2,12 @@
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
<h3>
|
||||
<div class="col-xs-12 text-center" style="padding: 60px">
|
||||
<h4>
|
||||
@lang('install.user.created'):
|
||||
<i class="fa fa-2x fa-user-circle" style="vertical-align: middle"></i>
|
||||
<strong>{{ $user->username }}</strong>
|
||||
</h3>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
@@ -15,23 +15,29 @@
|
||||
box-shadow: 0 0 20px black;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #047396;
|
||||
}
|
||||
|
||||
.btn-circle {
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
padding: 10px 16px;
|
||||
border-radius: 35px;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
padding: 8px 14px;
|
||||
border-radius: 30px;
|
||||
font-size: 24px;
|
||||
line-height: 1.9;
|
||||
box-shadow: 3px 3px 5px black;
|
||||
line-height: 1.7;
|
||||
box-shadow: 2px 2px 4px grey;
|
||||
}
|
||||
|
||||
.content-divider {
|
||||
padding-top: 20px;
|
||||
border-bottom: 1px solid #f6f6f6;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
@yield('style')
|
||||
</head>
|
||||
<body style="background-color: #047396;">
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="panel panel-default col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-xs-12 primary-panel">
|
||||
<div class="panel-body">
|
||||
@@ -39,44 +45,52 @@
|
||||
<div class="col-xs-10 col-xs-offset-1">
|
||||
<h2 class="text-center">
|
||||
<img src="{{ asset(\LibreNMS\Config::get('title_image', "images/librenms_logo_" . \LibreNMS\Config::get('applied_site_style') . ".svg")) }}" alt="{{ \LibreNMS\Config::get('project_name', 'LibreNMS') }}">
|
||||
@lang('install.install')
|
||||
@yield('title')
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-2 col-xs-offset-1">
|
||||
<a href="{{ route('install.checks') }}" class="btn btn-primary btn-circle" title="@lang('install.steps.checks')"><i class="fa fa-lg fa-fw fa-clipboard"></i></a>
|
||||
<a href="{{ route('install.checks') }}"
|
||||
class="btn btn-primary btn-circle"
|
||||
title="@lang('install.checks.title')">
|
||||
<i class="fa fa-lg fa-list-ul fa-flip-horizontal"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xs-2">
|
||||
<a href="{{ route('install.database') }}" class="btn btn-primary btn-circle" title="@lang('install.steps.database')"><i class="fa fa-lg fa-fw fa-database"></i></a>
|
||||
<a href="{{ route('install.database') }}"
|
||||
class="btn btn-primary btn-circle @if(!session('install.checks')) disabled @endif"
|
||||
title="@lang('install.database.title')">
|
||||
<i class="fa fa-lg fa-database"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xs-2">
|
||||
<a href="{{ route('install.migrate-database') }}" class="btn btn-primary btn-circle" title="@lang('install.steps.migrate')"><i class="fa fa-lg fa-fw fa-mouse-pointer"></i></a>
|
||||
<a href="{{ route('install.migrate') }}"
|
||||
class="btn btn-primary btn-circle @if(!session('install.database')) disabled @endif"
|
||||
title="@lang('install.migrate.title')">
|
||||
<i class="fa fa-lg fa-repeat"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xs-2">
|
||||
<a href="{{ route('install.user') }}" class="btn btn-primary btn-circle" title="@lang('install.steps.user')"><i class="fa fa-lg fa-fw fa-user"></i></a>
|
||||
<a href="{{ route('install.user') }}"
|
||||
class="btn btn-primary btn-circle @if(!session('install.migrate')) disabled @endif"
|
||||
title="@lang('install.user.title')">
|
||||
<i class="fa fa-lg fa-key"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xs-2">
|
||||
<a href="{{ route('install.finish') }}" class="btn btn-primary btn-circle" title="@lang('install.steps.finish')"><i class="fa fa-lg fa-fw fa-check"></i></a>
|
||||
<a href="{{ route('install.finish') }}"
|
||||
class="btn btn-primary btn-circle @if(!session('install.user')) disabled @endif"
|
||||
title="@lang('install.finish.title')">
|
||||
<i class="fa fa-lg fa-check"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row content-divider">
|
||||
|
||||
</div>
|
||||
{{-- <div class="row">--}}
|
||||
{{-- <div class="col-xs-12">--}}
|
||||
{{-- <div id="install-progress" class="progress progress-striped">--}}
|
||||
{{-- <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="{{ ($stage ?? 0) / ($stages ?? 6) * 100 }}"--}}
|
||||
{{-- aria-valuemin="0" aria-valuemax="100" style="width: {{ ($stage ?? 0) / ($stages ?? 6) * 100 }}%">--}}
|
||||
{{-- <span class="sr-only">{{ ($stage ?? 0) / ($stages ?? 6) * 100 }}% Complete</span>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div>--}}
|
||||
<div class="content-divider"></div>
|
||||
<div class="row">
|
||||
<div id="error-box" class="col-xs-12">
|
||||
@if(!empty($msg))
|
||||
<div class="alert alert-danger">{{ $msg }}</div>
|
||||
@if(!empty($message))
|
||||
<div class="alert alert-danger">{{ $message }}</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -153,14 +153,14 @@ Route::group(['prefix' => 'install', 'namespace' => 'Install'], function () {
|
||||
Route::redirect('/', '/install/checks')->name('install');
|
||||
Route::get('/checks', 'ChecksController')->name('install.checks');
|
||||
Route::get('/database', 'DatabaseController')->name('install.database');
|
||||
Route::get('/database/migrate', 'DatabaseMigrationController')->name('install.migrate-database');
|
||||
Route::get('/database/migrate', 'DatabaseMigrationController')->name('install.migrate');
|
||||
Route::get('/user', 'MakeUserController')->name('install.user');
|
||||
Route::get('/finish', 'FinalizeController')->name('install.finish');
|
||||
|
||||
Route::post('/user/create', 'MakeUserController@create')->name('install.user-create');
|
||||
Route::post('/database/test', 'DatabaseController@test')->name('install.test-database');
|
||||
Route::get('/database/ajax/migrate', 'DatabaseMigrationController@migrate')->name('install.migrate');
|
||||
Route::any('{path?}', 'InstallationController@invalid')->where('path', '.*');
|
||||
Route::post('/user/create', 'MakeUserController@create')->name('install.action.user');
|
||||
Route::post('/database/test', 'DatabaseController@test')->name('install.acton.test-database');
|
||||
Route::get('/database/ajax/migrate', 'DatabaseMigrationController@migrate')->name('install.action.migrate');
|
||||
Route::any('{path?}', 'InstallationController@invalid')->where('path', '.*'); // 404
|
||||
});
|
||||
|
||||
// Legacy routes
|
||||
|
Reference in New Issue
Block a user