Update +page.svelte

This commit is contained in:
Luke Hagar
2024-05-29 11:29:53 -07:00
parent 15898240c1
commit 920829ed0f

View File

@@ -1,6 +1,7 @@
<script lang="ts"> <script lang="ts">
import CreateNewButton from '$lib/components/FileManagement/CreateNewButton.svelte'; import CreateNewButton from '$lib/components/FileManagement/CreateNewButton.svelte';
import DeleteButton from '$lib/components/FileManagement/DeleteButton.svelte'; import DeleteButton from '$lib/components/FileManagement/DeleteButton.svelte';
import SaveButton from '$lib/components/FileManagement/SaveButton.svelte';
import Upload from '$lib/components/FileManagement/Upload.svelte'; import Upload from '$lib/components/FileManagement/Upload.svelte';
import { db, selectedSpec } from '$lib/db'; import { db, selectedSpec } from '$lib/db';
import { liveQuery } from 'dexie'; import { liveQuery } from 'dexie';
@@ -10,19 +11,39 @@
</script> </script>
<div class="grid place-content-center h-full gap-2 px-1"> <div class="grid place-content-center h-full gap-2 px-1">
<label class="flex flex-col text-xs"> <table class="table">
<span>Select an API</span> <thead>
<select bind:value={$selectedSpec} class="select w-64"> <tr>
<th class="text-left">ID</th>
<th class="text-left">Name</th>
<th class="text-left">Actions</th>
</tr>
</thead>
<tbody>
{#if $apiSpecs} {#if $apiSpecs}
{#each $apiSpecs as spec (spec.id)} {#each $apiSpecs as spec (spec.id)}
<option value={spec}>{spec.name}</option> <tr>
<td>{spec.id}</td>
<td>{spec.name}</td>
<td>
<DeleteButton {spec} />
</td>
</tr>
{/each} {/each}
{/if} {/if}
</select> </tbody>
</label> </table>
{#if $selectedSpec?.name}
<input
class="input"
bind:value={$selectedSpec.name}
type="text"
placeholder="Enter the name for the API Spec"
/>
{/if}
<SaveButton />
<CreateNewButton /> <CreateNewButton />
<Upload /> <Upload />
<DeleteButton />
</div> </div>
<!-- <div class="w-full h-full flex flex-col items-center justify-center grow"> <!-- <div class="w-full h-full flex flex-col items-center justify-center grow">
<h1 class="h1"> <h1 class="h1">