ui: Display a spinner during gradation launch
This commit is contained in:
parent
906501cc7b
commit
a78de73671
@ -32,16 +32,21 @@
|
||||
repositoriesP[userid] = getRepositories(wid, userid);
|
||||
}
|
||||
|
||||
let gradation_preflight = false;
|
||||
async function runGradations() {
|
||||
gradation_preflight = true;
|
||||
for (const user of await usersP) {
|
||||
if (repositoriesP[user.id]) {
|
||||
try {
|
||||
for (const repo of await repositoriesP[user.id]) {
|
||||
repo.runGradation();
|
||||
}
|
||||
} catch {}
|
||||
} catch (err) {
|
||||
ToastsStore.addToast({color: "danger", title: "Impossible de lancer la notation de " + user.login, msg: err})
|
||||
}
|
||||
}
|
||||
}
|
||||
gradation_preflight = false;
|
||||
}
|
||||
|
||||
let nb_rendus = 0;
|
||||
@ -66,8 +71,13 @@
|
||||
class="btn btn-sm btn-success mr-1"
|
||||
title="Relancer les tests"
|
||||
on:click={runGradations}
|
||||
disabled={gradation_preflight}
|
||||
>
|
||||
<i class="bi bi-play"></i>
|
||||
{#if gradation_preflight}
|
||||
<div class="spinner-border spinner-border-sm" role="status"></div>
|
||||
{:else}
|
||||
<i class="bi bi-play"></i>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user