Improvement, Fixes

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2026-03-17 00:04:06 +01:00
parent 55d7a3404a
commit 909d61525a
5 changed files with 26 additions and 16 deletions

View File

@@ -2,8 +2,13 @@
import { Menu } from "lucide-svelte"; import { Menu } from "lucide-svelte";
import type { NavItem } from "../types/nav"; import type { NavItem } from "../types/nav";
export let title: string = ""; let {
export let navLinks: NavItem[] = []; title = "",
navLinks = [],
}: {
title?: string;
navLinks?: NavItem[];
} = $props();
</script> </script>
<div class="bg-base-200"> <div class="bg-base-200">

View File

@@ -1,18 +1,8 @@
<script lang="ts"> <script lang="ts">
import { User, Lock, Check, MessageCircle } from "lucide-svelte"; import { User, Lock, Check, MessageCircle } from "lucide-svelte";
import type { Result } from "src/types/nav";
export interface Result { let { result }: { result: Result} = $props();
manufacturer: string;
name: string;
icon: string;
tags: string[];
version: string;
comment: string;
user: string;
pass: string;
}
let { result }: { result: Result } = $props();
let copiedUser = $state(false); let copiedUser = $state(false);
let copiedPass = $state(false); let copiedPass = $state(false);

View File

@@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { onMount } from "svelte"; import { onMount } from "svelte";
import type { Result as ResultType } from "./Result.svelte";
import Result from "./Result.svelte"; import Result from "./Result.svelte";
import type { Result as ResultType } from "src/types/nav";
import { Search } from "lucide-svelte"; import { Search } from "lucide-svelte";
import DefaultView from "./DefaultView.svelte"; import DefaultView from "./DefaultView.svelte";
import NotFoundView from "./NotFoundView.svelte"; import NotFoundView from "./NotFoundView.svelte";

View File

@@ -110,7 +110,11 @@ export const GET: APIRoute = async ({ url, request }) => {
); );
} }
// Server-side tracking for search queries, respecting DNT/GPC // NOTE: Server-side tracking is intentionally only triggered when DNT/GPC is active.
// When DNT is off, the client handles tracking via Umami's JS snippet.
// When DNT is on, the JS snippet is suppressed, so we fall back to server-side tracking
// to log search queries (query string + result count only, no user data) in order to
// identify missing manufacturers/products and improve the dataset.
if (query && dnt) { if (query && dnt) {
await trackSearchServerSide(query, filtered.length); await trackSearchServerSide(query, filtered.length);
} }

View File

@@ -4,3 +4,14 @@ export interface NavItem {
icon?: any; icon?: any;
children?: NavItem[]; children?: NavItem[];
} }
export interface Result {
manufacturer: string;
name: string;
icon: string;
tags: string[];
version: string;
comment: string;
user: string;
pass: string;
}