fix: Add LAPI status check to wizard prerequisites (v0.6.0-r3)

Fix wizard Next button being disabled issue:
- Add lapi_status field to get_status() RPC method
- Check LAPI availability using 'cscli lapi status'
- Returns 'available' or 'unavailable' status
- Enables wizard to proceed when LAPI is accessible

Backend Changes:
- root/usr/libexec/rpcd/luci.crowdsec-dashboard
  - Add LAPI status check before json_dump
  - Run 'cscli lapi status' to verify Local API accessibility

Issue: Wizard showed LAPI as UNAVAILABLE even when working
Cause: Missing lapi_status field in status RPC response
Solution: Add LAPI availability check to backend

Version: 0.6.0-3

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-01-07 08:58:54 +01:00
parent f665d7fdb7
commit c83304fac8
2 changed files with 11 additions and 2 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-crowdsec-dashboard
PKG_VERSION:=0.6.0
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_ARCH:=all
PKG_LICENSE:=Apache-2.0

View File

@ -129,7 +129,16 @@ get_status() {
local uptime_sec
uptime_sec=$(cat /proc/uptime | cut -d' ' -f1 | cut -d'.' -f1)
json_add_int "uptime" "$uptime_sec"
# LAPI status (check if Local API is accessible)
local lapi_status="unavailable"
if [ -x "$CSCLI" ]; then
if $CSCLI lapi status >/dev/null 2>&1; then
lapi_status="available"
fi
fi
json_add_string "lapi_status" "$lapi_status"
json_dump
}