<!--
SPDX-FileCopyrightText: 2022 PeARS Project, <community@pearsproject.org>, 

SPDX-License-Identifier: AGPL-3.0-only
-->

<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"
        integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
        <script>

	var source = new EventSource("/pod_finder/progress_file");
	source.onmessage = function(event) {
		$('.progress-bar').css('width', event.data+'%').attr('aria-valuenow', event.data);
		$('.progress-bar-label').text(event.data+'%');

		if(event.data == 100){
			source.close()
		}
	}
	</script>


        <title>PeARS - Indexing the World Wide Web, together</title>
    </head>

    <body>
    <nav class="navbar navbar-default">
    <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <!-- <a class="navbar-brand" href="#">Brand</a> -->
      <a href="{{ url_for('search.index')}}" class="navbar-left"><img src="{{ url_for('static', filename='pears-logo-small.png')}}" height="50px"></a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li><a href="{{url_for('search.index')}}">Search</a></li>
        <li><a href="{{url_for('indexer.index')}}">Indexer</a></li>
        <li><a href="{{url_for('pod_finder.index')}}">Pod management</a></li>
        <li><a href="{{url_for('orchard.index')}}">My orchard</a></li>
        <li><a href="{{url_for('admin.index')}}">DB admin</a></li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
        <li><a href="{{url_for('pages.return_faq')}}">F.A.Q.</a></li>
        <li><a href="{{url_for('pages.return_acknowledgements')}}">Acknowledgments</a></li>
      </ul>
    </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
    </nav>

    <div class="container">

        <div  class="row">
            <div class="col-md-6">
            <br><br>
            <p><b>Index from file</b></p>
            <p>Your PeARS install is recording your chosen pod file.</p>
            <p>Once the progress bar is on 100%, you can leave this page and search the pages you have just indexed.</p>
            </div>
            <div class="col-md-6">
            <br><br>
            <div class="progress" style="width: 50%; margin: 50px;">
		<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
			<span class="progress-bar-label">0%</span>
            </div>
        </div>

    </div><!-- /.container -->
    </body>
</html>

