Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove laravelcollective/html from installer, updater and importer #1807

Merged
merged 7 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions resources/views/system/importer/complete.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
@section('title', 'Import Completed!')

@section('content')
<div style="align-content: center;">
{{ Form::open(['route' => 'importer.complete', 'method' => 'GET']) }}
<div style="align-content: center;">
<form method="get" action="{{ route('importer.complete') }}">
@csrf
<h4>Installer Completed!</h4>

<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>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('Import Complete! Continue to Log-In >>',
['class' => 'btn btn-success'])
}}
</p>
{{ Form::close() }}
</div>
<p style="text-align: right">
<button type="submit" class="btn btn-success">Import Complete! Continue to Log-In >></button>
</p>
</form>
</div>
@endsection
225 changes: 114 additions & 111 deletions resources/views/system/importer/step1-configure.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,128 +2,131 @@
@section('title', 'Import Configuration')

@section('content')
<div style="align-content: center;">
{{ Form::open(['route' => 'importer.config', 'method' => 'POST']) }}
<table class="table">
<tr>
<td colspan="2">
<h4>IMPORTANT NOTES</h4>
<ul>
<li>The first user's password (admin) will be "admin". Please change it after logging in</li>
<li>User passwords will be reset and they will need to use "Forgot Password" to reset it</li>
<li>If you have more than 1000 PIREPs or flights, it's best to use the command-line importer!
<a href="{{ docs_link('importing_legacy') }}" target="_blank">Click here</a> to
see the documentation of how to use it.
</li>
<li><strong>THIS WILL WIPE OUT YOUR EXISTING DATA</strong> - this is required to make sure that things like
pilot IDs match up
</li>
</ul>
</td>
</tr>
<div style="align-content: center;">
<form method="post" action="{{ route('importer.config') }}">
@csrf
<table class="table">
<tr>
<td colspan="2">
<h4>IMPORTANT NOTES</h4>
<ul>
<li>The first user's password (admin) will be "admin". Please change it after logging in</li>
<li>User passwords will be reset and they will need to use "Forgot Password" to reset it</li>
<li>If you have more than 1000 PIREPs or flights, it's best to use the command-line importer!
<a href="{{ docs_link('importing_legacy') }}" target="_blank">Click here</a> to
see the documentation of how to use it.
</li>
<li><strong>THIS WILL WIPE OUT YOUR EXISTING DATA</strong> - this is required to make sure that
things like
pilot IDs match up
</li>
</ul>
</td>
</tr>

<tr>
<td colspan="2">
<h4>Database Config</h4>
<p>Enter the database information for your legacy phpVMS installation</p>
</td>
</tr>
<tr>
<td colspan="2">
<h4>Database Config</h4>
<p>Enter the database information for your legacy phpVMS installation</p>
</td>
</tr>

<tbody id="mysql_settings">
<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>
<tbody id="mysql_settings">
<tr>
<td>Database Host</td>
<td style="text-align:center;">
<div class="form-group">
<input type="text" name="db_host" value="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 Port</td>
<td style="text-align:center;">
<div class="form-group">
<input type="text" name="db_port" value="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 Name</td>
<td style="text-align:center;">
<div class="form-group">
<input type="text" name="db_name" value="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 User</td>
<td style="text-align:center;">
<div class="form-group">
<input type="text" name="db_user" 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>Database Password</td>
<td style="text-align:center;">
<div class="form-group">
<input type="text" name="db_pass" 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>
<tr>
<td colspan="2" style="text-align: right;">
<button type="submit" class="btn btn-info" id="dbtest_button">Test Database
Credentials</button>
</td>
</tr>
</tbody>

<tr>
<td>Database Prefix</td>
<td style="text-align:center;">
<div class="form-group">
{{ Form::input('text', 'db_prefix', 'phpvms_', ['class' => 'form-control']) }}
<p>Prefix of the tables, if you're using one</p>
</div>
</td>
</tr>
<tr>
<td>Database Prefix</td>
<td style="text-align:center;">
<div class="form-group">
<input type="text" name="db_prefix" value="phpvms_" class="form-control" />
<p>Prefix of the tables, if you're using one</p>
</div>
</td>
</tr>

</table>
<div id="dbtest"></div>
<p style="text-align: right">
{{ Form::submit('Start Importer >>', ['class' => 'btn btn-success']) }}
</p>
{{ Form::close() }}
</div>
</table>
<div id="dbtest"></div>
<p style="text-align: right">
<button type="submit" class="btn btn-success">Start Importer >></button>
</p>
</form>
</div>
@endsection

@section('scripts')
<script>
$(document).ready(() => {
$("#dbtest_button").click((e) => {
e.preventDefault();
const opts = {
method: 'POST',
url: '/importer/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(),
},
};
<script>
$(document).ready(() => {
$("#dbtest_button").click((e) => {
e.preventDefault();
const opts = {
method: 'POST',
url: '/importer/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>
phpvms.request(opts).then(response => {
$("#dbtest").html(response.data);
});
});
});
</script>
@endsection
10 changes: 4 additions & 6 deletions resources/views/system/importer/step2-processing.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

@section('content')
<div style="align-content: center;">
{{ Form::open(['route' => 'importer.complete', 'method' => 'POST']) }}
<form method="post" action="{{ route('importer.complete') }}">
@csrf
<table class="table" width="25%">

<tr>
Expand All @@ -24,12 +25,9 @@

</table>
<p style="text-align: right">
{{ Form::submit('Complete Import', [
'id' => 'completebutton',
'class' => 'btn btn-success'
]) }}
<button type="submit" class="btn btn-success" id="completebutton">Complete Import</button>
</p>
{{ Form::close() }}
</form>
</div>
@endsection

Expand Down
11 changes: 6 additions & 5 deletions resources/views/system/installer/install/index-start.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

@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() }}
<form method="post" action="{{ route('installer.step1post') }}">
@csrf
<p style="text-align: right">
<button type="submit" class="btn btn-success">Start >></button>
</p>
</form>
@endsection
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

@section('content')
<div style="align-content: center;">
{{ Form::open(['route' => 'installer.step2', 'method' => 'GET']) }}
<form method="get" action="{{ route('installer.step2') }}">
@csrf
<table class="table" width="25%">
<tr>
<td colspan="2"><h4>php version</h4></td>
Expand Down Expand Up @@ -56,9 +57,9 @@
</table>
@if($passed === true)
<p style="text-align: right">
{{ Form::submit('Database Setup >>', ['class' => 'btn btn-success']) }}
<button type="submit" class="btn btn-success">Database Setup >></button>
</p>
@endif
{{ Form::close() }}
</form>
</div>
@endsection
Loading
Loading