Using a JavaScript timer, an Ajax call can be made to get the progress and update a progress bar. The standard template uses bootstrap which has a progress bar.
If you don’t like polling, you can use websockets so the server can use a timer to push notifications. If websockets are not supported by your serve, you can use signal/r. But probably polling is the best.
Change action to return json progress percent
Then something like:
function updateProgress(percentage){
if(percentage > 100) percentage = 100;
$('#progressBar').css('width', percentage+'%');
$('#progressBar').html(percentage+'%');
}
function fetchProgress() {
fetch('status/progress’)
.then(response => response.json())
.then(data => {
updateProgress(data);
If (data < 100)
setTimeout(fetchProgress,1000;
});;
}
}