Installing and managing modules from admin panel (#847)

This commit is contained in:
Yash Govekar
2020-10-19 19:40:28 +05:30
committed by GitHub
parent ca220f1cdf
commit 5803487d51
92 changed files with 1259 additions and 669 deletions

View File

@@ -0,0 +1,8 @@
<div class="alert alert-{{ $status }}" role="alert">
<div class="container">
<div class="alert-icon">
<i class="now-ui-icons ui-1_bell-53"></i>
</div>
{{ $message }}
</div>
</div>

View File

@@ -0,0 +1,11 @@
@extends('system.installer.app')
@section('title', 'Install phpVMS')
@section('content')
<h3 class="text-center">Click on <b>Start</b> to Continue</h3>
{{ Form::open(['route' => 'installer.step1post', 'method' => 'post']) }}
<p style="text-align: right">
{{ Form::submit('Start >>', ['class' => 'btn btn-success']) }}
</p>
{{ Form::close() }}
@endsection

View File

@@ -0,0 +1,64 @@
@extends('system.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:right;">
@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:right;">
@if($ext['passed'] === true)
<span class="badge badge-success">OK</span>
@else
<span class="badge badge-danger">Failed</span>
@endif
</td>
</tr>
@endforeach
<tr>
<td colspan="2">
<h4>Directory Permissions</h4>
<p>Make sure these directories have read and write permissions</p>
</td>
</tr>
@foreach($directories as $dir)
<tr>
<td>{{ $dir['dir'] }}</td>
<td style="text-align:right;">
@if($dir['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
{{ Form::close() }}
</div>
@endsection

View File

@@ -0,0 +1,161 @@
@extends('system.installer.app')
@section('title', 'Database Setup')
@section('content')
<div style="align-content: center;">
{{ Form::open(['route' => 'installer.envsetup', 'method' => 'POST']) }}
<table class="table" width="25%">
<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>
<p>Enter the target database information</p>
</td>
</tr>
<tr>
<td><p>Database Type</p></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', '127.0.0.1', ['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', '3306', ['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>
<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>
</table>
<div id="dbtest"></div>
<p style="text-align: right">
{{ Form::submit('Setup Database >>', ['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(() => {
const selValue = $("#db_conn option:selected").text();
changeForm(selValue);
$("#db_conn").change((e) => {
const selValue = $("#db_conn option:selected").text();
changeForm(selValue);
});
$("#dbtest_button").click((e) => {
e.preventDefault();
const opts = {
method: 'POST',
url: '/install/dbtest',
data: {
_token: "{{ csrf_token() }}",
db_conn: 'mysql',
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(),
},
};
phpvms.request(opts).then(response => {
$("#dbtest").html(response.data);
});
})
});
</script>
@endsection

View File

@@ -0,0 +1,19 @@
@extends('system.installer.app')
@section('title', 'Database Setup Completed')
@section('content')
<div style="align-content: center;">
{{ Form::open(['route' => 'installer.step3', 'method' => 'GET']) }}
<pre class="lang-sh">
<code class="lang-sh">
{{--<code class="language-bash">--}}
{{ $console_output }}
</code>
</pre>
<p style="text-align: right">
{{ Form::submit('Continue >>', ['class' => 'btn btn-success']) }}
</p>
{{ Form::close() }}
</div>
@endsection

View File

@@ -0,0 +1,119 @@
@extends('system.installer.app')
@section('title', 'User Setup')
@section('content')
<div class="row">
<div class="col-md-12">
<div style="align-content: center;">
{{ Form::open(['route' => 'installer.usersetup', 'method' => 'POST']) }}
<table class="table" width="25%">
<tr>
<td colspan="2" style="text-align: right">
<a href="{{ route('importer.index') }}">Importing from a legacy install?</a>
</td>
</tr>
<tr>
<td colspan="2"><h4>Airline Information</h4></td>
</tr>
<tr>
<td><p>Airline ICAO</p></td>
<td>
<div class="form-group">
{{ Form::input('text', 'airline_icao', null, ['class' => 'form-control']) }}
@include('system.installer.flash/check_error', ['field' => 'airline_icao'])
</div>
</td>
</tr>
<tr>
<td><p>Airline Name</p></td>
<td>
<div class="form-group">
{{ Form::input('text', 'airline_name', null, ['class' => 'form-control']) }}
@include('system.installer.flash/check_error', ['field' => 'airline_name'])
</div>
</td>
</tr>
<tr>
<td><p>Airline Country</p></td>
<td>
<div class="form-group">
{{ Form::select('airline_country', $countries, null, ['class' => 'form-control select2' ]) }}
@include('system.installer.flash/check_error', ['field' => 'airline_country'])
</div>
</td>
</tr>
<tr>
<td colspan="2"><h4>First User</h4></td>
</tr>
<tr>
<td><p>Name</p></td>
<td>
<div class="form-group">
{{ Form::input('text', 'name', null, ['class' => 'form-control']) }}
@include('system.installer.flash/check_error', ['field' => 'name'])
</div>
</td>
</tr>
<tr>
<td><p>Email</p></td>
<td>
<div class="form-group">
{{ Form::input('text', 'email', null, ['class' => 'form-control']) }}
@include('system.installer.flash/check_error', ['field' => 'email'])
</div>
</td>
</tr>
<tr>
<td><p>Password</p></td>
<td>
{{ Form::password('password', ['class' => 'form-control']) }}
@include('system.installer.flash/check_error', ['field' => 'password'])
</td>
</tr>
<tr>
<td width="40%"><p>Password Confirm</p></td>
<td>
{{ Form::password('password_confirmation', ['class' => 'form-control']) }}
@include('system.installer.flash/check_error', ['field' => 'password_confirmation'])
</td>
</tr>
<tr>
<td colspan="2"><h4>Options</h4></td>
</tr>
<tr>
<td><p>Analytics</p></td>
<td>
<div class="form-group">
{{ Form::hidden('telemetry', 0) }}
{{ Form::checkbox('telemetry', 1, true, ['class' => 'form-control']) }}
<br/>
<p>
Allows collection of analytics. They won't identify you, and helps us to track
the PHP and database versions that are used, and help to figure out problems
and slowdowns when vaCentral integration is enabled.
</p>
</div>
</td>
</tr>
</table>
<div id="dbtest"></div>
<p style="text-align: right">
{{ Form::submit('Complete Setup >>', ['class' => 'btn btn-success']) }}
</p>
{{ Form::close() }}
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,20 @@
@extends('system.installer.app')
@section('title', 'Installation Completed!')
@section('content')
<div style="align-content: center;">
{{ Form::open(['route' => 'installer.complete', 'method' => 'GET']) }}
<h4>Installer Completed!</h4>
<p>Edit the <span class="code">config.php</span> to fill in some additional settings. </p>
<p>Click the button to proceed to the login screen!</p>
<p style="text-align: right">
{{ Form::submit('Install Complete! Continue to Log-In >>',
['class' => 'btn btn-success'])
}}
</p>
{{ Form::close() }}
</div>
@endsection