Check how missing data appears


Drag the divider or use the arrow keys to compare themes.
Django Chassis 1.0.23 · training site with Russian UI
- The empty state can retain a visible timestamp for the last snapshot.
- An unavailable source gets a message and details about what happened.
- A measured zero remains visible as a real metric.
How to add it
In src/apps/admins/services/demo_dashboard_service.py, use these fixtures in DemoDashboardService.get_example_states(). The demo's DashboardComponentsAdminPage passes them as state_examples to src/apps/admins/templates/admins/dashboard/components.html. In that template, loop over the cards with the variable name card and include admin/chassis/dashboard/card_content.html.
from datetime import timedelta
from django.utils import timezone
from django_chassis.dto import DashboardCardDTO, MetricSummaryDTO
from django_chassis.enums import DashboardSourceState
def get_example_states() -> list[DashboardCardDTO]:
last_sample_at = timezone.now() - timedelta(hours=2)
return [
DashboardCardDTO(
slug='example-empty', label='No measurements', content=None,
source_state=DashboardSourceState.EMPTY, is_demo=True
),
DashboardCardDTO(
slug='example-unavailable', label='Source unavailable', content=None,
source_state=DashboardSourceState.UNAVAILABLE, is_demo=True
),
DashboardCardDTO(
slug='example-stale', label='Last snapshot',
content=MetricSummaryDTO(title='Queued jobs', value=12, observed_at=last_sample_at),
source_state=DashboardSourceState.STALE, observed_at=last_sample_at, is_demo=True
),
DashboardCardDTO(
slug='example-zero', label='Queue depth',
content=MetricSummaryDTO(title='Queued jobs', value=0),
observed_at=timezone.now(), is_demo=True
)
]
Open /admin/pages/dashboard-components/ as a superuser. For a live source, assign observed_at from the real measurement and keep value=0 for an observed zero.