Simulation Upload Update

This commit is contained in:
2026-02-21 22:21:05 -05:00
parent 4c24b141fe
commit 913f45b51b
20 changed files with 1479 additions and 492 deletions

View File

@@ -0,0 +1,52 @@
<script lang="ts">
import {
parseConfig,
formatDate,
type SimulationState,
} from "./simulationState.svelte";
let { state }: { state: SimulationState } = $props();
</script>
<main class="table-content">
<table>
<thead>
<tr>
<th>ID</th>
<th>Sim Name</th>
<th>Search Pattern</th>
<th>Date Run</th>
<th>Link</th>
</tr>
</thead>
<tbody>
{#each state.paginatedSimulations as sim}
<tr>
<td>{sim.id}</td>
<td>{sim.name}</td>
<td style="text-transform: capitalize;"
>{parseConfig(sim.config).pattern || "Unknown"}</td
>
<td>{formatDate(sim.created_at)}</td>
<td><a href={`/simulation/${sim.id}`}>View Details</a></td>
</tr>
{/each}
</tbody>
</table>
<div class="pagination">
<button
onclick={() => state.goToPage(state.currentPage - 1)}
disabled={state.currentPage === 1}
>
Previous
</button>
<span>Page {state.currentPage} of {state.totalPages}</span>
<button
onclick={() => state.goToPage(state.currentPage + 1)}
disabled={state.currentPage === state.totalPages}
>
Next
</button>
</div>
</main>