feat: enable proxy toggle on quick deploy, event log clearing, and UX fixes

- Add enable_proxy toggle to Quick Deploy form (defaults to on)
- Add DELETE /api/events/log/{id} and DELETE /api/events/log endpoints
- Add Clear All button with confirmation on Events page
- Rename "NPM Proxy" to "Enable Proxy" on stage form (provider-agnostic)
- Fix polling interval validation (min 60s) and number input trim errors
- Fix domain field no longer required in settings
This commit is contained in:
2026-04-05 01:50:19 +03:00
parent 61febefca9
commit c26c41e6a1
10 changed files with 134 additions and 13 deletions
+37 -4
View File
@@ -5,7 +5,9 @@
<script lang="ts">
import { onMount, onDestroy } from 'svelte';
import { t } from '$lib/i18n';
import { fetchEventLog, fetchEventLogStats } from '$lib/api';
import { fetchEventLog, fetchEventLogStats, clearAllEvents } from '$lib/api';
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
import { toasts } from '$lib/stores/toast';
import { connectGlobalEvents, type SSEConnection, type EventLogSSEPayload } from '$lib/sse';
import type { EventLogEntry, EventLogStats } from '$lib/types';
import EventLogEntryComponent from '$lib/components/EventLogEntry.svelte';
@@ -35,6 +37,7 @@
let sseConnection: SSEConnection | null = null;
let listEl: HTMLDivElement | undefined = $state();
let showClearConfirm = $state(false);
// ── Date range to ISO string ─────────────────────────────────
@@ -212,9 +215,18 @@
<!-- Header -->
<div class="flex items-center justify-between">
<h1 class="text-2xl font-bold text-[var(--text-primary)]">{$t('events.title')}</h1>
{#if stats.total > 0}
<span class="text-xs text-[var(--text-tertiary)] tabular-nums">{stats.total} total</span>
{/if}
<div class="flex items-center gap-3">
{#if stats.total > 0}
<span class="text-xs text-[var(--text-tertiary)] tabular-nums">{stats.total} total</span>
<button
type="button"
onclick={() => { showClearConfirm = true; }}
class="rounded-lg border border-[var(--border-primary)] px-3 py-1.5 text-xs font-medium text-[var(--text-secondary)] hover:bg-[var(--surface-card-hover)] hover:text-[var(--color-danger)] transition-colors"
>
{$t('events.clearAll')}
</button>
{/if}
</div>
</div>
<!-- Filter bar (includes severity stats as pill counts) -->
@@ -285,3 +297,24 @@
{/if}
{/if}
</div>
<ConfirmDialog
open={showClearConfirm}
title={$t('events.clearAllTitle')}
message={$t('events.clearAllMessage')}
confirmLabel={$t('events.clearAll')}
confirmVariant="danger"
onconfirm={async () => {
showClearConfirm = false;
try {
const result = await clearAllEvents();
toasts.success($t('events.cleared', { count: String(result.count) }));
events = [];
stats = { info: 0, warn: 0, error: 0, total: 0 };
offset = 0;
} catch (err) {
toasts.error(err instanceof Error ? err.message : $t('events.clearFailed'));
}
}}
oncancel={() => { showClearConfirm = false; }}
/>