{% extends "layout.html" %}
{% block title %}Rescan{% endblock %}
{% block body %}
  <div class="progress">
    <div id="progression" class="progress-bar progress-bar-striped" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
  </div>
  <script>
    $(document).ready(function() {
        var ws = new WebSocket('wss://' + document.domain + ':' + location.port + '/collection/progression');
        ws.onmessage = function (event) {
            console.log('Progression: ' + event.data);
            $('div#progression').html(event.data+'%').css('width', event.data+'%').prop('aria-valuenow', event.data);
        };
    });
  </script>
{% endblock %}
