Skip to content

Commit

Permalink
add admin tool to recompute on index
Browse files Browse the repository at this point in the history
  • Loading branch information
spookybear0 committed Sep 23, 2024
1 parent c64477f commit bbc0b20
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions assets/html/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@
});
}

function recompute_sm5_scores() {
alert("Recomputing SM5 scores in background...");
fetch("/admin/recompute_sm5_scores", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-CSRFToken": getCookie("csrftoken")
}
});
}

function flush_cache() {
alert("Flushing cache in background...");
fetch("/admin/flush_cache", {
Expand Down Expand Up @@ -120,6 +131,7 @@ <h1 style="text-align: center;">Dashboard</h1>
<button onclick="recalculate_sm5_ratings()" class="button">Recalculate SM5 Ratings</button>
<button onclick="recalculate_laserball_ratings()" class="button">Recalculate Laserball Ratings</button>
<button onclick="flush_cache()" class="button">Flush Cache</button>
<button onclick="recompute_sm5_scores()" class="button">Recompute SM5 Scores</button>
</div>

<!-- Banner -->
Expand Down

0 comments on commit bbc0b20

Please sign in to comment.