Rewrite installer without 3rd party installer lib.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<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>phpvms installer</title>
|
||||
<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 -->
|
||||
@@ -39,15 +39,22 @@
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse justify-content-end" id="navigation"></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-fluid" style="width: 85%!important;">
|
||||
@yield('content')
|
||||
<div class="container" style="width: 50%">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('flash::message')
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix" style="height: 200px;"></div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="alert alert-{!! $status !!}" role="alert">
|
||||
<div class="container">
|
||||
<div class="alert-icon">
|
||||
<i class="now-ui-icons ui-2_like"></i>
|
||||
</div>
|
||||
{!! $message !!}
|
||||
</div>
|
||||
</div>
|
||||
11
modules/Installer/Resources/views/index-start.blade.php
Normal file
11
modules/Installer/Resources/views/index-start.blade.php
Normal file
@@ -0,0 +1,11 @@
|
||||
@extends('installer::app')
|
||||
|
||||
@section('content')
|
||||
<h2>phpvms installer</h2>
|
||||
<p>Press continue to start</p>
|
||||
{!! Form::open(['route' => 'installer.step1', 'method' => 'post']) !!}
|
||||
<p style="text-align: right">
|
||||
{!! Form::submit('Start >>', ['class' => 'btn btn-success']) !!}
|
||||
</p>
|
||||
{!! Form::close() !!}
|
||||
@endsection
|
||||
@@ -1,6 +0,0 @@
|
||||
@extends('installer::app')
|
||||
|
||||
@section('content')
|
||||
<h2>phpvms installer</h2>
|
||||
<p>This view is loaded from module: {!! config('installer.name') !!}</p>
|
||||
@endsection
|
||||
@@ -0,0 +1,43 @@
|
||||
@extends('installer::app')
|
||||
@section('title', 'Requirements Check')
|
||||
@section('content')
|
||||
<div style="align-content: center;">
|
||||
{!! Form::open(['route' => 'installer.step2', 'method' => 'GET']) !!}
|
||||
<table class="table" width="25%">
|
||||
<tr><td colspan="2"><h4>php version</h4></td></tr>
|
||||
<tr>
|
||||
<td>PHP Version: {!! $php['version'] !!}</td>
|
||||
<td style="text-align:center;">
|
||||
@if($php['passed'] === true)
|
||||
<span class="badge badge-success">OK!</span>
|
||||
@else
|
||||
<span class="badge badge-danger">Failed!</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr><td colspan="2"><h4>php extensions</h4></td></tr>
|
||||
@foreach($extensions as $ext)
|
||||
<tr>
|
||||
<td>{!! $ext['ext'] !!}</td>
|
||||
<td style="text-align:center;">
|
||||
@if($ext['passed'] === true)
|
||||
<span class="badge badge-success">OK!</span>
|
||||
@else
|
||||
<span class="badge badge-danger">Failed!</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@if($passed === true)
|
||||
<p style="text-align: right">
|
||||
{!! Form::submit('Database Setup >>', ['class' => 'btn btn-success']) !!}
|
||||
</p>
|
||||
@endif
|
||||
{{--{!! $php_version !!}
|
||||
{!! $extensions !!}
|
||||
{!! $passed !!}--}}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
116
modules/Installer/Resources/views/steps/step2-db.blade.php
Normal file
116
modules/Installer/Resources/views/steps/step2-db.blade.php
Normal file
@@ -0,0 +1,116 @@
|
||||
@extends('installer::app')
|
||||
@section('title', 'Database Setup')
|
||||
@section('content')
|
||||
<div style="align-content: center;">
|
||||
{!! Form::open(['route' => 'installer.dbsetup', 'method' => 'POST']) !!}
|
||||
<table class="table" width="25%">
|
||||
<tr>
|
||||
<td>Select Database Type</td>
|
||||
<td style="text-align:center;">
|
||||
<div class="form-group">
|
||||
{!! Form::select('db_conn', $db_types, null, ['class' => 'form-control', 'id' => 'db_conn']) !!}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tbody id="mysql_settings" class="settings_panel">
|
||||
<tr>
|
||||
<td>Database Host</td>
|
||||
<td style="text-align:center;">
|
||||
<div class="form-group">
|
||||
{!! Form::input('text', 'db_host', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Database Port</td>
|
||||
<td style="text-align:center;">
|
||||
<div class="form-group">
|
||||
{!! Form::input('text', 'db_port', '3307', ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Database Name</td>
|
||||
<td style="text-align:center;">
|
||||
<div class="form-group">
|
||||
{!! Form::input('text', 'db_name', 'phpvms', ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Database User</td>
|
||||
<td style="text-align:center;">
|
||||
<div class="form-group">
|
||||
{!! Form::input('text', 'db_user', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Database Password</td>
|
||||
<td style="text-align:center;">
|
||||
<div class="form-group">
|
||||
{!! Form::input('text', 'db_pass', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" style="text-align: right;">
|
||||
{!! Form::submit('Test Database Credentials', ['class' => 'btn btn-info', 'id' => 'dbtest_button']) !!}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody id="sqlite_settings" class="settings_panel">
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
<div id="dbtest"></div>
|
||||
<p style="text-align: right">
|
||||
{!! Form::submit('Complete Setup >>', ['class' => 'btn btn-success']) !!}
|
||||
</p>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
function changeForm(selected) {
|
||||
$("tbody.settings_panel").hide();
|
||||
$("tbody#" + selected + "_settings").show();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var selValue = $("#db_conn option:selected").text();
|
||||
changeForm(selValue);
|
||||
|
||||
$("#db_conn").change(function(e) {
|
||||
var selValue = $("#db_conn option:selected").text();
|
||||
changeForm(selValue);
|
||||
});
|
||||
|
||||
$("#dbtest_button").click(function(e) {
|
||||
e.preventDefault();
|
||||
var opts = {
|
||||
db_conn: $("#db_conn option:selected").text(),
|
||||
db_host: $("input[name=db_host]").val(),
|
||||
db_port: $("input[name=db_port]").val(),
|
||||
db_name: $("input[name=db_name]").val(),
|
||||
db_user: $("input[name=db_user]").val(),
|
||||
db_pass: $("input[name=db_pass]").val(),
|
||||
};
|
||||
|
||||
console.log(opts);
|
||||
$.post("{!! route('installer.dbtest') !!}", opts, function(data) {
|
||||
$("#dbtest").html(data);
|
||||
})
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
34
modules/Installer/Resources/views/stubs/env.blade.php
Normal file
34
modules/Installer/Resources/views/stubs/env.blade.php
Normal file
@@ -0,0 +1,34 @@
|
||||
#
|
||||
# Before you go live, remember to change the APP_ENV to production
|
||||
# and APP_DEBUG to false
|
||||
#
|
||||
|
||||
APP_ENV=dev
|
||||
APP_KEY=base64:{!! $app_key !!}
|
||||
APP_DEBUG=true
|
||||
APP_LOCALE=en
|
||||
|
||||
APP_LOG=daily
|
||||
APP_LOG_LEVEL=debug
|
||||
APP_LOG_MAX_FILES=3
|
||||
|
||||
APP_URL=http://localhost
|
||||
|
||||
DB_CONNECTION={!! $db_conn !!}
|
||||
DB_HOST={!! $db_host !!}
|
||||
DB_PORT={!! $db_port !!}
|
||||
DB_DATABASE={!! $db_name !!}
|
||||
DB_USERNAME={!! $db_user !!}
|
||||
DB_PASSWORD={!! $db_pass !!}
|
||||
DB_PREFIX=
|
||||
|
||||
CACHE_DRIVER=array
|
||||
CACHE_PREFIX=
|
||||
|
||||
REDIS_HOST=localhost
|
||||
REDIS_PASSWORD=
|
||||
REDIS_PORT=6379
|
||||
REDIS_DATABASE=1
|
||||
|
||||
SESSION_DRIVER=array
|
||||
QUEUE_DRIVER=sync
|
||||
Reference in New Issue
Block a user