Skip to content

Commit

Permalink
Merge pull request #46 from natrontech/enhance-code-server
Browse files Browse the repository at this point in the history
feat: update path to ~/exercise/
  • Loading branch information
janlauber authored Nov 6, 2023
2 parents ad0a942 + a8faf3a commit 059e8c0
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
20 changes: 10 additions & 10 deletions kubelab-backend/pkg/k8s/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,17 @@ func constructDeployment(name, namespace, image string, replicas int32, host str
Name: "code-server",
Image: env.Config.CodeServerImage,
Env: []v1.EnvVar{
{
Name: "PUID",
Value: "1001",
},
{
Name: "PGID",
Value: "1001",
},
// {
// Name: "PUID",
// Value: "1001",
// },
// {
// Name: "PGID",
// Value: "1001",
// },
{
Name: "DEFAULT_WORKSPACE",
Value: "/home/kubelab-agent",
Value: "/home/kubelab-agent/exercise",
},
// {
// Name: "PROXY_DOMAIN",
Expand All @@ -184,7 +184,7 @@ func constructDeployment(name, namespace, image string, replicas int32, host str
VolumeMounts: []v1.VolumeMount{
{
Name: "kubeconfig-writable",
MountPath: "/home/kubelab-agent/.kube/config",
MountPath: "/config/.kube/config",
SubPath: "kubeconfig",
ReadOnly: true,
},
Expand Down
2 changes: 2 additions & 0 deletions kubelab-backend/vcluster-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ isolation:
ipBlock:
cidr: 8.8.8.8/32
except: []
syncer:
kubeConfigContextName: "kubelab-vcluster"
1 change: 1 addition & 0 deletions kubelab-ui/src/lib/components/base/SideOver.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
exercises.delete(sidebar_exercise_session.id);
return new Set(exercises); // Required for Svelte's reactivity
});
confirmation = false;
});
});
Expand Down
1 change: 1 addition & 0 deletions kubelab-ui/src/lib/components/labs/Exercise.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
exercises.delete(exercise_id);
return new Set(exercises); // Required for Svelte's reactivity
});
confirmation = false;
});
}
}
Expand Down
7 changes: 2 additions & 5 deletions kubelab-ui/src/lib/components/markdown/CodeComponent.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { Copy } from "lucide-svelte";
import Prism from "prismjs";
import toast from "svelte-french-toast";
import toast from "svelte-french-toast";
export let text: string;
let language = "javascript";
Expand All @@ -14,10 +14,7 @@

<div class="code bg-base-200 p-2 my-2 rounded-md relative">
{@html Prism.highlight(text, Prism.languages[language], language)}
<button
class="absolute top-2 right-2"
on:click={copyCode}
>
<button class="absolute top-2 right-2" on:click={copyCode}>
<Copy class="" size={16} />
</button>
</div>
Expand Down
7 changes: 7 additions & 0 deletions kubelab-ui/src/lib/components/markdown/ListComponent.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script lang="ts">
</script>

<slot />

<style>
</style>
19 changes: 13 additions & 6 deletions kubelab-ui/src/routes/labs/[id]/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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 ListComponent from "$lib/components/markdown/ListComponent.svelte";
import horizontalView from "$lib/stores/tableView";
import { loadingExercises } from "$lib/stores/loading";
let Console: ComponentType<SvelteComponentTyped> = PlaceholderComponent;
Expand Down Expand Up @@ -199,7 +200,8 @@
renderers={{
codespan: CodeSpanComponent,
code: CodeComponent,
link: LinkComponent
link: LinkComponent,
list: ListComponent
}}
/>
{/key}
Expand All @@ -225,7 +227,8 @@
renderers={{
codespan: CodeSpanComponent,
code: CodeComponent,
link: LinkComponent
link: LinkComponent,
list: ListComponent
}}
/>
</form>
Expand Down Expand Up @@ -256,7 +259,8 @@
renderers={{
codespan: CodeSpanComponent,
code: CodeComponent,
link: LinkComponent
link: LinkComponent,
list: ListComponent
}}
/>
</form>
Expand Down Expand Up @@ -365,7 +369,8 @@
renderers={{
codespan: CodeSpanComponent,
code: CodeComponent,
link: LinkComponent
link: LinkComponent,
list: ListComponent
}}
/>
{/key}
Expand All @@ -391,7 +396,8 @@
renderers={{
codespan: CodeSpanComponent,
code: CodeComponent,
link: LinkComponent
link: LinkComponent,
list: ListComponent
}}
/>
</form>
Expand Down Expand Up @@ -421,7 +427,8 @@
renderers={{
codespan: CodeSpanComponent,
code: CodeComponent,
link: LinkComponent
link: LinkComponent,
list: ListComponent
}}
/>
<div class="modal-action">
Expand Down

0 comments on commit 059e8c0

Please sign in to comment.