2017-12-15 06:38:29 +08:00
|
|
|
@extends('installer::app')
|
|
|
|
@section('title', 'Database Setup')
|
|
|
|
@section('content')
|
|
|
|
<div style="align-content: center;">
|
2017-12-15 22:49:01 +08:00
|
|
|
{!! Form::open(['route' => 'installer.envsetup', 'method' => 'POST']) !!}
|
2017-12-15 06:38:29 +08:00
|
|
|
<table class="table" width="25%">
|
2018-01-30 03:16:39 +08:00
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td colspan="2"><h4>Site Config</h4></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Site Name</td>
|
|
|
|
<td style="text-align:center;">
|
|
|
|
<div class="form-group">
|
|
|
|
{!! Form::input('text', 'site_name', 'phpvms', ['class' => 'form-control']) !!}
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Site URL</td>
|
|
|
|
<td style="text-align:center;">
|
|
|
|
<div class="form-group">
|
|
|
|
{!! Form::input('text', 'site_url', Request::root(), ['class' => 'form-control']) !!}
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td colspan="2"><h4>Database Config</h4></td>
|
|
|
|
</tr>
|
|
|
|
|
2017-12-15 06:38:29 +08:00
|
|
|
<tr>
|
2017-12-16 00:41:52 +08:00
|
|
|
<td><p>Select Database Type</p></td>
|
2017-12-15 06:38:29 +08:00
|
|
|
<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">
|
2017-12-15 22:49:01 +08:00
|
|
|
{!! Form::input('text', 'db_host', 'localhost', ['class' => 'form-control']) !!}
|
2017-12-15 06:38:29 +08:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Database Port</td>
|
|
|
|
<td style="text-align:center;">
|
|
|
|
<div class="form-group">
|
2017-12-15 22:06:40 +08:00
|
|
|
{!! Form::input('text', 'db_port', '3306', ['class' => 'form-control']) !!}
|
2017-12-15 06:38:29 +08:00
|
|
|
</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>
|
|
|
|
|
2018-01-30 03:16:39 +08:00
|
|
|
<tr>
|
|
|
|
<td>Database Prefix</td>
|
|
|
|
<td style="text-align:center;">
|
|
|
|
<div class="form-group">
|
|
|
|
{!! Form::input('text', 'db_prefix', '', ['class' => 'form-control']) !!}
|
|
|
|
<p>Set this if you're sharing the database with another application.</p>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
2017-12-15 06:38:29 +08:00
|
|
|
</table>
|
|
|
|
<div id="dbtest"></div>
|
|
|
|
<p style="text-align: right">
|
2018-01-20 23:11:06 +08:00
|
|
|
{!! Form::submit('Setup Database >>', ['class' => 'btn btn-success']) !!}
|
2017-12-15 06:38:29 +08:00
|
|
|
</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(),
|
|
|
|
};
|
|
|
|
|
|
|
|
$.post("{!! route('installer.dbtest') !!}", opts, function(data) {
|
|
|
|
$("#dbtest").html(data);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endsection
|