web: Replace page data flags with route ID checks for history/logs pages

This commit is contained in:
nemunaire 2026-02-10 10:47:46 +07:00
commit f6f885f85f
3 changed files with 8 additions and 22 deletions

View file

@ -76,7 +76,13 @@
goto(
"/domains/" +
encodeURIComponent(domainLink(dn)) +
(page.data.isAuditPage ? "/logs" : page.data.isHistoryPage ? "/history" : ""),
(page.route.id
? page.route.id.startsWith("/domains/[dn]/logs")
? "/logs"
: page.route.id.startsWith("/domains/[dn]/history")
? "/history"
: ""
: ""),
);
}
if (selectedDomain != dn) {
@ -166,7 +172,7 @@
<SelectDomain bind:selectedDomain />
</div>
{#if page.data.isHistoryPage || page.data.isAuditPage}
{#if page.route.id && (page.route.id.startsWith("/domains/[dn]/history") || page.route.id.startsWith("/domains/[dn]/logs"))}
<Button
class="mt-2"
outline

View file

@ -1,10 +0,0 @@
import type { Load } from "@sveltejs/kit";
export const load: Load = async ({ parent }) => {
const data = await parent();
return {
...data,
isHistoryPage: true,
};
};

View file

@ -1,10 +0,0 @@
import type { Load } from "@sveltejs/kit";
export const load: Load = async ({ parent }) => {
const data = await parent();
return {
...data,
isAuditPage: true,
};
};