From 1cde40b45916d1f99a4cda7837b516cde761f127 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sun, 2 Jan 2022 17:57:40 +0100 Subject: [PATCH] basic match views --- web/pw-server/package.json | 4 +- web/pw-server/src/app.html | 31 ++++++---- .../src/lib/components/Visualizer.svelte | 57 +++++++++++++++++++ web/pw-server/src/routes/bots/[bot_id].svelte | 1 - .../src/routes/matches/[match_id].svelte | 31 ++++++++++ web/pw-server/src/routes/matches/index.svelte | 35 ++++++++++++ web/pw-server/src/routes/matches/new.svelte | 2 + web/pw-server/svelte.config.js | 4 +- 8 files changed, 149 insertions(+), 16 deletions(-) create mode 100644 web/pw-server/src/lib/components/Visualizer.svelte create mode 100644 web/pw-server/src/routes/matches/[match_id].svelte diff --git a/web/pw-server/package.json b/web/pw-server/package.json index b8a9216..eafc63f 100644 --- a/web/pw-server/package.json +++ b/web/pw-server/package.json @@ -32,7 +32,9 @@ }, "dependencies": { "dayjs": "^1.10.7", - "moment": "^2.29.1" + "svelte-select": "^4.4.7", + "pw-visualizer": "file:../pw-visualizer", + "planetwars-rs": "file:../planetwars-rs/pkg" }, "type": "module" } diff --git a/web/pw-server/src/app.html b/web/pw-server/src/app.html index 32f9591..3193582 100644 --- a/web/pw-server/src/app.html +++ b/web/pw-server/src/app.html @@ -1,13 +1,22 @@ - - - - - - %svelte.head% - - -
%svelte.body%
- - + + + + + + + + + + + %svelte.head% + + + +
%svelte.body%
+ + + \ No newline at end of file diff --git a/web/pw-server/src/lib/components/Visualizer.svelte b/web/pw-server/src/lib/components/Visualizer.svelte new file mode 100644 index 0000000..d53eb36 --- /dev/null +++ b/web/pw-server/src/lib/components/Visualizer.svelte @@ -0,0 +1,57 @@ + + +
+ +
+
+ +
+
0 / 0
+
+ Ms per frame:  + +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/web/pw-server/src/routes/bots/[bot_id].svelte b/web/pw-server/src/routes/bots/[bot_id].svelte index 955f1c6..3eece10 100644 --- a/web/pw-server/src/routes/bots/[bot_id].svelte +++ b/web/pw-server/src/routes/bots/[bot_id].svelte @@ -1,6 +1,5 @@ + + + +
+ +
diff --git a/web/pw-server/src/routes/matches/index.svelte b/web/pw-server/src/routes/matches/index.svelte index dcfb43b..448048b 100644 --- a/web/pw-server/src/routes/matches/index.svelte +++ b/web/pw-server/src/routes/matches/index.svelte @@ -1 +1,36 @@ + + + + new match + diff --git a/web/pw-server/src/routes/matches/new.svelte b/web/pw-server/src/routes/matches/new.svelte index 10ce093..eed3dbb 100644 --- a/web/pw-server/src/routes/matches/new.svelte +++ b/web/pw-server/src/routes/matches/new.svelte @@ -28,6 +28,7 @@