diff --git a/app.py b/app.py index 64512f3..12c6ba0 100644 --- a/app.py +++ b/app.py @@ -344,10 +344,9 @@ def collect(): "warnings": warnings, } -def collect_logs_only(): +def collect_admin_data(): """ - Lightweight version that only collects app names and logs. - Much faster than collect() since it skips stats, metrics, and system info. + Collects logs and detailed container info for the admin dashboard. """ ps_rows = docker_ps_all() apps = [] @@ -361,6 +360,7 @@ def collect_logs_only(): "app": app_name, "container": name, "logs": get_container_logs(name, lines=50), + "detail": get_container_detail(name) }) # Sort by app name @@ -432,16 +432,9 @@ def logout(): @app.get("/admin") @login_required def admin(): - data = collect_logs_only() + data = collect_admin_data() return render_template("admin.html", data=data, poll_seconds=POLL_SECONDS) -# Protected container detail page -@app.get("/admin/container/") -@login_required -def container_detail(container_name): - detail = get_container_detail(container_name) - return render_template("container_detail.html", container=detail, container_name=container_name) - # API endpoint for container details (used by admin panel) @app.get("/api/container/") @login_required diff --git a/templates/admin.html b/templates/admin.html index b58cd74..85779ce 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -4,7 +4,7 @@ - Admin - DokkuStatus + Admin Control Center - DokkuStatus @@ -12,6 +12,18 @@ -
-
-

[ ADMIN PANEL ]

-
- - [LOGOUT] -
+
+
+

[ CONTROL CENTER ]

+ SYS_UPTIME: LIVE
+ +
- {% for r in data.apps %} -
-
-
[{{ r.app }}]
-
- -
-
+
+ -
- -

Container Logs

-
-
[LAST 50 LINES]
- -
-
- {% if r.logs %} - {% for log in r.logs %} -
{{ log.text }}
- {% endfor %} - {% else %} -
[no logs available]
- {% endif %} +
+ {% for r in data.apps %} +
+
+

{{ r.app }}

+ CONTAINER: {{ r.container }}
- -

Container Details

-
-
- +
+
+
+
IDENTIFIER
+
{{ r.detail.id or '—' }}
+
+
+
IMAGE_BLOCK
+
{{ r.detail.image or '—' }}
+
+
+
NETWORK_INTERFACE
+
+ IP: {{ r.detail.ip_address or '—' }}
+ NET: {{ (r.detail.networks or []) | join(', ') }} +
+
+
+
PORTS_EXPOSED
+
+ {% for port, mappings in (r.detail.ports or {}).items() %} + {{ port }} + {% if mappings %} → {{ mappings[0].HostPort }}{% endif %}
+ {% endfor %} +
+
+
+
ENVIRONMENT_STORAGE
+
+ {% for env in (r.detail.env or []) %} + {% set parts = env.split('=', 1) %} +
+ {{ parts[0] }}={{ parts[1] }} +
+ {% endfor %} +
+
+
+ +
+
+ LAST_50_EVENTS + +
+
+ {% if r.logs %} + {% for log in r.logs %} +
{{ log.text }}
+ {% endfor %} + {% else %} +
[ NO LOG DATA DETECTED ]
+ {% endif %} +
-
+
+ {% endfor %}
- {% endfor %} -
+
diff --git a/templates/login.html b/templates/login.html index 0833de4..d1fde61 100644 --- a/templates/login.html +++ b/templates/login.html @@ -154,7 +154,7 @@ required />
- + {% if error %}