From 35c7aee11e4c15882bff931932ad39c1fed7cf74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Hole=C4=8Dek?= Date: Thu, 12 Dec 2024 07:46:45 +0100 Subject: [PATCH] dashboard client: campaign sidebar, detail, steps, solving --- dashboard/client/src/App.svelte | 5 +- dashboard/client/src/ChallengeDetail.svelte | 7 ++- dashboard/client/src/Dashboard.svelte | 9 +++- dashboard/client/src/SideNavBar.svelte | 23 +++++++++- .../src/campaigns/CampaignDetail.svelte | 11 +++++ .../client/src/campaigns/CampaignStep.svelte | 13 ++++++ .../src/campaigns/CampaignStepList.svelte | 46 +++++++++++++++++++ .../src/components/CollapsibleSection.svelte | 1 + dashboard/client/src/fetch.js | 30 ++++++++++++ dashboard/client/src/routing.js | 28 ++++++++++- dashboard/client/src/stores.js | 30 ++++++++++++ 11 files changed, 194 insertions(+), 9 deletions(-) create mode 100644 dashboard/client/src/campaigns/CampaignDetail.svelte create mode 100644 dashboard/client/src/campaigns/CampaignStep.svelte create mode 100644 dashboard/client/src/campaigns/CampaignStepList.svelte diff --git a/dashboard/client/src/App.svelte b/dashboard/client/src/App.svelte index 777957a..e98010d 100644 --- a/dashboard/client/src/App.svelte +++ b/dashboard/client/src/App.svelte @@ -5,9 +5,9 @@ import SSH from './Ssh.svelte'; import { onMount } from 'svelte'; import ClassDoc from './ClassDoc.svelte'; - import { challenges, classes } from './stores'; + import { challenges, classes, campaigns } from './stores'; import { navigate, chosenClass } from './routing'; - import { fetchChallenges, fetchClasses } from './fetch'; + import { fetchChallenges, fetchClasses, fetchCampaigns } from './fetch'; let showSSH = false; let sshInitialised = false; @@ -23,6 +23,7 @@ onMount(async () => { fetchChallenges().then((loadedChallenges) => ($challenges = loadedChallenges)); fetchClasses().then((loadedClasses) => ($classes = loadedClasses)); + fetchCampaigns().then((loadedCampaigns) => ($campaigns = loadedCampaigns)); }); let resizeTerminalContentFunc; diff --git a/dashboard/client/src/ChallengeDetail.svelte b/dashboard/client/src/ChallengeDetail.svelte index 4f7e327..151c6f5 100644 --- a/dashboard/client/src/ChallengeDetail.svelte +++ b/dashboard/client/src/ChallengeDetail.svelte @@ -1,5 +1,5 @@