From dc9006da63e9ca442c68ef5d8b64635a3c5b81e1 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Mon, 6 Oct 2025 07:01:21 +0100 Subject: [PATCH] Fixes and improvments to nav, card collection and sitemap page --- src/lib/components/furniture/TopNav.svelte | 37 ++++++++++++---------- src/lib/components/global/ToolsGrid.svelte | 5 ++- src/lib/constants/icon-map.ts | 9 ++++++ src/lib/constants/nav.ts | 13 ++++++-- src/routes/sitemap/+page.svelte | 15 ++++++++- 5 files changed, 58 insertions(+), 21 deletions(-) diff --git a/src/lib/components/furniture/TopNav.svelte b/src/lib/components/furniture/TopNav.svelte index 37d5f9d..0bfb18a 100644 --- a/src/lib/components/furniture/TopNav.svelte +++ b/src/lib/components/furniture/TopNav.svelte @@ -81,22 +81,27 @@ switch ($navbarDisplay) { case 'bookmarked': - items = $bookmarks.map((bookmark) => ({ - href: bookmark.href, - label: bookmark.label, - icon: bookmark.icon, - description: bookmark.description, - })); + items = $bookmarks + .filter((bookmark) => bookmark.label) + .map((bookmark) => ({ + href: bookmark.href, + label: bookmark.label, + icon: bookmark.icon, + description: bookmark.description, + })); // Show most recent bookmarks first return items.reverse(); case 'frequent': - items = $frequentlyUsedTools.slice(0, 8).map((tool) => ({ - href: tool.href, - label: tool.label || 'Untitled Tool', - icon: tool.icon, - description: tool.description, - })); + items = $frequentlyUsedTools + .filter((tool) => tool.label) + .slice(0, 8) + .map((tool) => ({ + href: tool.href, + label: tool.label || 'Untitled Tool', + icon: tool.icon, + description: tool.description, + })); // Already sorted by frequency, no need to reverse return items; @@ -106,7 +111,7 @@ case 'default': default: // Keep default navigation items in their original order - return TOP_NAV; + return TOP_NAV.filter((item) => item.label); } })(); @@ -158,8 +163,8 @@
{#each getSubPages(item.href) as subItem ('href' in subItem ? subItem.href : subItem.title)} - {#if 'href' in subItem} - + {#if 'href' in subItem && subItem.label} +
- {#each subItem.items as groupItem (groupItem.href)} + {#each subItem.items.filter((i) => i.label) as groupItem (groupItem.href)} array.findIndex((t) => t.href === tool.href) === index); + // Also filter out items without a label + $: uniqueTools = tools + .filter((tool) => tool.label) + .filter((tool, index, array) => array.findIndex((t) => t.href === tool.href) === index); {#if uniqueTools.length === 0 && searchQuery} diff --git a/src/lib/constants/icon-map.ts b/src/lib/constants/icon-map.ts index 5352729..e26713a 100644 --- a/src/lib/constants/icon-map.ts +++ b/src/lib/constants/icon-map.ts @@ -239,5 +239,14 @@ export const iconMap: Record = { cookie: ``, archive: ``, compress: ``, + 'ref-common-subnets': ``, + 'ref-network-classes': ``, + 'ref-reserved-ranges': ``, + 'terminal': ``, + 'file-x': ``, + 'folder': ``, + 'package': ``, + 'tag': ``, + 'monitor': ``, // '': ``, }; diff --git a/src/lib/constants/nav.ts b/src/lib/constants/nav.ts index 87e2abc..638f7cf 100644 --- a/src/lib/constants/nav.ts +++ b/src/lib/constants/nav.ts @@ -1271,6 +1271,13 @@ export const SUB_NAV: Record = { icon: 'tls-cipher-presets', keywords: ['tls', 'cipher', 'presets', 'modern', 'intermediate', 'legacy', 'security', 'suites', 'probe'], }, + { + href: makePath('/diagnostics/tls/banner'), + label: 'Service Banner Grabber', + description: 'Retrieve service banners from SSH, SMTP, HTTP, FTP, and other network services', + icon: 'terminal', + keywords: ['banner', 'service', 'ssh', 'smtp', 'ftp', 'http', 'telnet', 'fingerprinting', 'reconnaissance'], + }, ], }, { @@ -1903,10 +1910,10 @@ function extractAllNavItems(navStructure: (NavItem | NavGroup)[]): NavItem[] { for (const item of navStructure) { if ('items' in item) { - // It's a NavGroup (might have href too, but we only want its items) - items.push(...item.items); + // It's a NavGroup - recursively extract items from its children + items.push(...extractAllNavItems(item.items)); } else if ('href' in item && 'label' in item) { - // It's a NavItem (has href and label) + // It's a NavItem (has href and label, but no items) items.push(item as NavItem); } } diff --git a/src/routes/sitemap/+page.svelte b/src/routes/sitemap/+page.svelte index e94ed51..1c9ec20 100644 --- a/src/routes/sitemap/+page.svelte +++ b/src/routes/sitemap/+page.svelte @@ -1,11 +1,13 @@