3.0 KiB
3.0 KiB
Package Manager Badges Enhancement
Current Implementation Issues
1. Incorrect Detection on Fedora
- Problem: Fedora machine incorrectly shows as using APT
- Root Cause: Detection logic is not properly identifying the correct package manager for the OS
- Expected: Fedora should show DNF as active, APT as inactive/greyed out
2. Incomplete Package Manager Display
- Problem: Only shows package managers detected as available
- Desired: Show ALL supported package manager types with visual indication of which are active
- Supported types: APT, DNF, Windows Update, Winget, Docker
3. Visual Design Issues
- Problem: Badges are positioned next to the description rather than inline with text
- Desired: Badges should be integrated inline with the description text
- Example: "Package managers: [APT] [DNF] [Docker]" where active ones are colored and inactive are grey
4. Color Consistency
- Problem: Color scheme not consistent
- Desired:
- Active package managers: Use consistent color scheme (e.g., blue for all active)
- Inactive package managers: Greyed out
- Specific colors can be: blue, purple, green but should be consistent across active ones
Implementation Requirements
Backend Changes
-
Enhanced OS Detection in
aggregator-agent/internal/scanner/registry.go- Improve
IsAvailable()methods to correctly identify OS-appropriate package managers - Add OS detection logic to prevent false positives (e.g., APT on Fedora)
- Improve
-
API Endpoint Enhancement
- Current:
/api/v1/agents/{id}/scannersreturns only available scanners - Enhanced: Return all supported scanner types with
available: true/falseflag
- Current:
Frontend Changes
-
Badge Component Restructuring in
AgentHealth.tsx// Current: Only shows available scanners const enabledScanners = agentScanners.filter(s => s.enabled); // Desired: Show all supported scanners with availability status const allScanners = [ { type: 'apt', name: 'APT', available: false, enabled: false }, { type: 'dnf', name: 'DNF', available: true, enabled: true }, // ... etc ]; -
Inline Badge Display
// Current: Badges next to description <div>Package Managers:</div> <div>{badges}</div> // Desired: Inline with text <div> Package Managers: <Badge className={aptAvailable ? 'bg-blue-500' : 'bg-gray-400'}>APT</Badge> <Badge className={dnfAvailable ? 'bg-blue-500' : 'bg-gray-400'}>DNF</Badge> {/* ... etc */} </div>
Priority: Medium
This is a UX improvement that also fixes a functional bug (incorrect detection on Fedora).
Related Files
aggregator-web/src/components/AgentHealth.tsx- Badge display logicaggregator-agent/internal/scanner/registry.go- Scanner detection logicaggregator-agent/internal/scanner/apt.go- APT availability detectionaggregator-agent/internal/scanner/dnf.go- DNF availability detectionaggregator-server/internal/api/handlers/scanner_config.go- API endpoint