mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 06:56:18 -05:00
Add controller onboarding flow for primary drive setup
Introduce an onboarding system in the Controller that guides users through selecting and mounting their primary media drive. This is the fallback UI flow used when the main React app is unavailable. Key changes: - Add onboarding API endpoints and schemas (controller/api/onboarding.py) - Add onboarding logic to detect drives, handle already-mounted drives (needed for RPi which auto-mounts), and save primary drive selection to the controller config when no mounts are configured - Extend the Controller's index.html template with the onboarding UI - Skip root cert creation until onboarding is complete - Update first_startup.sh to support the onboarding/repair flow - Add comprehensive tests for onboarding logic and API
This commit is contained in:
parent
f146b332a8
commit
07f601e77f
15 changed files with 1464 additions and 66 deletions
|
|
@ -211,8 +211,19 @@ class TestDriveMountedStatus:
|
|||
data = response.json()
|
||||
assert data["drive_mounted"] is expected
|
||||
|
||||
def test_dashboard_shows_drive_not_mounted_banner(self, reset_runtime_config, mock_docker_mode):
|
||||
"""Dashboard should show banner when drive is not mounted."""
|
||||
def test_dashboard_shows_onboarding_when_drive_not_mounted(self, reset_runtime_config, mock_docker_mode):
|
||||
"""Dashboard should show onboarding banner in native mode when drive is not mounted."""
|
||||
from controller.main import app
|
||||
|
||||
with mock.patch(
|
||||
"controller.main.is_primary_drive_mounted", return_value=False
|
||||
):
|
||||
with TestClient(app) as client:
|
||||
response = client.get("/")
|
||||
assert "Welcome to WROLPi" in response.text
|
||||
|
||||
def test_dashboard_shows_drive_not_mounted_banner_in_docker(self, reset_runtime_config, mock_docker_mode_enabled):
|
||||
"""Dashboard should show info banner in Docker mode when drive is not mounted."""
|
||||
from controller.main import app
|
||||
|
||||
with mock.patch(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue