Some naming cleanup

This commit is contained in:
Dominic Ferrando
2026-07-17 14:57:28 -04:00
parent fde7d9a363
commit d4dacbaded
4 changed files with 17 additions and 18 deletions
@@ -25,7 +25,7 @@
let offset = $state(0);
let group = $state("");
let status = $state<EventStatus | "">("");
let replayingIds = $state<string[]>([]);
let retryingIds = $state<string[]>([]);
function errorMessage(err: unknown): string {
const value = (err as { value?: { error?: string } })?.value;
@@ -37,7 +37,6 @@
function formatLabel(value: string): string {
return value
.replace(/^apparel_/, "")
.replace(/_/g, " ")
.replace(/\b\w/g, (c) => c.toUpperCase());
}
@@ -101,16 +100,16 @@
refresh();
}
async function replay(id: string) {
replayingIds = [...replayingIds, id];
async function retry(id: string) {
retryingIds = [...retryingIds, id];
try {
const res = await api.events({ id }).replay.post();
const res = await api.events({ id }).retry.post();
if (res.error) throw res.error;
await refresh();
} catch (err) {
loadError = errorMessage(err);
} finally {
replayingIds = replayingIds.filter((x) => x !== id);
retryingIds = retryingIds.filter((x) => x !== id);
}
}
@@ -232,12 +231,12 @@
{#if event.status === "failed"}
<button
class="btn btn-xs"
disabled={replayingIds.includes(event.id)}
onclick={() => replay(event.id)}
disabled={retryingIds.includes(event.id)}
onclick={() => retry(event.id)}
>
{replayingIds.includes(event.id)
? "Replaying..."
: "Replay"}
{retryingIds.includes(event.id)
? "Retrying..."
: "Retry"}
</button>
{/if}
</td>