aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/src/routes/submission_matches
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-02-02 19:36:18 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-02-02 19:36:18 +0100
commitdb45cea37e8070e1572cdc25121c46022780f51d (patch)
tree8d522c51f760c691f06267d599f29868591288f1 /web/pw-server/src/routes/submission_matches
parent2e3606f1b6ba59975b3a0141ed3b2f6286c66ec3 (diff)
downloadplanetwars.dev-db45cea37e8070e1572cdc25121c46022780f51d.tar.xz
planetwars.dev-db45cea37e8070e1572cdc25121c46022780f51d.zip
temporary setup for showing submission match result
Diffstat (limited to 'web/pw-server/src/routes/submission_matches')
-rw-r--r--web/pw-server/src/routes/submission_matches/[match_id].svelte31
1 files changed, 31 insertions, 0 deletions
diff --git a/web/pw-server/src/routes/submission_matches/[match_id].svelte b/web/pw-server/src/routes/submission_matches/[match_id].svelte
new file mode 100644
index 0000000..586b2c2
--- /dev/null
+++ b/web/pw-server/src/routes/submission_matches/[match_id].svelte
@@ -0,0 +1,31 @@
+<script lang="ts" context="module">
+ export async function load({ page }) {
+ const res = await fetch(`/api/submission_match_log/${page.params["match_id"]}`, {
+ headers: {
+ "Content-Type": "application/json",
+ },
+ });
+
+ if (res.ok) {
+ return {
+ props: {
+ matchLog: await res.text(),
+ },
+ };
+ }
+
+ return {
+ status: res.status,
+ error: new Error("failed to load match"),
+ };
+ }
+</script>
+
+<script lang="ts">
+ import Visualizer from "$lib/components/Visualizer.svelte";
+ export let matchLog: string;
+</script>
+
+<div>
+ <Visualizer {matchLog} />
+</div>