aboutsummaryrefslogtreecommitdiff
path: root/ui/src/routes/list
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/routes/list')
-rw-r--r--ui/src/routes/list/+page.js14
-rw-r--r--ui/src/routes/list/+page.svelte22
2 files changed, 36 insertions, 0 deletions
diff --git a/ui/src/routes/list/+page.js b/ui/src/routes/list/+page.js
new file mode 100644
index 0000000..72e2878
--- /dev/null
+++ b/ui/src/routes/list/+page.js
@@ -0,0 +1,14 @@
+
+
+
+
+/** @type {import('./$types').PageLoad} */
+export async function load({ params }) {
+ const req = await fetch(`http://localhost:6130/api/v1/list`)
+ const reqJson = await req.json();
+
+ return {
+ req: req,
+ reqJson: reqJson,
+ };
+} \ No newline at end of file
diff --git a/ui/src/routes/list/+page.svelte b/ui/src/routes/list/+page.svelte
new file mode 100644
index 0000000..c487068
--- /dev/null
+++ b/ui/src/routes/list/+page.svelte
@@ -0,0 +1,22 @@
+<script>
+
+
+ let data = null;
+
+ const req = fetch(`http://localhost:6130/api/v1/list`)
+ .then((res) => res.json())
+ .then(resData => data = resData);
+
+</script>
+
+{#if data}
+<ul>
+ {#each data as paste (paste.id)}
+ <li>
+ <a href="/view/{paste.id}">
+ ID: {paste.id} ({paste.size} bytes)
+ </a>
+ </li>
+ {/each}
+</ul>
+{/if} \ No newline at end of file