Add a basic dataset page
This commit is contained in:
parent
b55dd97e9b
commit
e43346107e
2 changed files with 23 additions and 0 deletions
9
frontend/src/routes/datasets/[id]/+page.server.ts
Normal file
9
frontend/src/routes/datasets/[id]/+page.server.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import type { PageServerLoad } from "./$types";
|
||||||
|
import * as backend from "$lib/server/backend";
|
||||||
|
|
||||||
|
export const load: PageServerLoad = async ({ params }) => {
|
||||||
|
const record = await backend.query_dataset(params.id);
|
||||||
|
return {
|
||||||
|
record,
|
||||||
|
};
|
||||||
|
}
|
||||||
14
frontend/src/routes/datasets/[id]/+page.svelte
Normal file
14
frontend/src/routes/datasets/[id]/+page.svelte
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import type { PageProps } from "./$types";
|
||||||
|
|
||||||
|
let { data }: PageProps = $props();
|
||||||
|
|
||||||
|
// svelte-ignore state_referenced_locally
|
||||||
|
const recordData = JSON.parse(data.record.data);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{#each Object.entries(recordData) as [key, value]}
|
||||||
|
<li>{key}: {value}</li>
|
||||||
|
{/each}
|
||||||
|
</ul>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue