(feature) Add live refresh for dashboard status panels
Split dashboard priority and host status sections into server-rendered partials and wire them into the shared refresh hook so operational state updates without a full page reload. Refs #36
This commit is contained in:
@@ -48,6 +48,20 @@ from .stats_summary import collect_dashboard_stats, collect_host_stats
|
||||
|
||||
@staff_member_required
|
||||
def dashboard(request):
|
||||
return render(request, "pobsync_backend/dashboard.html", _dashboard_context())
|
||||
|
||||
|
||||
@staff_member_required
|
||||
def dashboard_priority_live(request):
|
||||
return render(request, "pobsync_backend/partials/dashboard_priority.html", _dashboard_context())
|
||||
|
||||
|
||||
@staff_member_required
|
||||
def dashboard_hosts_live(request):
|
||||
return render(request, "pobsync_backend/partials/dashboard_hosts.html", _dashboard_context())
|
||||
|
||||
|
||||
def _dashboard_context() -> dict[str, object]:
|
||||
global_config = GlobalConfig.objects.filter(name="default").first()
|
||||
hosts = list(
|
||||
HostConfig.objects.select_related("schedule")
|
||||
@@ -109,7 +123,7 @@ def dashboard(request):
|
||||
).count(),
|
||||
},
|
||||
}
|
||||
return render(request, "pobsync_backend/dashboard.html", context)
|
||||
return context
|
||||
|
||||
|
||||
def _dashboard_action_items(hosts: list[HostConfig]) -> list[dict[str, object]]:
|
||||
|
||||
Reference in New Issue
Block a user