diff --git a/kubelab-ui/src/app.css b/kubelab-ui/src/app.css index a257694..bb16e49 100644 --- a/kubelab-ui/src/app.css +++ b/kubelab-ui/src/app.css @@ -52,7 +52,23 @@ table { width: 100%; } -td, th { +td, +th { border: 1px solid #ddd; padding: 0.5em; } + +@layer utilities { + @layer components { + /* Hide scrollbar for Chrome, Safari and Opera */ + .no-scrollbar::-webkit-scrollbar { + display: none; + } + + /* Hide scrollbar for IE, Edge and Firefox */ + .no-scrollbar { + -ms-overflow-style: none; /* IE and Edge */ + scrollbar-width: none; /* Firefox */ + } + } +} diff --git a/kubelab-ui/src/lib/components/Console.svelte b/kubelab-ui/src/lib/components/Console.svelte index 8b48100..7485c3c 100644 --- a/kubelab-ui/src/lib/components/Console.svelte +++ b/kubelab-ui/src/lib/components/Console.svelte @@ -1,5 +1,4 @@ diff --git a/kubelab-ui/src/lib/stores/tableView.ts b/kubelab-ui/src/lib/stores/tableView.ts index ee38c8b..48f54af 100644 --- a/kubelab-ui/src/lib/stores/tableView.ts +++ b/kubelab-ui/src/lib/stores/tableView.ts @@ -1,15 +1,15 @@ import { writable } from "svelte/store"; const defaultValue = false; -const initialTableViewValue = - localStorage.getItem("tableView") === null +const initialHorizontalViewValue = + localStorage.getItem("horizontalView") === null ? defaultValue - : localStorage.getItem("tableView") === "true"; + : localStorage.getItem("horizontalView") === "true"; -const tableView = writable(initialTableViewValue); +const horizontalView = writable(initialHorizontalViewValue); -tableView.subscribe((value) => { - localStorage.setItem("tableView", value.toString()); +horizontalView.subscribe((value) => { + localStorage.setItem("horizontalView", value.toString()); }); -export default tableView; +export default horizontalView; diff --git a/kubelab-ui/src/routes/labs/[id]/[id]/+layout.svelte b/kubelab-ui/src/routes/labs/[id]/[id]/+layout.svelte index 96acece..ccff7a6 100644 --- a/kubelab-ui/src/routes/labs/[id]/[id]/+layout.svelte +++ b/kubelab-ui/src/routes/labs/[id]/[id]/+layout.svelte @@ -1,7 +1,14 @@ -
+
- +
+ + +
@@ -173,7 +199,7 @@
-
+
+ /> {/each} {/key} {/key} diff --git a/kubelab-ui/src/routes/labs/[id]/[id]/+page.svelte b/kubelab-ui/src/routes/labs/[id]/[id]/+page.svelte index 3a98a7d..a33e1d3 100644 --- a/kubelab-ui/src/routes/labs/[id]/[id]/+page.svelte +++ b/kubelab-ui/src/routes/labs/[id]/[id]/+page.svelte @@ -21,6 +21,7 @@ import CodeSpanComponent from "$lib/components/markdown/CodeSpanComponent.svelte"; import CodeComponent from "$lib/components/markdown/CodeComponent.svelte"; import LinkComponent from "$lib/components/markdown/LinkComponent.svelte"; + import horizontalView from "$lib/stores/tableView"; let Console: ComponentType = PlaceholderComponent; let loading = ""; @@ -153,127 +154,253 @@ } - - - - -
- {#key $page.params} - - {/key} -
-
- -
- {#key $page.params} -
- +{#if $horizontalView} + + + + +
+ {#key $page.params} + + {/key} +
+
+ +
+ {#key $page.params} +
+ + + + +
+
+ + + + +
+ {/key} +
+
+
+
+ + {#if $exercise_session.agentRunning} + {#key $page.params} + {#if $exercise_session.exercise === $exercise.id} + + {/if} + {/key} + {:else} + + {#key $page.params} +
+
+

+ {checkIfExerciseIsDone($exercise.id) ? "Exercise done" : "Exercise not started"} +

+

+ {checkIfExerciseIsDone($exercise.id) + ? "Click the button below to restart the exercise. You must finish it again!" + : "Click the button below to start the exercise"} +

- -
-
- +
+ {/key} + {/if} + + +{:else} + + + {#if $exercise_session.agentRunning} + {#key $page.params} + {#if $exercise_session.exercise === $exercise.id} + + {/if} + {/key} + {:else} + + {#key $page.params} +
+
+

+ {checkIfExerciseIsDone($exercise.id) ? "Exercise done" : "Exercise not started"} +

+

+ {checkIfExerciseIsDone($exercise.id) + ? "Click the button below to restart the exercise. You must finish it again!" + : "Click the button below to start the exercise"} +

- -
- {/key} -
-
-
- - - {#if $exercise_session.agentRunning} - {#key $page.params} - {#if $exercise_session.exercise === $exercise.id} - - {/if} - {/key} - {:else} - - {#key $page.params} -
-
-

- {checkIfExerciseIsDone($exercise.id) ? "Exercise done" : "Exercise not started"} -

-

- {checkIfExerciseIsDone($exercise.id) - ? "Click the button below to restart the exercise. You must finish it again!" - : "Click the button below to start the exercise"} -

-
-
- {/key} - {/if} -
- + {/key} + {/if} + + + + +
+ {#key $page.params} + + {/key} +
+
+ +
+ {#key $page.params} +
+ + + + +
+
+ + + + +
+ {/key} +
+
+
+
+ +{/if}