templates/computing/bulk_compute.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Calcul des temps{% endblock %}
  3. {% block body %}
  4. <div class="row">
  5.     <div class="col-12">
  6.         <div class="card">
  7.             <div class="card-body">
  8.                 <h2>CALCUL DES TEMPS EN COURS</h2>
  9.                 <br/>
  10.                 Avancement :  <span id="progressPercentage">0</span>%
  11.                 <br/>
  12.                 <div class="progress">
  13.                     <div id="progressBar" class="progress-bar progress-bar-striped bg-info" role="progressbar" style="width: 0%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100">
  14.                     </div>
  15.                 </div>
  16.                 <div id="actionFinished" style="display: none">
  17.                     <br/>
  18.                     <br/>
  19.                     <div class="alert alert-info" role="alert">
  20.                         Calcul terminé
  21.                         <br/>
  22.                         <a class="btn btn-outline-secondary waves-effect"  href="{{ path('app_computing_show', {'id': computing.id}) }}">Revenir à la liste</a>
  23.                     </div>
  24.                 </div>
  25.             </div>
  26.         </div>
  27.         <script>
  28.             let limit = 5;
  29.             let offset = 0;
  30.             let work_done = true;
  31.             function compute(offset) {
  32.                 var url = "/computing/{{ computing.id }}/ajax_geocode/"+limit+"/"+offset;
  33.                 var jqxhr = $.get( url , function(data) {
  34.                     $('#progressPercentage').html(data.percentage);
  35.                     $('#progressBar').width(data.percentage+'%');
  36.                     if(data.continue  == true){
  37.                         compute(offset+limit);
  38.                     }
  39.                     else {
  40.                         $('#actionFinished').show();
  41.                     }
  42.                 })
  43.                 .done(function() {
  44.                 })
  45.             }
  46.             compute(0);
  47.         </script>
  48.     </div>
  49. </div>
  50. {% endblock %}