404 lines
15 KiB
Plaintext
404 lines
15 KiB
Plaintext
---
|
||
import BaseLayout from '../layouts/BaseLayout.astro';
|
||
import ToolCard from '../components/ToolCard.astro';
|
||
import ToolFilters from '../components/ToolFilters.astro';
|
||
import ToolMatrix from '../components/ToolMatrix.astro';
|
||
import AIQueryInterface from '../components/AIQueryInterface.astro';
|
||
import { getToolsData } from '../utils/dataService.js';
|
||
|
||
// Load tools data
|
||
const data = await getToolsData();
|
||
const tools = data.tools;
|
||
---
|
||
|
||
<BaseLayout title="~/">
|
||
<!-- Hero Section -->
|
||
<section style="padding: 2rem 0 1rem; border-bottom: 1px solid var(--color-border);">
|
||
<div style="text-align: center; margin-bottom: 2rem; padding: 2rem; background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%); border-radius: 1rem; border: 1px solid var(--color-border);">
|
||
<h1 style="margin-bottom: 1rem; font-size: 1.5rem; color: var(--color-primary);">CC24 // DFIR - Guide</h1>
|
||
|
||
<p style="font-size: 1.25rem; margin-bottom: 1.125rem; color: var(--color-text);">
|
||
<strong>Das richtige Werkzeug zur richtigen Zeit</strong> – in der digitalen Forensik entscheidet oft die Wahl der passenden Methode oder Software über Erfolg oder Misserfolg einer Untersuchung.
|
||
</p>
|
||
|
||
<p class="text-muted" style="font-size: 1rem; margin-bottom: 1.5rem; line-height: 1.7;">
|
||
Unser kuratiertes Verzeichnis bietet euch eine strukturierte Übersicht über bewährte Methoden und Tools,
|
||
kategorisiert nach forensischen Domänen und Untersuchungsphasen nach Kent, Chevalier, Grance & Dang.
|
||
</p>
|
||
|
||
<p class="text-muted" style="font-size: 0.9rem; margin-bottom: 2rem; line-height: 1.6;">
|
||
<span style="color: var(--color-primary); font-weight: 500;">Info:</span>
|
||
Die lila gekennzeichneten Einträge sind über das Single-Sign-On der CC24-Cloud direkt zugänglich.
|
||
Teilnehmer der Seminargruppe CC24-w1 können die gehostete Infrastruktur nutzen.
|
||
Sollten spezielle Berechtigungen für den Zugriff erforderlich sein oder etwas nicht funktionieren, <a href="/about#support">kontaktiert mich</a>.
|
||
</p>
|
||
|
||
<div style="display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;">
|
||
<a href="/about" class="btn btn-primary" style="padding: 0.75rem 1.5rem;">
|
||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 0.5rem;">
|
||
<circle cx="12" cy="12" r="10"></circle>
|
||
<path d="M12 16v-4"></path>
|
||
<path d="M12 8h.01"></path>
|
||
</svg>
|
||
Infos zu SSO & Zugang
|
||
</a>
|
||
|
||
<!-- AI Query Button -->
|
||
<button id="ai-query-btn" class="btn btn-accent" style="padding: 0.75rem 1.5rem; background-color: var(--color-accent); color: white;">
|
||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 0.5rem;">
|
||
<path d="M9 11H5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2h-4"/>
|
||
<path d="M9 11V7a3 3 0 0 1 6 0v4"/>
|
||
</svg>
|
||
KI befragen
|
||
</button>
|
||
|
||
<!-- Contribution Button -->
|
||
<a href="/contribute" class="btn" style="padding: 0.75rem 1.5rem; background-color: var(--color-warning); color: white; border-color: var(--color-warning);" data-contribute-button="new">
|
||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 0.5rem;">
|
||
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
|
||
<circle cx="8.5" cy="7" r="4"/>
|
||
<line x1="20" y1="8" x2="20" y2="14"/>
|
||
<line x1="23" y1="11" x2="17" y2="11"/>
|
||
</svg>
|
||
Beitragen
|
||
</a>
|
||
|
||
<a href="#filters-section" class="btn btn-secondary" style="padding: 0.75rem 1.5rem;">
|
||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin-right: 0.5rem;">
|
||
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path>
|
||
<polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline>
|
||
<line x1="12" y1="22.08" x2="12" y2="12"></line>
|
||
</svg>
|
||
Entdecken
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- Filters Section -->
|
||
<section id="filters-section" style="padding: 2rem 0;">
|
||
<ToolFilters data={data} />
|
||
</section>
|
||
|
||
<!-- AI Query Interface -->
|
||
<AIQueryInterface />
|
||
|
||
<!-- Tools Grid -->
|
||
<section id="tools-grid" style="padding-bottom: 2rem;">
|
||
<div class="grid-auto-fit" id="tools-container">
|
||
{tools.map((tool: any) => (
|
||
<ToolCard tool={tool} />
|
||
))}
|
||
</div>
|
||
|
||
<!-- No results message -->
|
||
<div id="no-results" style="display: none; text-align: center; padding: 4rem 0;">
|
||
<p class="text-muted" style="font-size: 1.125rem;">No tools found matching your criteria.</p>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- Matrix View -->
|
||
<ToolMatrix data={data} />
|
||
</BaseLayout>
|
||
|
||
<script define:vars={{ toolsData: data.tools }}>
|
||
// Store tools data globally
|
||
window.toolsData = toolsData;
|
||
|
||
// Handle view changes and filtering
|
||
document.addEventListener('DOMContentLoaded', () => {
|
||
const toolsContainer = document.getElementById('tools-container');
|
||
const toolsGrid = document.getElementById('tools-grid');
|
||
const matrixContainer = document.getElementById('matrix-container');
|
||
const aiInterface = document.getElementById('ai-interface');
|
||
const filtersSection = document.getElementById('filters-section');
|
||
const noResults = document.getElementById('no-results');
|
||
const aiQueryBtn = document.getElementById('ai-query-btn');
|
||
|
||
// Guard against null elements
|
||
if (!toolsContainer || !toolsGrid || !matrixContainer || !noResults || !aiInterface || !filtersSection) {
|
||
console.error('Required DOM elements not found');
|
||
return;
|
||
}
|
||
|
||
// AI Query Button Handler using consolidated auth system
|
||
if (aiQueryBtn) {
|
||
aiQueryBtn.addEventListener('click', async () => {
|
||
// Use the global auth system consistently
|
||
if (typeof window.requireClientAuth === 'function') {
|
||
await window.requireClientAuth(() => switchToView('ai'), `${window.location.pathname}?view=ai`);
|
||
} else {
|
||
// Better fallback logging
|
||
console.warn('[AUTH] requireClientAuth not available - client-auth.js may not be loaded properly');
|
||
switchToView('ai');
|
||
}
|
||
});
|
||
}
|
||
|
||
// Function to switch between different views
|
||
function switchToView(view) {
|
||
// Hide all views first
|
||
toolsGrid.style.display = 'none';
|
||
matrixContainer.style.display = 'none';
|
||
aiInterface.style.display = 'none';
|
||
filtersSection.style.display = 'none';
|
||
|
||
// Update view toggle buttons
|
||
const viewToggles = document.querySelectorAll('.view-toggle');
|
||
viewToggles.forEach(btn => {
|
||
btn.classList.toggle('active', btn.getAttribute('data-view') === view);
|
||
});
|
||
|
||
// Show appropriate view and manage filter visibility
|
||
switch (view) {
|
||
case 'ai':
|
||
aiInterface.style.display = 'block';
|
||
filtersSection.style.display = 'block';
|
||
hideFilterControls();
|
||
if (window.restoreAIResults) {
|
||
window.restoreAIResults();
|
||
}
|
||
const aiInput = document.getElementById('ai-query-input');
|
||
if (aiInput) {
|
||
setTimeout(() => aiInput.focus(), 100);
|
||
}
|
||
break;
|
||
case 'matrix':
|
||
matrixContainer.style.display = 'block';
|
||
filtersSection.style.display = 'block';
|
||
showFilterControls();
|
||
break;
|
||
default: // grid
|
||
toolsGrid.style.display = 'block';
|
||
filtersSection.style.display = 'block';
|
||
showFilterControls();
|
||
break;
|
||
}
|
||
|
||
// Clear URL parameters after switching
|
||
if (window.location.search) {
|
||
window.history.replaceState({}, '', window.location.pathname);
|
||
}
|
||
}
|
||
|
||
// Helper functions for filter control visibility
|
||
function hideFilterControls() {
|
||
const elements = [
|
||
'.domain-phase-container',
|
||
'#search-input',
|
||
'.tag-cloud',
|
||
'.tag-header',
|
||
'.checkbox-wrapper'
|
||
];
|
||
|
||
elements.forEach(selector => {
|
||
const element = document.querySelector(selector);
|
||
if (element) element.style.display = 'none';
|
||
});
|
||
|
||
const allInputs = filtersSection.querySelectorAll('input, select, textarea');
|
||
allInputs.forEach(input => input.style.display = 'none');
|
||
}
|
||
|
||
function showFilterControls() {
|
||
const domainPhaseContainer = document.querySelector('.domain-phase-container');
|
||
const searchInput = document.getElementById('search-input');
|
||
const tagCloud = document.querySelector('.tag-cloud');
|
||
const tagHeader = document.querySelector('.tag-header');
|
||
const checkboxWrappers = document.querySelectorAll('.checkbox-wrapper');
|
||
const allInputs = filtersSection.querySelectorAll('input, select, textarea');
|
||
|
||
if (domainPhaseContainer) domainPhaseContainer.style.display = 'grid';
|
||
if (searchInput) searchInput.style.display = 'block';
|
||
if (tagCloud) tagCloud.style.display = 'flex';
|
||
if (tagHeader) tagHeader.style.display = 'flex';
|
||
|
||
allInputs.forEach(input => input.style.display = 'block');
|
||
checkboxWrappers.forEach(wrapper => wrapper.style.display = 'flex');
|
||
}
|
||
|
||
// REMOVED: createToolSlug function - now using window.createToolSlug
|
||
// REMOVED: findTool function - now using window.findToolByIdentifier
|
||
|
||
// Navigation functions for sharing
|
||
window.navigateToGrid = function(toolName) {
|
||
console.log('Navigating to grid for tool:', toolName);
|
||
|
||
// Switch to grid view first
|
||
switchToView('grid');
|
||
|
||
// Wait for view switch, then find and scroll to tool
|
||
setTimeout(() => {
|
||
// Clear any filters first
|
||
if (window.clearAllFilters) {
|
||
window.clearAllFilters();
|
||
}
|
||
|
||
// Wait for filters to clear and re-render
|
||
setTimeout(() => {
|
||
const toolCards = document.querySelectorAll('.tool-card');
|
||
let targetCard = null;
|
||
|
||
toolCards.forEach(card => {
|
||
const cardTitle = card.querySelector('h3');
|
||
if (cardTitle) {
|
||
// Clean title text (remove icons and extra spaces)
|
||
const titleText = cardTitle.textContent?.replace(/[^\w\s\-\.]/g, '').trim();
|
||
if (titleText === toolName) {
|
||
targetCard = card;
|
||
}
|
||
}
|
||
});
|
||
|
||
if (targetCard) {
|
||
console.log('Found target card, scrolling...');
|
||
targetCard.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||
targetCard.style.animation = 'highlight-flash 2s ease-out';
|
||
|
||
setTimeout(() => {
|
||
if (targetCard) {
|
||
targetCard.style.animation = '';
|
||
}
|
||
}, 2000);
|
||
} else {
|
||
console.warn('Tool card not found in grid:', toolName);
|
||
}
|
||
}, 300);
|
||
}, 200);
|
||
};
|
||
|
||
window.navigateToMatrix = function(toolName) {
|
||
console.log('Navigating to matrix for tool:', toolName);
|
||
|
||
// Switch to matrix view
|
||
switchToView('matrix');
|
||
|
||
// Wait for view switch and matrix to render
|
||
setTimeout(() => {
|
||
const toolChips = document.querySelectorAll('.tool-chip');
|
||
let firstMatch = null;
|
||
let matchCount = 0;
|
||
|
||
toolChips.forEach(chip => {
|
||
// Clean the chip text (remove emoji and extra spaces)
|
||
const chipText = chip.textContent?.replace(/📖/g, '').replace(/[^\w\s\-\.]/g, '').trim();
|
||
if (chipText === toolName) {
|
||
// Highlight this occurrence
|
||
chip.style.animation = 'highlight-flash 2s ease-out';
|
||
matchCount++;
|
||
|
||
// Remember the first match for scrolling
|
||
if (!firstMatch) {
|
||
firstMatch = chip;
|
||
}
|
||
|
||
// Clean up animation after it completes
|
||
setTimeout(() => {
|
||
chip.style.animation = '';
|
||
}, 8000);
|
||
}
|
||
});
|
||
|
||
if (firstMatch) {
|
||
console.log(`Found ${matchCount} occurrences of tool, highlighting all and scrolling to first`);
|
||
firstMatch.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||
} else {
|
||
console.warn('Tool chip not found in matrix:', toolName);
|
||
}
|
||
}, 500);
|
||
};
|
||
|
||
// Handle URL parameters on page load
|
||
function handleSharedURL() {
|
||
const urlParams = new URLSearchParams(window.location.search);
|
||
const toolParam = urlParams.get('tool');
|
||
const viewParam = urlParams.get('view');
|
||
const modalParam = urlParams.get('modal');
|
||
|
||
if (!toolParam) {
|
||
// Check for AI view parameter
|
||
if (viewParam === 'ai') {
|
||
switchToView('ai');
|
||
}
|
||
return;
|
||
}
|
||
|
||
// Find the tool by name or slug using global function
|
||
const tool = window.findToolByIdentifier(window.toolsData, toolParam);
|
||
if (!tool) {
|
||
console.warn('Shared tool not found:', toolParam);
|
||
return;
|
||
}
|
||
|
||
// Clear URL parameters to avoid re-triggering
|
||
const cleanUrl = window.location.protocol + "//" + window.location.host + window.location.pathname;
|
||
window.history.replaceState({}, document.title, cleanUrl);
|
||
|
||
// Handle different view types
|
||
setTimeout(() => {
|
||
switch (viewParam) {
|
||
case 'grid':
|
||
window.navigateToGrid(tool.name);
|
||
break;
|
||
case 'matrix':
|
||
window.navigateToMatrix(tool.name);
|
||
break;
|
||
case 'modal':
|
||
if (modalParam === 'secondary') {
|
||
window.showToolDetails(tool.name, 'secondary');
|
||
} else {
|
||
window.showToolDetails(tool.name, 'primary');
|
||
}
|
||
break;
|
||
default:
|
||
window.navigateToGrid(tool.name);
|
||
}
|
||
}, 100);
|
||
}
|
||
|
||
// ENHANCED: New filtering logic using show/hide pattern
|
||
window.addEventListener('toolsFiltered', (event) => {
|
||
const filtered = event.detail;
|
||
const currentView = document.querySelector('.view-toggle.active')?.getAttribute('data-view');
|
||
|
||
if (currentView === 'matrix' || currentView === 'ai') {
|
||
return;
|
||
}
|
||
|
||
// Get all existing tool cards
|
||
const allToolCards = document.querySelectorAll('.tool-card');
|
||
const filteredNames = new Set(filtered.map(tool => tool.name.toLowerCase()));
|
||
|
||
let visibleCount = 0;
|
||
|
||
allToolCards.forEach(card => {
|
||
const toolName = card.getAttribute('data-tool-name');
|
||
if (filteredNames.has(toolName)) {
|
||
card.style.display = 'block';
|
||
visibleCount++;
|
||
} else {
|
||
card.style.display = 'none';
|
||
}
|
||
});
|
||
|
||
// Show/hide no results message
|
||
if (visibleCount === 0) {
|
||
noResults.style.display = 'block';
|
||
} else {
|
||
noResults.style.display = 'none';
|
||
}
|
||
});
|
||
|
||
// Handle view changes
|
||
window.addEventListener('viewChanged', (event) => {
|
||
const view = event.detail;
|
||
switchToView(view);
|
||
});
|
||
|
||
// Make switchToView available globally
|
||
window.switchToAIView = () => switchToView('ai');
|
||
|
||
// Initialize URL handling
|
||
handleSharedURL();
|
||
});
|
||
</script> |