28 lines
		
	
	
		
			908 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			908 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
<!DOCTYPE html>
 | 
						|
<html>
 | 
						|
<body>
 | 
						|
    <h1>Processing {{.Filename}}</h1>
 | 
						|
    <div id="progress">0%</div>
 | 
						|
    <div id="currentFile"></div>
 | 
						|
    <script>
 | 
						|
        function updateProgress() {
 | 
						|
            fetch('/progress?filename={{.Filename}}', {
 | 
						|
                headers: {
 | 
						|
                    'Accept': 'application/json'
 | 
						|
                }
 | 
						|
            })
 | 
						|
                .then(response => response.json())
 | 
						|
                .then(data => {
 | 
						|
                    const progress = Math.round(data.Percentage);
 | 
						|
                    document.getElementById('progress').innerText = progress + '%';
 | 
						|
                    document.getElementById('currentFile').innerText = 'Current file: ' + (data.CurrentFile || 'None');
 | 
						|
                    if (progress < 100) {
 | 
						|
                        setTimeout(updateProgress, 1000);
 | 
						|
                    }
 | 
						|
                });
 | 
						|
        }
 | 
						|
        updateProgress();
 | 
						|
    </script>
 | 
						|
</body>
 | 
						|
</html>
 |