mirror of
https://github.com/0ceanSlim/grain.git
synced 2024-10-29 17:16:31 +00:00
import spinner working
This commit is contained in:
parent
a2f7f0a5b4
commit
41c7998831
@ -63,7 +63,7 @@ func ImportEvents(w http.ResponseWriter, r *http.Request) {
|
||||
renderResult(w, true, "Events imported successfully", totalEvents)
|
||||
case err := <-errorChan:
|
||||
renderResult(w, false, err.Error(), 0)
|
||||
case <-time.After(5 * time.Minute):
|
||||
case <-time.After(10 * time.Minute): // Increase timeout for large imports
|
||||
renderResult(w, false, "Timeout importing events", 0)
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div id="spinner" class="spinner"></div>
|
||||
<div id="spinner" class="spinner" style="display: none"></div>
|
||||
<div id="result" class="p-2 m-2 text-xl font-bold"></div>
|
||||
<button
|
||||
hx-get="/"
|
||||
@ -56,11 +56,13 @@
|
||||
document.getElementById("spinner").style.display = "block";
|
||||
});
|
||||
|
||||
document
|
||||
.getElementById("result")
|
||||
.addEventListener("htmx:afterRequest", function () {
|
||||
document.getElementById("spinner").style.display = "none";
|
||||
});
|
||||
document.addEventListener("htmx:afterRequest", function () {
|
||||
document.getElementById("spinner").style.display = "none";
|
||||
});
|
||||
|
||||
document.addEventListener("htmx:requestError", function () {
|
||||
document.getElementById("spinner").style.display = "none";
|
||||
});
|
||||
</script>
|
||||
</main>
|
||||
{{end}}
|
||||
|
Loading…
Reference in New Issue
Block a user