summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/index.html b/index.html
index e542138..f12c585 100644
--- a/index.html
+++ b/index.html
@@ -17,6 +17,23 @@
<input type="submit" value="Update random player">
</form>
</p>
+ <p>
+ <form id="crunch-form">
+ <div>
+ <input type="text" id="crunch-on">
+ <label for="crunch-on">Table</label>
+ </div>
+ <div>
+ <input type="text" id="crunch-filter">
+ <label for="crunch-filter">Filter</label>
+ </div>
+ <div>
+ <input type="text" id="crunch-value">
+ <label for="crunch-value">Filter value</label>
+ </div>
+ <input type="submit" value="Crunch stats">
+ </form>
+ </p>
<ul id="updates"></ul>
@@ -82,6 +99,18 @@
subscribe(resp.name);
});
});
+
+ $("#crunch-form").submit((e) => {
+ e.preventDefault();
+ let dimension_on = $("#crunch-on").val(),
+ data = {};
+ data[$("#crunch-filter").val()] = $("#crunch-value").val();
+ $.ajax("/api/stats/" + dimension_on + "/update", {
+ data: JSON.stringify(data),
+ contentType: "application/json",
+ type: "POST"
+ });
+ });
</script>
</body>
</html>