fix(frontend): don't show number of logs when no logs available

This commit is contained in:
2025-12-18 18:09:59 +08:00
parent cae7e87e06
commit a346fcff05

View File

@@ -78,10 +78,10 @@ const RequestLogs: Component = () => {
<div class="flex items-center justify-between">
<h2 class="text-2xl font-semibold">
Request Logs
<Show when={!logsData.loading}>
<Show when={totalLogs()}>
<span class="text-gray-500 text-base ml-2">
(Showing {totalLogs() === 0 ? 0 : (page() - 1) * PAGE_SIZE + 1}-
{Math.min(page() * PAGE_SIZE, totalLogs())} of {totalLogs()})
(Showing {(page() - 1) * PAGE_SIZE + 1}-{Math.min(page() * PAGE_SIZE, totalLogs())} of{" "}
{totalLogs()})
</span>
</Show>
</h2>