mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
user create + db migrate
This commit is contained in:
@@ -129,23 +129,20 @@ class Eloquent
|
||||
|
||||
public static function setConnection($name, $db_host = null, $db_user = '', $db_pass = '', $db_name = '', $db_port = null, $db_socket = null)
|
||||
{
|
||||
if (!is_null($db_host) || !empty($db_name)) {
|
||||
// legacy connection override
|
||||
\Config::set("database.connections.$name", [
|
||||
"driver" => "mysql",
|
||||
"host" => $db_host,
|
||||
"port" => $db_port,
|
||||
"database" => $db_name,
|
||||
"username" => $db_user,
|
||||
"password" => $db_pass,
|
||||
"unix_socket" => $db_socket,
|
||||
"charset" => "utf8",
|
||||
"collation" => "utf8_unicode_ci",
|
||||
"prefix" => "",
|
||||
"strict" => true,
|
||||
"engine" => null
|
||||
]);
|
||||
\Config::set('database.default', $name);
|
||||
}
|
||||
\Config::set("database.connections.$name", [
|
||||
"driver" => "mysql",
|
||||
"host" => $db_host,
|
||||
"port" => $db_port,
|
||||
"database" => $db_name,
|
||||
"username" => $db_user,
|
||||
"password" => $db_pass,
|
||||
"unix_socket" => $db_socket,
|
||||
"charset" => "utf8",
|
||||
"collation" => "utf8_unicode_ci",
|
||||
"prefix" => "",
|
||||
"strict" => true,
|
||||
"engine" => null
|
||||
]);
|
||||
\Config::set('database.default', $name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,12 @@
|
||||
|
||||
namespace App\Http\Controllers\Install;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use LibreNMS\DB\Eloquent;
|
||||
|
||||
class DatabaseController extends \App\Http\Controllers\Controller
|
||||
class DatabaseController extends Controller
|
||||
{
|
||||
const KEYS = ['host', 'username', 'password', 'database', 'port', 'unix_socket'];
|
||||
|
||||
@@ -59,7 +60,8 @@ class DatabaseController extends \App\Http\Controllers\Controller
|
||||
$ok = false;
|
||||
$message = '';
|
||||
try {
|
||||
$ok = Eloquent::isConnected('setup');
|
||||
$conn = Eloquent::DB('setup');
|
||||
$ok = $conn && !is_null($conn->getPdo());
|
||||
} catch (\Exception $e) {
|
||||
$message = $e->getMessage();
|
||||
}
|
||||
|
||||
@@ -32,23 +32,22 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
|
||||
class DatabaseMigrationController extends Controller
|
||||
{
|
||||
public function __invoke(Request $request)
|
||||
use UsesDatabase;
|
||||
|
||||
public function __invoke()
|
||||
{
|
||||
\LibreNMS\DB\Eloquent::setConnection(
|
||||
'setup',
|
||||
session('dbhost', 'localhost'),
|
||||
session('dbuser', 'librenms'),
|
||||
session('dbpass', 'farts'),
|
||||
session('dbname', 'phpunit_tests_librenms_234324'),
|
||||
session('dbport', 3306)
|
||||
);
|
||||
var_dump(session()->all()); exit;
|
||||
return view('install.migrate-database', ['stage' => 4]);
|
||||
}
|
||||
|
||||
public function migrate(Request $request)
|
||||
{
|
||||
$this->setDB();
|
||||
|
||||
$response = new StreamedResponse(function () {
|
||||
try {
|
||||
$output = new StreamedOutput(fopen('php://stdout', 'w'));
|
||||
echo "Starting Update...\n";
|
||||
$ret = \Artisan::call('migrate', ['--seed' => true, '--force' => true, '--database' => 'setup'], $output);
|
||||
$ret = \Artisan::call('migrate', ['--seed' => true, '--force' => true, '--database' => $this->connection], $output);
|
||||
if ($ret !== 0) {
|
||||
throw new \RuntimeException('Migration failed');
|
||||
}
|
||||
|
||||
@@ -31,4 +31,76 @@ class FinalizeController extends \App\Http\Controllers\Controller
|
||||
{
|
||||
// TODO: Implement __invoke() method.
|
||||
}
|
||||
|
||||
private function writeConfigFile($config_file)
|
||||
{
|
||||
$file = base_path('config.php');
|
||||
if (!file_exists($file)) {
|
||||
$conf = fopen($file, 'w');
|
||||
if ($conf != false) {
|
||||
if (fwrite($conf, "<?php\n") === false) {
|
||||
echo("<div class='alert alert-danger'>We couldn't create the config.php file, please create this manually before continuing by copying the below into a config.php in the root directory of your install (typically /opt/librenms/)</div>");
|
||||
echo("<pre><?php\n".stripslashes($config_file)."</pre>");
|
||||
} else {
|
||||
$config_file = stripslashes($config_file);
|
||||
fwrite($conf, $config_file);
|
||||
echo("<div class='alert alert-success'>The config file has been created</div>");
|
||||
}
|
||||
fclose($conf);
|
||||
} else {
|
||||
echo("<div class='alert alert-danger'>We couldn't create the config.php file, please create this manually before continuing by copying the below into a config.php in the root directory of your install (typically /opt/librenms/)</div>");
|
||||
echo("<pre><?php\n".stripslashes($config_file)."</pre>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function getConfigFileContents()
|
||||
{
|
||||
$db = session('db');
|
||||
$install_dir = base_path();
|
||||
|
||||
return <<<"EOD"
|
||||
## Have a look in defaults.inc.php for examples of settings you can set here. DO NOT EDIT defaults.inc.php!
|
||||
|
||||
### Database config
|
||||
\$config\['db_host'\] = '${$db['host']}';
|
||||
\$config\['db_port'\] = '${$db['port']}';
|
||||
\$config\['db_user'\] = '${$db['username']}';
|
||||
\$config\['db_pass'\] = '${$db['password']}';
|
||||
\$config\['db_name'\] = '${$db['database']}';
|
||||
\$config\['db_socket'\] = '${$db['unix_socket']}';
|
||||
|
||||
// This is the user LibreNMS will run as
|
||||
//Please ensure this user is created and has the correct permissions to your install
|
||||
\$config['user'] = 'librenms';
|
||||
|
||||
### Locations - it is recommended to keep the default
|
||||
#\$config\['install_dir'\] = "$install_dir";
|
||||
|
||||
### This should *only* be set if you want to *force* a particular hostname/port
|
||||
### It will prevent the web interface being usable form any other hostname
|
||||
#\$config\['base_url'\] = "http://librenms.company.com";
|
||||
|
||||
### Enable this to use rrdcached. Be sure rrd_dir is within the rrdcached dir
|
||||
### and that your web server has permission to talk to rrdcached.
|
||||
#\$config\['rrdcached'\] = "unix:/var/run/rrdcached.sock";
|
||||
|
||||
### Default community
|
||||
\$config\['snmp'\]\['community'\] = array("public");
|
||||
|
||||
### Authentication Model
|
||||
\$config\['auth_mechanism'\] = "mysql"; # default, other options: ldap, http-auth
|
||||
#\$config\['http_auth_guest'\] = "guest"; # remember to configure this user if you use http-auth
|
||||
|
||||
### List of RFC1918 networks to allow scanning-based discovery
|
||||
#\$config\['nets'\]\[\] = "10.0.0.0/8";
|
||||
#\$config\['nets'\]\[\] = "172.16.0.0/12";
|
||||
#\$config\['nets'\]\[\] = "192.168.0.0/16";
|
||||
|
||||
# Update configuration
|
||||
#\$config\['update_channel'\] = 'release'; # uncomment to follow the monthly release channel
|
||||
#\$config\['update'\] = 0; # uncomment to completely disable updates
|
||||
EOD;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ use App\Http\Controllers\Controller;
|
||||
|
||||
class InstallationController extends Controller
|
||||
{
|
||||
public function __invoke()
|
||||
public function invalid()
|
||||
{
|
||||
return 'install';
|
||||
abort(404);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,10 +25,52 @@
|
||||
|
||||
namespace App\Http\Controllers\Install;
|
||||
|
||||
use App\Models\User;
|
||||
use Doctrine\DBAL\Query\QueryException;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MakeUserController extends \App\Http\Controllers\Controller
|
||||
{
|
||||
public function __invoke()
|
||||
use UsesDatabase;
|
||||
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
// TODO: Implement __invoke() method.
|
||||
if ($request->method() == 'POST') {
|
||||
$this->create($request);
|
||||
}
|
||||
|
||||
if (session('install.database')) {
|
||||
$this->setDB();
|
||||
$user = User::first();
|
||||
}
|
||||
|
||||
if (isset($user)) {
|
||||
return view('install.user-created', [
|
||||
'user' => $user,
|
||||
]);
|
||||
}
|
||||
|
||||
return view('install.make-user');
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'username' => 'required',
|
||||
'password' => 'required',
|
||||
]);
|
||||
|
||||
|
||||
try {
|
||||
$user = new User($request->only(['username', 'password', 'email']));
|
||||
$user->setPassword($request->get('password'));
|
||||
$user->setConnection($this->connection);
|
||||
$res = $user->save();
|
||||
$message = $res ? trans('install.user.success') : trans('install.user.failure');
|
||||
} catch (\Exception $e) {
|
||||
$message = $e->getMessage();
|
||||
}
|
||||
|
||||
// return redirect()->back()->with('message', $message);
|
||||
}
|
||||
}
|
||||
|
||||
47
app/Http/Controllers/Install/UsesDatabase.php
Normal file
47
app/Http/Controllers/Install/UsesDatabase.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* UsesDatabase.php
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2020 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace App\Http\Controllers\Install;
|
||||
|
||||
use LibreNMS\DB\Eloquent;
|
||||
|
||||
trait UsesDatabase
|
||||
{
|
||||
protected $connection = 'setup';
|
||||
|
||||
protected function setDB()
|
||||
{
|
||||
Eloquent::setConnection(
|
||||
$this->connection,
|
||||
session('db.host', 'localhost'),
|
||||
session('db.username', 'librenms'),
|
||||
session('db.password'),
|
||||
session('db.database', 'librenms'),
|
||||
session('db.port', 3306),
|
||||
session('db.socket')
|
||||
);
|
||||
config(['database.default', $this->connection]);
|
||||
|
||||
return \DB::connection($this->connection);
|
||||
}
|
||||
}
|
||||
@@ -371,48 +371,6 @@ if ($stage == 0) {
|
||||
<?php
|
||||
|
||||
// Create the config file we will write or display
|
||||
$config_file = <<<"EOD"
|
||||
## Have a look in defaults.inc.php for examples of settings you can set here. DO NOT EDIT defaults.inc.php!
|
||||
|
||||
### Database config
|
||||
\$config\['db_host'\] = '$dbhost';
|
||||
\$config\['db_port'\] = '$dbport';
|
||||
\$config\['db_user'\] = '$dbuser';
|
||||
\$config\['db_pass'\] = '$dbpass';
|
||||
\$config\['db_name'\] = '$dbname';
|
||||
\$config\['db_socket'\] = '$dbsocket';
|
||||
|
||||
// This is the user LibreNMS will run as
|
||||
//Please ensure this user is created and has the correct permissions to your install
|
||||
\$config['user'] = 'librenms';
|
||||
|
||||
### Locations - it is recommended to keep the default
|
||||
#\$config\['install_dir'\] = "$install_dir";
|
||||
|
||||
### This should *only* be set if you want to *force* a particular hostname/port
|
||||
### It will prevent the web interface being usable form any other hostname
|
||||
#\$config\['base_url'\] = "http://librenms.company.com";
|
||||
|
||||
### Enable this to use rrdcached. Be sure rrd_dir is within the rrdcached dir
|
||||
### and that your web server has permission to talk to rrdcached.
|
||||
#\$config\['rrdcached'\] = "unix:/var/run/rrdcached.sock";
|
||||
|
||||
### Default community
|
||||
\$config\['snmp'\]\['community'\] = array("public");
|
||||
|
||||
### Authentication Model
|
||||
\$config\['auth_mechanism'\] = "mysql"; # default, other options: ldap, http-auth
|
||||
#\$config\['http_auth_guest'\] = "guest"; # remember to configure this user if you use http-auth
|
||||
|
||||
### List of RFC1918 networks to allow scanning-based discovery
|
||||
#\$config\['nets'\]\[\] = "10.0.0.0/8";
|
||||
#\$config\['nets'\]\[\] = "172.16.0.0/12";
|
||||
#\$config\['nets'\]\[\] = "192.168.0.0/16";
|
||||
|
||||
# Update configuration
|
||||
#\$config\['update_channel'\] = 'release'; # uncomment to follow the monthly release channel
|
||||
#\$config\['update'\] = 0; # uncomment to completely disable updates
|
||||
EOD;
|
||||
|
||||
if (!file_exists("{$librenms_dir}/config.php")) {
|
||||
$conf = fopen("config.php", 'w');
|
||||
|
||||
@@ -12,13 +12,21 @@ return [
|
||||
],
|
||||
'database' => [
|
||||
'status' => 'Status',
|
||||
'test' => 'Test',
|
||||
'host' => 'Host',
|
||||
'port' => 'Port',
|
||||
'socket' => 'Unix-Socket',
|
||||
'user' => 'User',
|
||||
'username' => 'User',
|
||||
'password' => 'Password',
|
||||
'name' => 'Name',
|
||||
'name' => 'Database Name',
|
||||
'socket_empty' => 'Leave empty if using Unix-Socket',
|
||||
'ip_empty' => 'Leave empty if using Host',
|
||||
],
|
||||
'user' => [
|
||||
'username' => 'Username',
|
||||
'password' => 'Password',
|
||||
'email' => 'Email',
|
||||
'button' => 'Add User',
|
||||
'created' => 'User Created',
|
||||
]
|
||||
];
|
||||
|
||||
@@ -41,21 +41,25 @@
|
||||
<input type="text" class="form-control" name="database" id="database" value="{{ $database ?? 'librenms' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span id="database-status">
|
||||
@lang('install.database.status'):
|
||||
@if($status)
|
||||
<i class="fa fa-2x fa-check-circle"></i>
|
||||
@else
|
||||
<i class="fa fa-2x fa-times-circle"></i>
|
||||
@endif
|
||||
</span>
|
||||
<button type="submit" class="btn btn-success pull-right">Test</button>
|
||||
<div class="row">
|
||||
<div class="col-sm-4 col-sm-offset-1">
|
||||
<strong>@lang('install.database.status'):</strong>
|
||||
<span id="database-status" style="vertical-align: middle">
|
||||
@if($status === null)
|
||||
<i class="fa fa-2x fa-question-circle text-muted"></i>
|
||||
@elseif($status)
|
||||
<i class="fa fa-2x fa-check-circle text-success"></i>
|
||||
@else
|
||||
<i class="fa fa-2x fa-times-circle text-danger"></i>
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<button type="submit" class="btn btn-success pull-right">@lang('install.database.test')</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -63,18 +67,22 @@
|
||||
<script>
|
||||
$('#database-form').submit(function (event) {
|
||||
event.preventDefault();
|
||||
$('#database-status>i').attr('class', 'fa fa-2x fa-spinner fa-spin');
|
||||
$('.db-error').remove();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: "json",
|
||||
url: $('#database-form').attr('action'),
|
||||
data: $('#database-form').serialize(),
|
||||
success: function (response) {
|
||||
console.log(response.ok);
|
||||
if (response.status === 'ok') {
|
||||
$('#database-status.i').removeClass('fa-check-circle').addClass('fa-times-circle')
|
||||
if (response.result === 'ok') {
|
||||
$('#database-status>i').attr('class', 'fa fa-2x fa-check-circle text-success')
|
||||
} else {
|
||||
$('#database-status.i').removeClass('fa-times-circle').addClass('fa-check-circle')
|
||||
alert(response.message)
|
||||
$('#database-status>i').attr('class', 'fa fa-2x fa-times-circle text-danger')
|
||||
if (response.message) {
|
||||
$('#error-box').append($('<div class="db-error alert alert-danger">' + response.message + '</div>'))
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
30
resources/views/install/make-user.blade.php
Normal file
30
resources/views/install/make-user.blade.php
Normal file
@@ -0,0 +1,30 @@
|
||||
@extends('layouts.install')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<form class="form-horizontal" role="form" method="post" action="{{ route('install.user-create') }}">
|
||||
@csrf
|
||||
<div class="form-group">
|
||||
<label for="username" class="col-sm-4 control-label">@lang('install.user.username')</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="username" id="username" value="{{ old('username') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="col-sm-4 control-label">@lang('install.user.password')</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="password" class="form-control" name="password" id="password" value="{{ old('password') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email" class="col-sm-4 control-label">@lang('install.user.email')</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="email" class="form-control" name="email" id="email" value="{{ old('email') }}">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success pull-right">@lang('install.user.button')</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
53
resources/views/install/migrate-database.blade.php
Normal file
53
resources/views/install/migrate-database.blade.php
Normal file
@@ -0,0 +1,53 @@
|
||||
@extends('layouts.install')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h5 class="text-center">Importing MySQL DB - Do not close this page or interrupt the import</h5>
|
||||
<textarea readonly id="db-update" class="form-control" rows="20" placeholder="Please Wait..." style="resize:vertical;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
If you don't see any errors or messages above then the database setup has been successful.<br />
|
||||
<form class="form-horizontal" role="form" method="post">
|
||||
@csrf
|
||||
<input type="button" id="retry-btn" value="Retry" onClick="window.location.reload()" style="display: none;" class="btn btn-success">
|
||||
<button type="submit" id="add-user-btn" class="btn btn-success pull-right" disabled>Goto Add User</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
var output = document.getElementById("db-update");
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "{{ route('install.migrate') }}", true);
|
||||
xhr.setRequestHeader('X-Requested-With','XMLHttpRequest');
|
||||
xhr.withCredentials = true;
|
||||
xhr.onprogress = function (e) {
|
||||
output.innerHTML = e.currentTarget.responseText;
|
||||
output.scrollTop = output.scrollHeight - output.clientHeight; // scrolls the output area
|
||||
if (output.innerHTML.indexOf('Error!') !== -1) {
|
||||
// if error word in output, show the retry button
|
||||
$("#retry-btn").css("display", "");
|
||||
}
|
||||
};
|
||||
xhr.timeout = 90000; // if no response for 90s, allow the user to retry
|
||||
xhr.ontimeout = function (e) {
|
||||
$("#retry-btn").css("display", "");
|
||||
};
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||
if (xhr.status === 200) {
|
||||
console.log("Complete");
|
||||
$('#add-user-btn').removeAttr('disabled');
|
||||
}
|
||||
$('#install-progress').removeClass('active')
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
$('#install-progress').addClass('active')
|
||||
</script>
|
||||
@endsection
|
||||
14
resources/views/install/user-created.blade.php
Normal file
14
resources/views/install/user-created.blade.php
Normal file
@@ -0,0 +1,14 @@
|
||||
@extends('layouts.install')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-center">
|
||||
<h3>
|
||||
@lang('install.user.created'):
|
||||
<i class="fa fa-2x fa-user-circle" style="vertical-align: middle"></i>
|
||||
<strong>{{ $user->username }}</strong>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
22
|
||||
@@ -10,19 +10,17 @@
|
||||
<link href="{{ asset('css/font-awesome.min.css') }}" rel="stylesheet" type="text/css"/>
|
||||
<script src="{{ asset('js/jquery.min.js') }}"></script>
|
||||
<script src="{{ asset('js/bootstrap.min.js') }}"></script>
|
||||
<script src="{{ asset('js/bootstrap-hover-dropdown.min.js') }}"></script>
|
||||
<script src="{{ asset('js/hogan-2.0.0.js') }}"></script>
|
||||
</head>
|
||||
<body style="background-color: #047396">
|
||||
<body style="background-color: #047396;">
|
||||
<div class="container">
|
||||
<div class="panel panel-default col-md-6 col-md-offset-3" style="box-shadow: 0 0 20px black;">
|
||||
<div class="panel panel-default col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-xs-12" style="box-shadow: 0 0 20px black;">
|
||||
<div class="panel-body">
|
||||
<div class="row" style="border-bottom: 1px solid #f6f6f6;">
|
||||
<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')
|
||||
</h2>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -40,13 +38,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(!empty($msg))
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div id="error-box" class="col-xs-12">
|
||||
@if(!empty($msg))
|
||||
<div class="alert alert-danger">{{ $msg }}</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -153,10 +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('/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::any('/database/migrate', 'DatabaseMigrationController')->name('install.migrate-database');
|
||||
Route::get('/database/ajax/migrate', 'DatabaseMigrationController@migrate')->name('install.migrate');
|
||||
Route::any('{path?}', 'InstallationController@invalid')->where('path', '.*');
|
||||
});
|
||||
|
||||
// Legacy routes
|
||||
|
||||
Reference in New Issue
Block a user