Skip to content

Commit

Permalink
Add secret cluster page
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielPower committed Jul 2, 2024
1 parent 5eb4d8f commit e68ce34
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 3 deletions.
Binary file added src/lib/assets/nodes/eisen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/lib/assets/nodes/fern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/lib/assets/nodes/heiter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/lib/assets/nodes/stark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/lib/assets/nodes/ubel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/lib/components/Image.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
const path = `/src/lib/assets/${src}`;
const images: { [key in Size]: string } = {
original: import.meta.glob<{ default: string }>("$lib/assets/*", {
original: import.meta.glob<{ default: string }>("$lib/assets/**", {
eager: true,
})[path]?.default!,
thumbnail: import.meta.glob<{ default: string }>("$lib/assets/*", {
thumbnail: import.meta.glob<{ default: string }>("$lib/assets/**", {
query: "?w=320&format=webp&quality=80",
eager: true,
})[path]?.default!,
fullwidth: import.meta.glob<{ default: string }>("$lib/assets/*", {
fullwidth: import.meta.glob<{ default: string }>("$lib/assets/**", {
query: "?w=960&format=webp&quality=80",
eager: true,
})[path]?.default!,
Expand Down
8 changes: 8 additions & 0 deletions src/routes/cluster/+page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { hostname } from "os";
import type { PageServerLoad } from "./$types";

export const load: PageServerLoad = async () => {
return {
hostname: hostname(),
};
};
11 changes: 11 additions & 0 deletions src/routes/cluster/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
import Image from "$lib/components/Image.svelte";
import type { PageData } from "./$types";
export let data: PageData;
</script>

This page is being served by {data.hostname} in my homelab Kubernetes cluster. Try
refreshing the page to see if you get a different node.

<Image src={`nodes/${data.hostname}.png`} alt={data.hostname} />

0 comments on commit e68ce34

Please sign in to comment.