diff --git a/src/components/Rack.svelte b/src/components/Rack.svelte new file mode 100644 index 0000000..14058fa --- /dev/null +++ b/src/components/Rack.svelte @@ -0,0 +1,28 @@ + + +
+ {#each rackunits as unit} + + {/each} +
+ + + \ No newline at end of file diff --git a/src/components/Rackunit.svelte b/src/components/Rackunit.svelte new file mode 100644 index 0000000..05c1d4f --- /dev/null +++ b/src/components/Rackunit.svelte @@ -0,0 +1,65 @@ + + +
+ {#if unit?.image} + {unit?.hostname} + {:else} +
+ {/if} +
+ + \ No newline at end of file diff --git a/src/interface/IRack.ts b/src/interface/IRack.ts new file mode 100644 index 0000000..4f1e4d5 --- /dev/null +++ b/src/interface/IRack.ts @@ -0,0 +1,9 @@ +export interface IRack { + hostname: string; + ip_address?: string; + proxmox?: boolean; + admin_address?: string; + image?: string; + size?: number; + element?: string; +} diff --git a/src/lib/rack/data.json b/src/lib/rack/data.json new file mode 100644 index 0000000..a5acfca --- /dev/null +++ b/src/lib/rack/data.json @@ -0,0 +1,49 @@ +[ + { + "hostname": "switch", + "image": "/images/dlink-switch.jpg" + }, + { + "hostname": "usg", + "image": "/images/usg.png", + "admin_address": "https://unifi.schleppe:8443" + }, + { + "hostname": "toscadas", + "size": 3 + }, + { + "hostname": "anna", + "image": "/images/supermicro-1u.png", + "ip_address": "10.0.0.40", + "proxmox": true + }, + { + "hostname": "pve", + "image": "/images/supermicro-2u.png", + "ip_address": "10.0.0.60", + "proxmox": true + }, + { + "hostname": "cerberus", + "image": "/images/ibm-x3620.jpeg", + "ip_address": "10.0.0.80", + "proxmox": true + }, + { + "hostname": "ambrosia", + "image": "/images/xserve-storage.png", + "ip_address": "10.0.0.50", + "proxmox": true + }, + { + "hostname": "adam", + "image": "/images/xserve-compute.png", + "admin_address": "vnc://kevin@10.0.0.78", + "ip_address": "10.0.0.78" + }, + { + "hostname": "third", + "image": "/images/apc-ups.png" + } +] \ No newline at end of file diff --git a/src/routes/index.svelte b/src/routes/index.svelte new file mode 100644 index 0000000..81b8a0e --- /dev/null +++ b/src/routes/index.svelte @@ -0,0 +1,7 @@ + + + diff --git a/src/routes/unit/[hostname].svelte b/src/routes/unit/[hostname].svelte new file mode 100644 index 0000000..5c4d550 --- /dev/null +++ b/src/routes/unit/[hostname].svelte @@ -0,0 +1,70 @@ + + + + +
+ {#if unit} +

{ unit.hostname }

+ + {#each JSON.stringify(unit).split(",") as segment} +

{ segment }

+ {/each} + +
+

Actions

+ + + + + + {#if unit?.proxmox == true} + + + + + {:else if unit?.admin_address} + + + + {/if} +
+ {/if} +
+ + diff --git a/src/routes/unit/__layout.svelte b/src/routes/unit/__layout.svelte new file mode 100644 index 0000000..6d5734b --- /dev/null +++ b/src/routes/unit/__layout.svelte @@ -0,0 +1,22 @@ + + +
+

Menu

+ +
+ + + +
+
+ + diff --git a/src/routes/unit/index.svelte b/src/routes/unit/index.svelte new file mode 100644 index 0000000..c49af49 --- /dev/null +++ b/src/routes/unit/index.svelte @@ -0,0 +1,49 @@ + + + + kasperrt + + +
+

👋 hi

+ +

+ my name is kasper, and i am a lead developer at aller media norway. i have worked with a range + of technologies, all from episerver, c# and .net, to golang, svelte, react, vue.js, and mongodb, + and a bunch more. +

+ +

programming is one of my hobbies, so i made this to showcase some of my stuff.

+

+ want to get to know me? +
+ kasper@rynning-toennesen.no +

+
+ + diff --git a/src/sass/breakpoints.scss b/src/sass/breakpoints.scss new file mode 100644 index 0000000..66d2dd6 --- /dev/null +++ b/src/sass/breakpoints.scss @@ -0,0 +1,5 @@ +@mixin small { + @media screen and (max-width: 860px) { + @content; + } +} diff --git a/src/sass/button.scss b/src/sass/button.scss new file mode 100644 index 0000000..170740e --- /dev/null +++ b/src/sass/button.scss @@ -0,0 +1,11 @@ + +button { + padding: 0.85rem; + background-color: teal; + color: white; + text-transform: uppercase; + border-width: 0px; + border-radius: 6px; + font-size: 1rem; + font-weight: 600; +} \ No newline at end of file diff --git a/src/app.css b/static/app.css similarity index 100% rename from src/app.css rename to static/app.css