diff --git a/bun.lockb b/bun.lockb
index e5bf7c4..ec7b8fc 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/src/lib/components/ui/checkbox/checkbox.svelte b/src/lib/components/ui/checkbox/checkbox.svelte
new file mode 100644
index 0000000..f4b906f
--- /dev/null
+++ b/src/lib/components/ui/checkbox/checkbox.svelte
@@ -0,0 +1,35 @@
+
+
+
+
+ {#if isChecked}
+
+ {:else if isIndeterminate}
+
+ {/if}
+
+
diff --git a/src/lib/components/ui/checkbox/index.ts b/src/lib/components/ui/checkbox/index.ts
new file mode 100644
index 0000000..6d92d94
--- /dev/null
+++ b/src/lib/components/ui/checkbox/index.ts
@@ -0,0 +1,6 @@
+import Root from "./checkbox.svelte";
+export {
+ Root,
+ //
+ Root as Checkbox,
+};
diff --git a/src/lib/components/ui/table/index.ts b/src/lib/components/ui/table/index.ts
new file mode 100644
index 0000000..14695c8
--- /dev/null
+++ b/src/lib/components/ui/table/index.ts
@@ -0,0 +1,28 @@
+import Root from "./table.svelte";
+import Body from "./table-body.svelte";
+import Caption from "./table-caption.svelte";
+import Cell from "./table-cell.svelte";
+import Footer from "./table-footer.svelte";
+import Head from "./table-head.svelte";
+import Header from "./table-header.svelte";
+import Row from "./table-row.svelte";
+
+export {
+ Root,
+ Body,
+ Caption,
+ Cell,
+ Footer,
+ Head,
+ Header,
+ Row,
+ //
+ Root as Table,
+ Body as TableBody,
+ Caption as TableCaption,
+ Cell as TableCell,
+ Footer as TableFooter,
+ Head as TableHead,
+ Header as TableHeader,
+ Row as TableRow,
+};
diff --git a/src/lib/components/ui/table/table-body.svelte b/src/lib/components/ui/table/table-body.svelte
new file mode 100644
index 0000000..f2109d6
--- /dev/null
+++ b/src/lib/components/ui/table/table-body.svelte
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/src/lib/components/ui/table/table-caption.svelte b/src/lib/components/ui/table/table-caption.svelte
new file mode 100644
index 0000000..b838270
--- /dev/null
+++ b/src/lib/components/ui/table/table-caption.svelte
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/src/lib/components/ui/table/table-cell.svelte b/src/lib/components/ui/table/table-cell.svelte
new file mode 100644
index 0000000..fcb04f6
--- /dev/null
+++ b/src/lib/components/ui/table/table-cell.svelte
@@ -0,0 +1,18 @@
+
+
+
+
+ |
diff --git a/src/lib/components/ui/table/table-footer.svelte b/src/lib/components/ui/table/table-footer.svelte
new file mode 100644
index 0000000..a2ba75d
--- /dev/null
+++ b/src/lib/components/ui/table/table-footer.svelte
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/src/lib/components/ui/table/table-head.svelte b/src/lib/components/ui/table/table-head.svelte
new file mode 100644
index 0000000..49ab7a9
--- /dev/null
+++ b/src/lib/components/ui/table/table-head.svelte
@@ -0,0 +1,19 @@
+
+
+
+
+ |
diff --git a/src/lib/components/ui/table/table-header.svelte b/src/lib/components/ui/table/table-header.svelte
new file mode 100644
index 0000000..a3e59ee
--- /dev/null
+++ b/src/lib/components/ui/table/table-header.svelte
@@ -0,0 +1,14 @@
+
+
+
+
+
+
diff --git a/src/lib/components/ui/table/table-row.svelte b/src/lib/components/ui/table/table-row.svelte
new file mode 100644
index 0000000..731c5d5
--- /dev/null
+++ b/src/lib/components/ui/table/table-row.svelte
@@ -0,0 +1,23 @@
+
+
+
+
+
diff --git a/src/lib/components/ui/table/table.svelte b/src/lib/components/ui/table/table.svelte
new file mode 100644
index 0000000..788d4ee
--- /dev/null
+++ b/src/lib/components/ui/table/table.svelte
@@ -0,0 +1,15 @@
+
+
+
diff --git a/src/routes/connections/+page.svelte b/src/routes/connections/+page.svelte
index 6084fc7..e6eff51 100644
--- a/src/routes/connections/+page.svelte
+++ b/src/routes/connections/+page.svelte
@@ -2,8 +2,13 @@
import type { PageData } from './$types';
import { invalidate } from '$app/navigation';
import { onMount } from 'svelte';
+ import * as Table from '$lib/components/ui/table';
+ import { Checkbox } from '$lib/components/ui/checkbox';
+ import { Label } from '$lib/components/ui/label';
const { data }: { data: PageData } = $props();
+ let showOnlyActive = $state(false);
+ const peerRows = $derived(data.peers.rows.filter((peer) => showOnlyActive ? peer['latest-handshake'] : true));
onMount(() => {
// refresh every 5 seconds
@@ -30,37 +35,45 @@
Connections
-
-
-
- Public Key |
- Endpoint |
- Allowed IPs |
- Latest Handshake |
- RX |
- TX |
- Persistent Keepalive |
- Name |
- Interface Name |
-
-
-
- {#each data.peers.rows as peer}
-
- {peer['public-key'].substring(0, 10)} |
- {peer.endpoint} |
- {peer['allowed-ips']} |
- {#if peer['latest-handshake']}
- {new Date(peer['latest-handshake'] * 1000)} |
- {:else}
- Never |
- {/if}
- {getSize(peer['transfer-rx'])} |
- {getSize(peer['transfer-tx'])} |
- {peer['persistent-keepalive']} |
- {peer.name} |
- {peer.ifname} |
-
- {/each}
-
-
+
+
+
+{#if peerRows.length === 0}
+ No active connections
+
+{:else}
+
+
+ Name
+ Public Key
+ Endpoint
+ Allowed IPs
+ Latest Handshake
+ RX
+ TX
+ Persistent Keepalive
+ Interface Name
+
+
+ {#each peerRows as peer}
+
+ {peer.name}
+ {peer['public-key'].substring(0, 10)}
+ {peer.endpoint}
+ {peer['allowed-ips']}
+ {#if peer['latest-handshake']}
+ {new Date(peer['latest-handshake'] * 1000).toLocaleString()}
+ {getSize(peer['transfer-rx'])}
+ {getSize(peer['transfer-tx'])}
+ {:else}
+ Never
+ --
+ --
+ {/if}
+ {peer['persistent-keepalive']}
+ {peer.ifname}
+
+ {/each}
+
+
+{/if}
\ No newline at end of file