feat: add button to remove image from class
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<script lang="ts">
|
||||
import Tabs from 'src/lib/Tabs.svelte';
|
||||
import type { Class } from './ModelData.svelte';
|
||||
import { get, postFormData } from 'src/lib/requests.svelte';
|
||||
import { get, postFormData, rdelete } from 'src/lib/requests.svelte';
|
||||
import type { Model } from './+page.svelte';
|
||||
import FileUpload from 'src/lib/FileUpload.svelte';
|
||||
import MessageSimple from 'src/lib/MessageSimple.svelte';
|
||||
@@ -88,6 +88,16 @@
|
||||
|
||||
uploading = Promise.resolve();
|
||||
}
|
||||
|
||||
function deleteDataPoint(id: string) {
|
||||
try {
|
||||
rdelete('models/data/point', { id })
|
||||
getList()
|
||||
} catch (e) {
|
||||
console.error('TODO notify user', e);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
{#if classes.length == 0}
|
||||
@@ -219,6 +229,9 @@
|
||||
<th>
|
||||
<!-- Status -->
|
||||
</th>
|
||||
<th>
|
||||
<!-- Remove -->
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -258,6 +271,11 @@
|
||||
<span class="bi bi-exclamation-triangle-fill" style="color: red"></span>
|
||||
{/if}
|
||||
</td>
|
||||
<td style="width: 3ch">
|
||||
<button class="danger" on:click={() => deleteDataPoint(image.id)}>
|
||||
<span class="bi bi-trash"></span>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user