more layout improvements

This commit is contained in:
2025-01-01 21:39:33 -08:00
parent 32ab4104a7
commit d99ee9ef1e
7 changed files with 113 additions and 100 deletions

View File

@@ -29,7 +29,7 @@
</ul>
</nav>
</header>
<main class="flex min-w-full max-w-full flex-grow flex-col gap-4 xl:min-w-[1280px]">
<main class="flex min-w-full max-w-full flex-grow flex-col gap-4 xl:min-w-[78rem]">
{@render children()}
</main>

View File

@@ -38,7 +38,7 @@
</Table.Header>
<Table.Body class="divide-y-2 divide-background">
{#each data.clients as client}
<Table.Row class="group hover:bg-background hover:bg-opacity-40">
<Table.Row class="hover:bg-surface group">
<Table.Head scope="row">
<a
href={`/clients/${client.id}`}

View File

@@ -2,7 +2,7 @@
import type { PageData } from './$types';
import QRCode from 'qrcode-svg';
import { CodeSnippet } from '$lib/components/app/code-snippet';
import { WireguardGuide } from '$lib/components/app/wireguard-guide/index.js';
import { WireguardGuide } from '$lib/components/app/wireguard-guide';
const { data }: { data: PageData } = $props();
@@ -16,6 +16,8 @@
content: data.config,
join: true,
background: 'hsl(var(--accent-light))',
width: 296,
height: 296,
});
</script>
@@ -25,10 +27,10 @@
<h1 class="w-fit rounded-lg bg-accent p-2 text-lg">{data.client.name}</h1>
<section id="client-configuration" class="flex flex-wrap justify-center gap-4">
<section id="client-configuration" class="flex flex-wrap items-center justify-center gap-4">
<CodeSnippet data={data.config} filename={clientWgCleanedName} copy download />
<div class="overflow-hidden rounded-lg">
<div class="size-fit overflow-auto rounded-lg">
{@html qrCode.svg()}
</div>
</section>

View File

@@ -17,13 +17,11 @@
});
function getSize(size: number) {
let sizes = ['Bytes', 'KiB', 'MiB', 'GiB',
'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
let sizes = ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
for (let i = 1; i < sizes.length; i++) {
if (size < Math.pow(1024, i))
return (Math.round((size / Math.pow(
1024, i - 1)) * 100) / 100) + ' ' + sizes[i - 1];
return Math.round((size / Math.pow(1024, i - 1)) * 100) / 100 + ' ' + sizes[i - 1];
}
return size;
}
@@ -33,7 +31,7 @@
<title>Connections</title>
</svelte:head>
<Table.Root class="bg-accent rounded-lg overflow-hidden divide-y-2 divide-background">
<Table.Root class="divide-y-2 divide-background overflow-hidden rounded-lg bg-accent">
<Table.Header>
<Table.Row>
<Table.Head scope="col">Name</Table.Head>
@@ -49,14 +47,14 @@
</Table.Header>
<Table.Body class="divide-y-2 divide-background">
{#each data.peers.rows as peer}
<Table.Row class="hover:bg-background hover:bg-opacity-40">
<Table.Row class="hover:bg-surface">
<Table.Head scope="row">{peer.name}</Table.Head>
<Table.Cell class="truncate max-w-[10ch]">{peer['public-key']}</Table.Cell>
<Table.Cell class="max-w-[10ch] truncate">{peer['public-key']}</Table.Cell>
<Table.Cell>{peer.endpoint}</Table.Cell>
<Table.Cell>
<div class="flex flex-wrap gap-1">
{#each peer['allowed-ips'].split(',') as addr}
<Badge class="bg-background select-auto" variant="secondary">{addr}</Badge>
<Badge class="select-auto bg-background" variant="secondary">{addr}</Badge>
{/each}
</div>
</Table.Cell>