fix the matrix
This commit is contained in:
		
							parent
							
								
									b1c31379b2
								
							
						
					
					
						commit
						df6bda30b1
					
				
							
								
								
									
										375628
									
								
								data/embeddings.json
									
									
									
									
									
								
							
							
						
						
									
										375628
									
								
								data/embeddings.json
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -771,18 +771,35 @@ const sortedTags = Object.entries(tagFrequency)
 | 
				
			|||||||
      btn.addEventListener('click', () => {
 | 
					      btn.addEventListener('click', () => {
 | 
				
			||||||
        const view = btn.getAttribute('data-view');
 | 
					        const view = btn.getAttribute('data-view');
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					        // Update active states
 | 
				
			||||||
        elements.viewToggles.forEach(b => {
 | 
					        elements.viewToggles.forEach(b => {
 | 
				
			||||||
          b.classList.toggle('active', b.getAttribute('data-view') === view);
 | 
					          b.classList.toggle('active', b.getAttribute('data-view') === view);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        window.dispatchEvent(new CustomEvent('viewChanged', { detail: view }));
 | 
					        // Call the global switchToView function
 | 
				
			||||||
        
 | 
					        if (window.switchToView) {
 | 
				
			||||||
        if (view === 'hosted') {
 | 
					          window.switchToView(view);
 | 
				
			||||||
          const hosted = window.toolsData.filter(tool => isToolHosted(tool));        
 | 
					 | 
				
			||||||
          window.dispatchEvent(new CustomEvent('toolsFiltered', { detail: hosted }));
 | 
					 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          filterTools();
 | 
					          console.error('switchToView function not available');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        // Dispatch view changed event  
 | 
				
			||||||
 | 
					        window.dispatchEvent(new CustomEvent('viewChanged', { 
 | 
				
			||||||
 | 
					          detail: view,
 | 
				
			||||||
 | 
					          triggeredByButton: true 
 | 
				
			||||||
 | 
					        }));
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        // Handle filtering after view switch
 | 
				
			||||||
 | 
					        setTimeout(() => {
 | 
				
			||||||
 | 
					          if (view === 'matrix') {
 | 
				
			||||||
 | 
					            // Ensure matrix gets populated by triggering filter
 | 
				
			||||||
 | 
					            filterTools();
 | 
				
			||||||
 | 
					          } else if (view === 'grid') {
 | 
				
			||||||
 | 
					            // Standard filtering for grid view
 | 
				
			||||||
 | 
					            filterTools();
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          // AI view doesn't need filtering from here
 | 
				
			||||||
 | 
					        }, 100); // Slightly longer delay to ensure view switch completes
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
				
			|||||||
@ -772,19 +772,24 @@ domains.forEach((domain: any) => {
 | 
				
			|||||||
  window.addEventListener('viewChanged', (event) => {
 | 
					  window.addEventListener('viewChanged', (event) => {
 | 
				
			||||||
    const view = event.detail;
 | 
					    const view = event.detail;
 | 
				
			||||||
    if (view === 'matrix') {
 | 
					    if (view === 'matrix') {
 | 
				
			||||||
      setTimeout(updateMatrixHighlighting, 100);
 | 
					      setTimeout(() => {
 | 
				
			||||||
 | 
					        if (window.filterTools && typeof window.filterTools === 'function') {
 | 
				
			||||||
 | 
					          window.filterTools();
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					          const allTools = window.toolsData || [];
 | 
				
			||||||
 | 
					          window.dispatchEvent(new CustomEvent('toolsFiltered', {
 | 
				
			||||||
 | 
					            detail: {
 | 
				
			||||||
 | 
					              tools: allTools,
 | 
				
			||||||
 | 
					              semanticSearch: false
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          }));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }, 100);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  window.addEventListener('toolsFiltered', (event) => {
 | 
					  window.addEventListener('toolsFiltered', (event) => {
 | 
				
			||||||
    const currentView = document.querySelector('.view-toggle.active')?.getAttribute('data-view');
 | 
					    const { tools: filtered, semanticSearch } = event.detail; // ✅ Correct destructuring
 | 
				
			||||||
    if (currentView === 'matrix') {
 | 
					 | 
				
			||||||
      setTimeout(updateMatrixHighlighting, 50);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  window.addEventListener('toolsFiltered', (event) => {
 | 
					 | 
				
			||||||
    const filtered = event.detail;
 | 
					 | 
				
			||||||
    const currentView = document.querySelector('.view-toggle.active')?.getAttribute('data-view');
 | 
					    const currentView = document.querySelector('.view-toggle.active')?.getAttribute('data-view');
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (currentView === 'matrix') {
 | 
					    if (currentView === 'matrix') {
 | 
				
			||||||
@ -827,6 +832,7 @@ domains.forEach((domain: any) => {
 | 
				
			|||||||
                                hasValidProjectUrl ? 'tool-chip-hosted' : 
 | 
					                                hasValidProjectUrl ? 'tool-chip-hosted' : 
 | 
				
			||||||
                                tool.license !== 'Proprietary' ? 'tool-chip-oss' : '';
 | 
					                                tool.license !== 'Proprietary' ? 'tool-chip-oss' : '';
 | 
				
			||||||
                chip.className = `tool-chip ${chipClass}`;
 | 
					                chip.className = `tool-chip ${chipClass}`;
 | 
				
			||||||
 | 
					                chip.setAttribute('data-tool-name', tool.name);
 | 
				
			||||||
                chip.setAttribute('title', `${tool.name}${tool.knowledgebase === true ? ' (KB verfügbar)' : ''}`);
 | 
					                chip.setAttribute('title', `${tool.name}${tool.knowledgebase === true ? ' (KB verfügbar)' : ''}`);
 | 
				
			||||||
                chip.innerHTML = `${tool.name}${tool.knowledgebase === true ? '<span style="margin-left: 0.25rem; font-size: 0.6875rem;">📖</span>' : ''}`;
 | 
					                chip.innerHTML = `${tool.name}${tool.knowledgebase === true ? '<span style="margin-left: 0.25rem; font-size: 0.6875rem;">📖</span>' : ''}`;
 | 
				
			||||||
                chip.onclick = () => window.showToolDetails(tool.name);
 | 
					                chip.onclick = () => window.showToolDetails(tool.name);
 | 
				
			||||||
 | 
				
			|||||||
@ -1157,6 +1157,8 @@ tools:
 | 
				
			|||||||
      - nethunter
 | 
					      - nethunter
 | 
				
			||||||
      - custom-builds
 | 
					      - custom-builds
 | 
				
			||||||
      - rolling-release
 | 
					      - rolling-release
 | 
				
			||||||
 | 
					    domain-agnostic-software:
 | 
				
			||||||
 | 
					      - specific-os
 | 
				
			||||||
    related_software:
 | 
					    related_software:
 | 
				
			||||||
      - Parrot Security OS
 | 
					      - Parrot Security OS
 | 
				
			||||||
      - SIFT Workstation
 | 
					      - SIFT Workstation
 | 
				
			||||||
@ -2433,6 +2435,8 @@ tools:
 | 
				
			|||||||
      - mobile-forensics
 | 
					      - mobile-forensics
 | 
				
			||||||
    platforms:
 | 
					    platforms:
 | 
				
			||||||
      - OS
 | 
					      - OS
 | 
				
			||||||
 | 
					    domain-agnostic-software:
 | 
				
			||||||
 | 
					      - specific-os
 | 
				
			||||||
    tags:
 | 
					    tags:
 | 
				
			||||||
      - gui
 | 
					      - gui
 | 
				
			||||||
      - cli
 | 
					      - cli
 | 
				
			||||||
@ -2476,6 +2480,8 @@ tools:
 | 
				
			|||||||
      - mobile-forensics
 | 
					      - mobile-forensics
 | 
				
			||||||
    platforms:
 | 
					    platforms:
 | 
				
			||||||
      - OS
 | 
					      - OS
 | 
				
			||||||
 | 
					    domain-agnostic-software:
 | 
				
			||||||
 | 
					      - specific-os
 | 
				
			||||||
    tags:
 | 
					    tags:
 | 
				
			||||||
      - gui
 | 
					      - gui
 | 
				
			||||||
      - write-blocker
 | 
					      - write-blocker
 | 
				
			||||||
@ -2536,6 +2542,8 @@ tools:
 | 
				
			|||||||
    icon: 🦜
 | 
					    icon: 🦜
 | 
				
			||||||
    license: GPL-3.0
 | 
					    license: GPL-3.0
 | 
				
			||||||
    accessType: download
 | 
					    accessType: download
 | 
				
			||||||
 | 
					    domain-agnostic-software:
 | 
				
			||||||
 | 
					      - specific-os
 | 
				
			||||||
  - name: LibreOffice
 | 
					  - name: LibreOffice
 | 
				
			||||||
    type: software
 | 
					    type: software
 | 
				
			||||||
    description: >-
 | 
					    description: >-
 | 
				
			||||||
@ -3081,6 +3089,8 @@ tools:
 | 
				
			|||||||
    skillLevel: beginner
 | 
					    skillLevel: beginner
 | 
				
			||||||
    domains:
 | 
					    domains:
 | 
				
			||||||
      - collaboration-general
 | 
					      - collaboration-general
 | 
				
			||||||
 | 
					    domain-agnostic-software:
 | 
				
			||||||
 | 
					      - collaboration-general
 | 
				
			||||||
    phases:
 | 
					    phases:
 | 
				
			||||||
      - reporting
 | 
					      - reporting
 | 
				
			||||||
    platforms:
 | 
					    platforms:
 | 
				
			||||||
@ -3783,6 +3793,8 @@ tools:
 | 
				
			|||||||
    skillLevel: beginner
 | 
					    skillLevel: beginner
 | 
				
			||||||
    domains:
 | 
					    domains:
 | 
				
			||||||
      - collaboration-general
 | 
					      - collaboration-general
 | 
				
			||||||
 | 
					    domain-agnostic-software:
 | 
				
			||||||
 | 
					      - collaboration-general
 | 
				
			||||||
    phases:
 | 
					    phases:
 | 
				
			||||||
      - reporting
 | 
					      - reporting
 | 
				
			||||||
    platforms:
 | 
					    platforms:
 | 
				
			||||||
@ -4490,6 +4502,8 @@ tools:
 | 
				
			|||||||
      - analysis
 | 
					      - analysis
 | 
				
			||||||
    platforms:
 | 
					    platforms:
 | 
				
			||||||
      - Linux
 | 
					      - Linux
 | 
				
			||||||
 | 
					    domain-agnostic-software:
 | 
				
			||||||
 | 
					      - specific-os
 | 
				
			||||||
    tags:
 | 
					    tags:
 | 
				
			||||||
      - live-distro
 | 
					      - live-distro
 | 
				
			||||||
      - imaging
 | 
					      - imaging
 | 
				
			||||||
@ -7214,4 +7228,3 @@ scenarios:
 | 
				
			|||||||
  - id: scenario:windows-registry
 | 
					  - id: scenario:windows-registry
 | 
				
			||||||
    icon: 📜
 | 
					    icon: 📜
 | 
				
			||||||
    friendly_name: Windows Registry analysieren
 | 
					    friendly_name: Windows Registry analysieren
 | 
				
			||||||
skill_levels: {}
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -356,6 +356,8 @@ if (aiAuthRequired) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function switchToView(view) {
 | 
					    function switchToView(view) {
 | 
				
			||||||
 | 
					      console.log('[VIEW] Switching to view:', view);
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
      const toolsGrid = document.getElementById('tools-grid');
 | 
					      const toolsGrid = document.getElementById('tools-grid');
 | 
				
			||||||
      const matrixContainer = document.getElementById('matrix-container');
 | 
					      const matrixContainer = document.getElementById('matrix-container');
 | 
				
			||||||
      const aiInterface = document.getElementById('ai-interface');
 | 
					      const aiInterface = document.getElementById('ai-interface');
 | 
				
			||||||
@ -365,8 +367,12 @@ if (aiAuthRequired) {
 | 
				
			|||||||
      const methodologySection = document.getElementById('methodology-section');
 | 
					      const methodologySection = document.getElementById('methodology-section');
 | 
				
			||||||
      const targetedSection = document.getElementById('targeted-section');
 | 
					      const targetedSection = document.getElementById('targeted-section');
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
 | 
					      // Hide all views
 | 
				
			||||||
      if (toolsGrid) toolsGrid.style.display = 'none';
 | 
					      if (toolsGrid) toolsGrid.style.display = 'none';
 | 
				
			||||||
      if (matrixContainer) matrixContainer.style.display = 'none';
 | 
					      if (matrixContainer) {
 | 
				
			||||||
 | 
					        matrixContainer.style.display = 'none';
 | 
				
			||||||
 | 
					        matrixContainer.classList.add('hidden');
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      if (aiInterface) aiInterface.style.display = 'none';
 | 
					      if (aiInterface) aiInterface.style.display = 'none';
 | 
				
			||||||
      if (noResults) noResults.style.display = 'none';
 | 
					      if (noResults) noResults.style.display = 'none';
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
@ -375,14 +381,22 @@ if (aiAuthRequired) {
 | 
				
			|||||||
      
 | 
					      
 | 
				
			||||||
      switch (view) {
 | 
					      switch (view) {
 | 
				
			||||||
        case 'grid':
 | 
					        case 'grid':
 | 
				
			||||||
 | 
					          console.log('[VIEW] Showing grid view');
 | 
				
			||||||
          if (toolsGrid) toolsGrid.style.display = 'block';
 | 
					          if (toolsGrid) toolsGrid.style.display = 'block';
 | 
				
			||||||
          if (filtersSection) filtersSection.style.display = 'block';
 | 
					          if (filtersSection) filtersSection.style.display = 'block';
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
 | 
					          
 | 
				
			||||||
        case 'matrix':
 | 
					        case 'matrix':
 | 
				
			||||||
          if (matrixContainer) matrixContainer.style.display = 'block';
 | 
					          console.log('[VIEW] Showing matrix view');
 | 
				
			||||||
 | 
					          if (matrixContainer) {
 | 
				
			||||||
 | 
					            matrixContainer.style.display = 'block';
 | 
				
			||||||
 | 
					            matrixContainer.classList.remove('hidden');
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
          if (filtersSection) filtersSection.style.display = 'block';
 | 
					          if (filtersSection) filtersSection.style.display = 'block';
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
 | 
					          
 | 
				
			||||||
        case 'ai':
 | 
					        case 'ai':
 | 
				
			||||||
 | 
					          console.log('[VIEW] Showing AI view');
 | 
				
			||||||
          if (aiAuthRequired && !aiAuthenticated) {
 | 
					          if (aiAuthRequired && !aiAuthenticated) {
 | 
				
			||||||
            console.log('[AUTH] AI access denied, redirecting to login');
 | 
					            console.log('[AUTH] AI access denied, redirecting to login');
 | 
				
			||||||
            const currentUrl = encodeURIComponent(window.location.href);
 | 
					            const currentUrl = encodeURIComponent(window.location.href);
 | 
				
			||||||
@ -405,8 +419,12 @@ if (aiAuthRequired) {
 | 
				
			|||||||
            });
 | 
					            });
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
 | 
					          
 | 
				
			||||||
 | 
					        default:
 | 
				
			||||||
 | 
					          console.warn('[VIEW] Unknown view:', view);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
 | 
					      // Restore all filter sections for non-AI views
 | 
				
			||||||
      if (view !== 'ai' && filtersSection) {
 | 
					      if (view !== 'ai' && filtersSection) {
 | 
				
			||||||
        const filterSections = filtersSection.querySelectorAll('.filter-section');
 | 
					        const filterSections = filtersSection.querySelectorAll('.filter-section');
 | 
				
			||||||
        filterSections.forEach(section => {
 | 
					        filterSections.forEach(section => {
 | 
				
			||||||
@ -415,7 +433,6 @@ if (aiAuthRequired) {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Rest of the existing code remains the same...
 | 
					 | 
				
			||||||
    window.navigateToGrid = function(toolName) {
 | 
					    window.navigateToGrid = function(toolName) {
 | 
				
			||||||
      console.log('Navigating to grid for tool:', toolName);
 | 
					      console.log('Navigating to grid for tool:', toolName);
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
@ -655,10 +672,13 @@ if (aiAuthRequired) {
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    window.addEventListener('viewChanged', (event) => {
 | 
					    window.addEventListener('viewChanged', (event) => {
 | 
				
			||||||
      const view = event.detail;
 | 
					      const view = event.detail;
 | 
				
			||||||
      switchToView(view);
 | 
					      if (!event.triggeredByButton) {
 | 
				
			||||||
 | 
					        switchToView(view);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    window.switchToAIView = () => switchToView('ai');
 | 
					    window.switchToAIView = () => switchToView('ai');
 | 
				
			||||||
 | 
					    window.switchToView = switchToView;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    handleSharedURL();
 | 
					    handleSharedURL();
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user