mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
db in one refactor WIP2
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
@@ -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',
|
||||
|
@@ -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();
|
||||
}
|
||||
});
|
||||
})
|
||||
|
Reference in New Issue
Block a user