fix: increase investigate time; more feedback (#8457)
This commit is contained in:
parent
567d55fa12
commit
9a72cc0d6a
|
@ -18,13 +18,13 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
loadResultsFromTask('bogus-task-id') // bad task id will generate an error from Django
|
||||
}
|
||||
const taskId = (await response.json()).id
|
||||
// Poll for completion of the investigation up to 18*10 = 180 seconds
|
||||
waitForResults(taskId, 18)
|
||||
// Poll for completion of the investigation up to 60*10 = 600 seconds
|
||||
waitForResults(taskId, 60)
|
||||
}
|
||||
|
||||
const waitForResults = async (taskId, retries) => {
|
||||
// indicate that investigation is in progress
|
||||
document.getElementById('spinner').classList.remove('d-none')
|
||||
document.querySelectorAll('.investigation-indicator').forEach(elt => elt.classList.remove('d-none'))
|
||||
document.getElementById('investigate-button').disabled = true
|
||||
investigateForm.elements['id_name_fragment'].disabled = true
|
||||
|
||||
|
|
|
@ -13,13 +13,15 @@
|
|||
{% csrf_token %}
|
||||
{% bootstrap_form form %}
|
||||
<button class="btn btn-primary" type="submit" id="investigate-button">
|
||||
<span id="spinner"
|
||||
class="spinner-border spinner-border-sm d-none"
|
||||
role="status"
|
||||
aria-hidden="true">
|
||||
</span>
|
||||
<span class="spinner-border spinner-border-sm investigation-indicator d-none"
|
||||
role="status"
|
||||
aria-hidden="true">
|
||||
</span>
|
||||
Investigate
|
||||
</button>
|
||||
<div class="alert alert-info mt-3 d-none investigation-indicator">
|
||||
Please be patient, processing may take several minutes.
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% if results %}
|
||||
|
|
Loading…
Reference in a new issue