New route to run gradation tests
This commit is contained in:
parent
7340e10a7a
commit
735a120259
3 changed files with 125 additions and 6 deletions
|
|
@ -76,6 +76,18 @@ export class WorkRepository {
|
|||
}
|
||||
}
|
||||
|
||||
async runGradation() {
|
||||
const res = await fetch(this.id_work?`api/works/${this.id_work}/repositories/${this.id}/gradation`:`api/repositories/${this.id}/gradation`, {
|
||||
method: 'POST',
|
||||
headers: {'Accept': 'application/json'},
|
||||
});
|
||||
if (res.status == 200) {
|
||||
return await res.json();
|
||||
} else {
|
||||
throw new Error((await res.json()).errmsg);
|
||||
}
|
||||
}
|
||||
|
||||
async save(user) {
|
||||
let url = this.id?`repositories/${this.id}`:'repositories';
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@
|
|||
<tbody>
|
||||
{#each users as user (user.id)}
|
||||
<tr>
|
||||
<td><a href="users/{user.login}">{user.login}</a></td>
|
||||
<td>
|
||||
<td><a href="users/{user.login}" class="text-truncate">{user.login}</a></td>
|
||||
<td class="text-center">
|
||||
<SubmissionStatus work={w} user={user} on:done={() => { nb_rendus += 1; show_dl_btn[user.id] = true; }} />
|
||||
</td>
|
||||
<td>
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
<code class="text-truncate mx-1">
|
||||
{repo.uri}
|
||||
</code>
|
||||
<div class="mx-1">
|
||||
<div class="mx-1" style="white-space: nowrap">
|
||||
{#if repo.last_check}
|
||||
<DateFormat date={new Date(repo.last_check)} dateStyle="medium" timeStyle="medium" />
|
||||
<BuildState
|
||||
|
|
@ -100,6 +100,14 @@
|
|||
>
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-sm btn-success mr-1"
|
||||
class:disabled={!show_dl_btn[user.id]}
|
||||
title="Relancer les tests"
|
||||
on:click={() => { repo.runGradation(); }}
|
||||
>
|
||||
<i class="bi bi-play"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
|
|
@ -118,7 +126,7 @@
|
|||
{/await}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<td class="d-flex gap-1">
|
||||
<a
|
||||
href="/api/users/{user.id}/works/{w.id}/download"
|
||||
class="btn btn-sm btn-dark"
|
||||
|
|
|
|||
Reference in a new issue