ui: New button to launch all tests

This commit is contained in:
nemunaire 2023-03-05 04:10:50 +01:00
parent 936a8a80f4
commit 6f9b83ef24
1 changed files with 30 additions and 7 deletions

View File

@ -32,6 +32,18 @@
repositoriesP[userid] = getRepositories(wid, userid);
}
async function runGradations() {
for (const user of await usersP) {
if (repositoriesP[user.id]) {
try {
for (const repo of await repositoriesP[user.id]) {
repo.runGradation();
}
} catch {}
}
}
}
let nb_rendus = 0;
let nb_users = 0;
@ -40,13 +52,24 @@
let search_repo_for = {repo: null, user: null};
</script>
<div class="d-flex align-items-center">
<h2>
<a href="works/{w.id}" class="text-muted" style="text-decoration: none">&lt;</a>
{w.title}
<small class="text-muted">Rendus {Math.trunc(nb_rendus/nb_users*100)}&nbsp;% ({nb_rendus}/{nb_users})</small>
</h2>
<SurveyBadge class="ms-2" survey={w} />
<div class="d-flex justify-content-between">
<div class="d-flex align-items-center">
<h2>
<a href="works/{w.id}" class="text-muted" style="text-decoration: none">&lt;</a>
{w.title}
<small class="text-muted">Rendus {Math.trunc(nb_rendus/nb_users*100)}&nbsp;% ({nb_rendus}/{nb_users})</small>
</h2>
<SurveyBadge class="ms-2" survey={w} />
</div>
<div>
<button
class="btn btn-sm btn-success mr-1"
title="Relancer les tests"
on:click={runGradations}
>
<i class="bi bi-play"></i>
</button>
</div>
</div>
{#await usersP then users}