Finalisation de Google Drive

This commit is contained in:
George Frederick "Buzz" Beurling
2020-03-10 16:26:48 -04:00
parent 8189bbce9a
commit 763e00435c
16 changed files with 798 additions and 751 deletions

View File

@@ -11,39 +11,34 @@
@csrf
<div class="row ml-2">
<h3 class="col-12">Google Drive</h3>
<div class="col-6">
<div class="col-md-6">
<div class="alert alert-info" role="alert">
Vous pouvez suivre un <a class="alert-link" target="_blank" href="https://github.com/ivanvermeyen/laravel-google-drive-demo/blob/master/README/1-getting-your-dlient-id-and-secret.md">tutoriel (Anglais) <i class="fas fa-external-link-square-alt text-white"></i></a> pour trouver c'est information.
</div>
</div>
<div class="col-md-6">
@if($error == [])
<div class="alert alert-primary" role="alert">
Google Drive est initialisé correctement
<div id="loaderDot" class="float-right d-none" style="margin-top: -30px;">
@loaderDot
</div>
<div class="float-right" id="btn-sync">
<button type="button" class="btn btn-round btn-fab" style="margin-top: -0.55rem" onclick="checkFileSystem()">
<i class="fas fa-sync"></i>
</button>
<div id="google-drive-status" class="alert alert-primary" role="alert">
<div class="row pb-1">
<div class="col-10" id="google-drive-status-text">
Google Drive est initialisé correctement
</div>
<div class="col-2">
<div id="loaderDot" class="float-right d-none" style="margin-top: -30px;height: 41px">
@loaderDot
</div>
<div class="float-right" id="btn-sync">
<button type="button" class="btn btn-round btn-fab" style="margin-top: -0.55rem" onclick="checkFileSystem()">
<i class="fas fa-sync"></i>
</button>
</div>
</div>
</div>
</div>
@else
<div class="alert alert-danger" role="alert">
Problème détecté avec votre installation ...
<ul>
@foreach($error as $e)
<li>{{$e}}</li>
@endforeach
</ul>
</div>
@endif
</div>
<div class="col-md-8 p-2">
<div class="togglebutton">
<label>
<input type="checkbox" checked="">
<input id="is_active" type="checkbox" data-toggle="switch" name="is_active">
<span class="toggle"></span>
Activer Google Drive
</label>
@@ -103,11 +98,45 @@ Configuration du système de fichier
@section('custom_scripts')
<script>
if({{\App\Config::getData('is_Google_Drive_enabled')}})
{
$('#is_active').prop( "checked", true );
}
else
{
$('#is_active').prop( "checked", false );
}
checkFileSystem();
function checkFileSystem() {
$('#loaderDot').removeClass('d-none');
$('#btn-sync').addClass('d-none');
let text = $('#google-drive-status-text');
let div = $('#google-drive-status');
div.removeClass('alert-primary');
div.addClass('alert-info');
text.html("Vérification du système de fichier ...");
$.get('/api/drive/checkfilestructure',{api_token: api_token}, function (data) {
console.log('data');
if(data.length != 0)
{
div.removeClass('alert-primary');
div.removeClass('alert-info');
div.removeClass('alert-danger');
div.addClass('alert-danger');
text.html("");
data.forEach(d => {
text.append(d);
console.log(d);
});
}
else
{
div.removeClass('alert-primary');
div.removeClass('alert-info');
div.removeClass('alert-danger');
div.addClass('alert-primary');
text.html("Google Drive est initialisé correctement");
}
$('#loaderDot').addClass('d-none');
$('#btn-sync').removeClass('d-none');
})