Commit 1f7ddfe6 authored by Romain Loth's avatar Romain Loth

[temporary FIX] import ngramlists: add a timeout message to say that the...

[temporary FIX] import ngramlists: add a timeout message to say that the import is going on in background
parent c5bd5c56
...@@ -131,7 +131,7 @@ em { ...@@ -131,7 +131,7 @@ em {
   
<!-- save/import button --> <!-- save/import button -->
<button id="ImportListOrSaveAll" class="btn btn-warning" style="font-size:120%" <button id="ImportListOrSaveAll" class="btn btn-warning" style="font-size:120%"
onclick="$('#csvimport').modal('show');"> onclick="$('#csvimport').modal('show'); document.getElementById('importsubmit').disabled = false ;">
<b>Import a Termlist</b> <b>Import a Termlist</b>
</button> </button>
</div> </div>
...@@ -437,13 +437,22 @@ function listmergeCsvPost(theFile){ ...@@ -437,13 +437,22 @@ function listmergeCsvPost(theFile){
// reload after 3s // reload after 3s
setTimeout("location.reload(true)", 3000); setTimeout("location.reload(true)", 3000);
}, },
error: function(result) { error: function(result, t) {
my_html = '<h3 style="color:red">Error</h3>' if (t != 'timeout') {
my_html += "<p class='note'>please correct your CSV file and retry</p>" my_html = '<h3 style="color:red">Error</h3>'
my_html += "<p>"+ result.responseJSON['err']+"</p>" my_html += "<p class='note'>please correct your CSV file and retry</p>"
my_html += "<p>"+ result.responseJSON['err']+"</p>"
}
else {
my_html = '<h3 style="color:red">Timeout</h3>'
my_html += "<p>The CSV import timed out.</p>"
my_html += "<p>(This bug is currently being fixed. <br/>The import and indexation are now continuing in background on our servers. Results will show in a few minutes.)</p>"
document.getElementById('importsubmit').disabled = true
}
$('#formanswer').html(my_html); $('#formanswer').html(my_html);
console.error(result); console.error(result);
}, },
timeout: 15000 // 15s
}); });
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment