Commit Graph

7 Commits

Author SHA1 Message Date
9ce67f2da5 fix: Use correct UCI section types in SecuBox settings view (v0.6.0-r12)
- Changed form sections from type 'secubox' to match actual UCI config
- General/Dashboard/Module/Notification sections now use type 'core'
- Alert Thresholds section now uses type 'diagnostics'
- Security Settings section now uses type 'security'
- Advanced Settings section uses type 'core'
- Fixes "This section contains no values yet" errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 12:18:18 +01:00
09694b64a1 fix: Use SecuBox cyber-checkbox class for collection checkboxes (v0.6.0-r8)
Fix invisible checkboxes using SecuBox theme structure:
- Wrap checkbox inputs with .cyber-checkbox label class
- Update wizard.css to style .cyber-checkbox properly
- Use theme's native checkbox styling from forms.css
- Add !important to override theme defaults where needed

Issue: Checkboxes still not visible after inline styles
Root Cause: SecuBox theme requires .cyber-checkbox wrapper class
Solution: Restructure HTML to match theme's checkbox pattern

Structure Change:
OLD: <label><input><div class="collection-info">
NEW: <label class="cyber-checkbox"><input><div class="collection-info">

CSS Updates:
- .collection-item .cyber-checkbox (flex layout with gap)
- .collection-item .cyber-checkbox input[type="checkbox"] (18x18px, flex-shrink: 0)
- Added !important to override theme padding

Theme Pattern:
.cyber-checkbox { display: inline-flex; align-items: center; gap: 0.5rem; }
.cyber-checkbox input[type="checkbox"] { width: 18px; height: 18px; }

Version: 0.6.0-8

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 09:17:25 +01:00
439bab6361 fix: Make collection checkboxes visible with inline styles (v0.6.0-r7)
Fix invisible checkboxes in Step 3 collections:
- Add explicit inline styles to checkbox inputs
- Set width: 18px, height: 18px with cursor: pointer
- Add 'for' attribute to label for better click handling
- Replace null rendering with empty element E([])
- Fixes "null" text appearing on screen

Issue: Collection items not selectable, checkboxes invisible
Cause: Checkboxes may be hidden by browser default styles
Solution: Add explicit inline styles and proper label association

Frontend Changes:
- htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js
  - Add inline styles to checkbox inputs
  - Add 'for' attribute linking label to checkbox
  - Replace ': null' with ': E([])' to avoid "null" text

Checkboxes now have:
- Explicit dimensions (18x18px)
- Proper cursor styling
- Label association via 'for' attribute
- No more "null" text rendering

Version: 0.6.0-7

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 09:15:17 +01:00
be3a367e18 fix: Update Hub API returns full response object (v0.6.0-r6)
Fix hub update failing in wizard:
- Change updateHub API expect from {success: false} to {}
- Returns full response object {success: true, message: "..."}
- Wizard can now properly check result.success
- Enables getCollections() call after successful update

Issue: Hub update showed "Hub update failed" despite success
Cause: RPC expect field extracted only boolean value instead of full object
Solution: Remove expect field to return complete response

Frontend Changes:
- htdocs/luci-static/resources/crowdsec-dashboard/api.js
  - callUpdateHub: Change expect: {success: false} to expect: {}
- htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js
  - Add comprehensive error logging and catch handler
  - Better error messages with error.message details

Backend Returns:
{"success": true, "message": "Hub index updated successfully"}

Version: 0.6.0-6

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 09:12:57 +01:00
aefc6e5265 fix: Read status from data parameter in wizard step 1 (v0.6.0-r5)
Fix Next button remaining disabled despite correct status:
- Change renderStep1 to read from data parameter instead of wizardData
- Read status.crowdsec and status.lapi_status from passed data
- Ensures button state reflects actual API response

Issue: Next button not clickable even with LAPI available
Cause: renderStep1 reading from stale wizardData instead of fresh data
Solution: Read from data parameter passed by render()

Frontend Changes:
- htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js
  - renderStep1: Read from data.status instead of this.wizardData
  - Extract crowdsecRunning and lapiAvailable from data parameter

Version: 0.6.0-5

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 09:05:34 +01:00
4c0ab93284 fix: Load wizard CSS in render method (v0.6.0-r4)
Fix missing navigation buttons in wizard:
- Add explicit CSS loading in render() method
- Use L.resource() to load wizard.css
- Inject <link> tag into document head
- Ensures wizard styling is applied

Issue: Navigation buttons (Cancel, Next) not visible
Cause: wizard.css was not being loaded
Solution: Add CSS file loading in render method

Frontend Changes:
- htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js
  - Add CSS link injection in render()
  - Load crowdsec-dashboard/wizard.css via L.resource()

Version: 0.6.0-4

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 09:01:11 +01:00
ad2e89fd47 feat: CrowdSec Setup Wizard - Complete First-Time Installation (v0.6.0)
Major Features:
- Add comprehensive 6-step setup wizard for CrowdSec initial configuration
- Automated hub update, collection installation, and bouncer configuration
- Complete turnkey solution requiring zero manual configuration

Wizard Flow:
1. Welcome & Prerequisites - Check CrowdSec and LAPI status
2. Update CrowdSec Hub - Fetch latest security collections
3. Install Collections - Pre-selected security packs (ssh-bf, http-cve, linux)
4. Configure Firewall Bouncer - Auto-register with API key generation
5. Enable & Start Services - Start bouncer and verify nftables
6. Verification & Summary - Show completion status with statistics

UI Components:
- Visual stepper with active/complete/pending states
- Real-time progress indicators and status badges
- Auto-advancement after successful operations
- Professional dark-themed styling with animations
- Fully responsive design (mobile/tablet/desktop)

New Files:
- htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js (815 lines)
- htdocs/luci-static/resources/crowdsec-dashboard/wizard.css (578 lines)

Backend Enhancements:
- Add check_wizard_needed() RPC method for first-time setup detection
- Add wizard_state() RPC method for wizard initialization
- Update API module with wizard method declarations
- Add wizard menu item (order: 5, appears first in CrowdSec section)
- Update ACL permissions for wizard RPC methods

User Experience:
- < 2 minute complete CrowdSec setup from fresh install
- Clear visual feedback at each step
- Error handling with retry capability
- Final verification shows all systems operational

Version: 0.6.0-1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 08:39:41 +01:00