Migrating Controller from port 8087 to 80 so that it is more discoverable. Reformatting Controller dashboard to make header at the top. Reformatting navigation bar to handle the new links which prevented Admin from being visible in some screens.

This commit is contained in:
Roland 2026-04-07 20:01:49 -06:00 • committed by lrnselfreliance
parent c316a178f9
commit e0324ce0fc
33 changed files with 302 additions and 407 deletions

View file

@ -54,11 +54,6 @@ class TestDashboardEndpoint:
assert b"Controller" in response.content
assert b"WROLPi" in response.content
def test_dashboard_contains_version(self, test_client):
"""Dashboard should contain version."""
response = test_client.get("/")
assert __version__.encode() in response.content
def test_dashboard_contains_status_cards(self, test_client):
"""Dashboard should contain status cards."""
response = test_client.get("/")
@ -123,13 +118,6 @@ class TestDashboardEndpoint:
tbody_content = tbody_match.group(1)
assert 'id="boot-' not in tbody_content
def test_dashboard_has_upgrade_banner_element(self, test_client):
"""Dashboard should have upgrade banner element for upgrade mode."""
response = test_client.get("/")
content = response.text
assert 'id="upgrade-banner"' in content
assert "Upgrade in Progress" in content
def test_dashboard_has_mount_modal(self, test_client):
"""Dashboard should have mount modal for disk mounting."""
response = test_client.get("/")

View file

@ -38,16 +38,16 @@ class TestGetConfig:
assert "throttle" in config
def test_get_config_default_port(self, reset_runtime_config):
"""Default port should be 8087."""
"""Default port should be 80."""
config = get_config()
assert config["port"] == 8087
assert config["port"] == 80
class TestGetConfigValue:
"""Tests for get_config_value function."""
@pytest.mark.parametrize("key,expected", [
("port", 8087),
("port", 80),
("media_directory", "/media/wrolpi"),
("drives.auto_mount", True),
("hotspot.ssid", "WROLPi"),
@ -145,7 +145,7 @@ class TestReloadConfigFromDrive:
result = reload_config_from_drive()
assert result is False
# Should still have defaults
assert get_config_value("port") == 8087
assert get_config_value("port") == 80
def test_reload_handles_empty_file(
self, reset_runtime_config, mock_config_path
@ -158,7 +158,7 @@ class TestReloadConfigFromDrive:
# File exists and was processed, so returns True
assert result is True
# Config should still have all defaults
assert get_config_value("port") == 8087
assert get_config_value("port") == 80
class TestSaveConfig:
@ -210,7 +210,7 @@ class TestSaveConfig:
assert mock_config_path.exists()
# Reset to default value
update_config("port", 8087) # Default port
update_config("port", 80) # Default port
save_config()
# File should still exist (serves as marker that drive is set up)

View file

@ -14,8 +14,8 @@ class TestDefaultConfig:
assert isinstance(DEFAULT_CONFIG, dict)
def test_default_port(self):
"""Default port should be 8087."""
assert DEFAULT_CONFIG["port"] == 8087
"""Default port should be 80."""
assert DEFAULT_CONFIG["port"] == 80
def test_default_media_directory(self):
"""Default media directory should be /media/wrolpi."""
@ -66,7 +66,7 @@ class TestManagedServicesConfig:
{"systemd_name": "wrolpi-api-dev", "port": 8081, "viewable": True, "show_only_when_running": True}),
("wrolpi-app", {"port": 3000, "viewable": False}),
("wrolpi-app-dev", {"port": 3000, "viewable": False, "show_only_when_running": True}),
("caddy", {"port": 80}),
("caddy", {"port": 443}),
("postgresql", {"port": 5432, "viewable": False}),
("wrolpi-upgrade", {"port": None, "viewable": False, "show_only_when_running": True}),
])