Add versioning workaround support for batch actions
* add `can_cancel` flag for progress page, hide button if set * overhaul populate/refresh/execute to launch socket/subprocess if necessary
This commit is contained in:
parent
cc6fa7058b
commit
44ff02b7af
4 changed files with 241 additions and 98 deletions
|
@ -20,6 +20,7 @@
|
|||
|
||||
updater = setInterval(function() {update_progress()}, 1000);
|
||||
|
||||
% if can_cancel:
|
||||
$(function() {
|
||||
|
||||
$('#cancel button').click(function() {
|
||||
|
@ -39,6 +40,7 @@
|
|||
});
|
||||
|
||||
});
|
||||
% endif
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
@ -60,9 +62,11 @@
|
|||
</table><!-- #progress -->
|
||||
</td>
|
||||
<td id="percentage"></td>
|
||||
% if can_cancel:
|
||||
<td id="cancel">
|
||||
<button type="button" style="display: none;">Cancel</button>
|
||||
</td>
|
||||
% endif
|
||||
</tr>
|
||||
</table><!-- #progress-wrapper -->
|
||||
|
||||
|
@ -86,10 +90,14 @@
|
|||
} else if (data.complete || data.maximum) {
|
||||
$('#message').html(data.message);
|
||||
$('#total').html('('+data.maximum_display+' total)');
|
||||
% if can_cancel:
|
||||
$('#cancel button').show();
|
||||
% endif
|
||||
if (data.complete) {
|
||||
clearInterval(updater);
|
||||
% if can_cancel:
|
||||
$('#cancel button').hide();
|
||||
% endif
|
||||
$('#total').html('done!');
|
||||
$('#complete').css('width', '100%');
|
||||
$('#remaining').hide();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue