Expanding modal width on controller dashboard. Including hostname in controller dashboard title.

This commit is contained in:
Roland 2025-12-24 16:43:37 -07:00
parent 5fb49ad001
commit b9eb4e5104
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
4 changed files with 12 additions and 5 deletions

View file

@ -45,6 +45,7 @@ async def list_services() -> Union[list[ServiceStatusResponse], ServicesListErro
if is_docker_mode():
if can_manage_containers():
statuses = get_all_containers_status()
statuses = sorted(statuses, key=lambda s: s["name"])
return [ServiceStatusResponse(**s) for s in statuses if "error" not in s]
else:
return ServicesListErrorResponse(
@ -53,6 +54,7 @@ async def list_services() -> Union[list[ServiceStatusResponse], ServicesListErro
)
else:
statuses = get_all_services_status()
statuses = sorted(statuses, key=lambda s: s["name"])
return [ServiceStatusResponse(**s) for s in statuses]

View file

@ -150,6 +150,9 @@ async def dashboard(request: Request):
else:
services = get_all_services_status()
# Sort services by name for consistent display
services = sorted(services, key=lambda s: s["name"])
context = {
"version": __version__,
"docker_mode": is_docker_mode(),

View file

@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WROLPi Controller</title>
<title>Controller - {{ host }} WROLPi</title>
<style>
/* ===== INLINE CSS - No external files ===== */
* {
@ -599,7 +599,7 @@
<header>
<div>
<h1>WROLPi Controller</h1>
<h1>Controller - {{ host }} WROLPi</h1>
<span class="version">v{{ version }}</span>
</div>
</header>
@ -630,7 +630,7 @@
</div>
<div class="status-card">
<h3>IO Wait</h3>
<p class="value" id="iowait-value">{{ iostat.percent_iowait|default('--') }}%</p>
<p class="value" id="iowait-value">{% if iostat and iostat.percent_iowait is not none %}{{ iostat.percent_iowait }}{% else %}--{% endif %}%</p>
<p class="sub">disk waiting</p>
</div>
</div>
@ -730,7 +730,7 @@
<!-- Logs Modal -->
<div id="logs-modal" class="modal" onclick="if(event.target===this)closeLogsModal()">
<div class="modal-content">
<div class="modal-content" style="width: 80%; max-width: none;">
<div class="modal-header">
<h3 id="logs-title">Service Logs</h3>
<button class="modal-close" onclick="closeLogsModal()">&times;</button>

View file

@ -50,7 +50,9 @@ class TestDashboardEndpoint:
def test_dashboard_contains_title(self, test_client):
"""Dashboard should contain title."""
response = test_client.get("/")
assert b"WROLPi Controller" in response.content
# Title format is "Controller - {hostname} WROLPi"
assert b"Controller" in response.content
assert b"WROLPi" in response.content
def test_dashboard_contains_version(self, test_client):
"""Dashboard should contain version."""