db in one refactor WIP2

This commit is contained in:
Tony Murray
2020-06-17 06:59:19 -05:00
parent ed3e818413
commit 246e6741a3
3 changed files with 10 additions and 9 deletions

View File

@@ -59,8 +59,9 @@ class InstallationController extends Controller
public function stepsCompleted()
{
return response()->json(array_map(function ($controller) {
return $controller::enabled($this->steps);
return response()->json(array_map(function ($class) {
$controller = app()->make($class);
return $controller->enabled($this->steps);
}, $this->steps));
}

View File

@@ -63,7 +63,7 @@
</form>
</div>
</div>
<div id="migration-output" class="row">
<div id="migration-output" class="row install-show-migrate">
<div class="col-12">
<label for="db-update">@lang('install.migrate.building')<br />@lang('install.migrate.building_interrupt')</label>
<textarea readonly id="db-update" class="form-control" rows="20" placeholder="@lang('install.migrate.wait')"></textarea>
@@ -83,7 +83,7 @@
$('#database-form').submit(function (event) {
event.preventDefault();
$('#database-status>i').attr('class', 'fa fa-2x fa-spinner fa-spin');
$('.db-error').remove();
$('#error-box').empty();
$.ajax({
type: 'POST',

View File

@@ -81,8 +81,7 @@
@foreach($steps as $step => $controller)
<div>
<a href="{{ route('install.' . $step) }}"
id="install-{{ $step }}-button"
class="btn btn-info btn-circle @if(!$controller->enabled($steps)) disabled @endif"
class="install-enable-{{ $step }} btn btn-info btn-circle @if(!$controller->enabled($steps)) disabled @endif"
title="@lang("install.$step.title")"
>
<i class="fa fa-lg {{ $controller->icon() }}"></i>
@@ -117,11 +116,12 @@
.success(function (data) {
console.log(data);
Object.keys(data).forEach(function (key) {
var button = $('#install-' + key + '-button');
if (data[key]) {
button.removeClass('disabled')
$('.install-enable-' + key).removeClass('disabled');
$('.install-show-' + key).show();
} else {
button.addClass('disabled')
$('.install-enable-' + key).addClass('disabled');
$('.install-show-' + key).hide();
}
});
})