mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Added LDAP settings check in settings page
This commit is contained in:
parent
c8351ae01b
commit
ff6c3cfa17
|
@ -21,8 +21,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach ($settings as $setting)
|
@foreach ($settings as $setting)
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -147,6 +155,24 @@
|
||||||
<td>{{ trans('general.no') }}</td>
|
<td>{{ trans('general.no') }}</td>
|
||||||
@endif
|
@endif
|
||||||
</tr>
|
</tr>
|
||||||
|
@if ($setting->ldap_enabled == 1)
|
||||||
|
<tr id="ldaptestrow">
|
||||||
|
<td class="col-md-4">Test LDAP Connection</td>
|
||||||
|
<td class="col-md-8">
|
||||||
|
|
||||||
|
<a class="btn btn-default btn-sm pull-left" id="ldaptest" style="margin-right: 10px;"> Test LDAP</a>
|
||||||
|
|
||||||
|
<span id="ldaptesticon">
|
||||||
|
</span>
|
||||||
|
<span id="ldaptestresult">
|
||||||
|
</span>
|
||||||
|
<span id="ldapteststatus">
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -215,5 +241,41 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@section('moar_scripts')
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$("#ldaptest").click(function(){
|
||||||
|
$("#ldaptestrow").removeClass('success');
|
||||||
|
$("#ldaptestrow").removeClass('danger');
|
||||||
|
$.ajax({
|
||||||
|
url: '{{ route('settings/ldaptest') }}',
|
||||||
|
type: 'GET',
|
||||||
|
data: {},
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
success: function (data) {
|
||||||
|
// console.dir(data);
|
||||||
|
//console.log(data.responseJSON.message);
|
||||||
|
$("#ldaptestrow").addClass('success');
|
||||||
|
$("#ldapteststatus").html('<i class="fa fa-check text-success"></i>It worked!');
|
||||||
|
//$('#ldapteststatus').html('<i class="fa fa-check text-success"></i>');
|
||||||
|
},
|
||||||
|
|
||||||
|
error: function (data) {
|
||||||
|
//console.dir(data);
|
||||||
|
//console.log(data.responseJSON.message);
|
||||||
|
$("#ldaptestrow").addClass('danger');
|
||||||
|
$("#ldaptesticon").html('<i class="fa fa-exclamation-triangle text-danger"></i>');
|
||||||
|
$('#ldapteststatus').text(data.responseJSON.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
@stop
|
||||||
@stop
|
@stop
|
||||||
|
|
Loading…
Reference in a new issue