feat: add delete button in history (#440)

This commit is contained in:
Emrik Östling 2025-11-16 00:34:49 +01:00 committed by GitHub
parent 0096a6f197
commit 64264a41d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 122 additions and 104 deletions

View file

@ -5,6 +5,8 @@ import db from "../db/db";
import { Filename, Jobs } from "../db/types";
import { ALLOW_UNAUTHENTICATED, HIDE_HISTORY, LANGUAGE, WEBROOT } from "../helpers/env";
import { userService } from "./user";
import { EyeIcon } from "../icons/eye";
import { DeleteIcon } from "../icons/delete";
export const history = new Elysia().use(userService).get(
"/history",
@ -102,7 +104,7 @@ export const history = new Elysia().use(userService).get(
sm:px-4
`}
>
View
Actions
</th>
</tr>
</thead>
@ -131,7 +133,7 @@ export const history = new Elysia().use(userService).get(
<td>{job.num_files}</td>
<td class="max-sm:hidden">{job.finished_files}</td>
<td safe>{job.status}</td>
<td>
<td class="flex flex-row gap-4">
<a
class={`
text-accent-500 underline
@ -139,7 +141,16 @@ export const history = new Elysia().use(userService).get(
`}
href={`${WEBROOT}/results/${job.id}`}
>
View
<EyeIcon />
</a>
<a
class={`
text-accent-500 underline
hover:text-accent-400
`}
href={`${WEBROOT}/delete/${job.id}`}
>
<DeleteIcon />
</a>
</td>
</tr>