Skip to content

Commit

Permalink
chore: moved overview to own page
Browse files Browse the repository at this point in the history
  • Loading branch information
MSchmoecker committed Jan 16, 2024
1 parent dc8281c commit 3a37ee6
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 40 deletions.
2 changes: 1 addition & 1 deletion frontend/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<svelte:fragment slot="sidebarLeft">
<AppRail>
<svelte:fragment slot="lead">
<AppRailAnchor href="/">
<AppRailAnchor href="/overview">
<svelte:fragment slot="lead"><LayoutDashboard /></svelte:fragment>
<span>Overview</span>
</AppRailAnchor>
Expand Down
38 changes: 0 additions & 38 deletions frontend/src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,40 +1,2 @@
<script lang="ts">
import type { PageData } from './$types';
export let data: PageData;
$: devices = data.devices;
</script>

<div class="border rounded-lg p-4 pb-2 bg-surface-100">
<table class="table-auto w-full text-left">
<thead>
<tr class="">
<th class="border-b border-slate-100 p-2">Name</th>
<th class="border-b border-slate-100 p-2">Hostname</th>
<th class="border-b border-slate-100 p-2">Tags</th>
<th class="border-b border-slate-100 p-2">Actions</th>
<th class="border-b border-slate-100 p-2">Status</th>
</tr>
</thead>
<tbody>
{#each devices as device}
<tr>
<td class="border-t border-slate-200 p-2">{device.displayName}</td>
<td class="border-t border-slate-200 p-2">{device.hostname}</td>
<td class="border-t border-slate-200 p-2">
{#each device.tags as tag, i}
<a class="underline" href="/config?tag={tag}">{tag}</a
>{#if i < device.tags.length - 1}{', '}{/if}
{/each}
</td>
<td class="border-t border-slate-200 p-2">
<a class="btn variant-filled" href="/config?device={device.hostname}">Edit</a>
<a class="btn variant-filled">Download Image</a>
</td>
<td class="border-t border-slate-200 p-2">Online</td>
</tr>
{/each}
</tbody>
</table>
</div>
40 changes: 40 additions & 0 deletions frontend/src/routes/overview/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<script lang="ts">
import type { PageData } from '../$types';
export let data: PageData;
$: devices = data.devices;
</script>

<div class="border rounded-lg p-4 pb-2 bg-surface-100">
<table class="table-auto w-full text-left">
<thead>
<tr class="">
<th class="border-b border-slate-100 p-2">Name</th>
<th class="border-b border-slate-100 p-2">Hostname</th>
<th class="border-b border-slate-100 p-2">Tags</th>
<th class="border-b border-slate-100 p-2">Actions</th>
<th class="border-b border-slate-100 p-2">Status</th>
</tr>
</thead>
<tbody>
{#each devices as device}
<tr>
<td class="border-t border-slate-200 p-2">{device.displayName}</td>
<td class="border-t border-slate-200 p-2">{device.hostname}</td>
<td class="border-t border-slate-200 p-2">
{#each device.tags as tag, i}
<a class="underline" href="/config?tag={tag}">{tag}</a
>{#if i < device.tags.length - 1}{', '}{/if}
{/each}
</td>
<td class="border-t border-slate-200 p-2">
<a class="btn variant-filled" href="/config?device={device.hostname}">Edit</a>
<a class="btn variant-filled">Download Image</a>
</td>
<td class="border-t border-slate-200 p-2">Online</td>
</tr>
{/each}
</tbody>
</table>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export const load = (async ({ fetch }) => {
return {
devices: devices,
};
}) satisfies PageLoad;
}) satisfies PageLoad;

0 comments on commit 3a37ee6

Please sign in to comment.