dashboard
Dashboard page handlers.
struct DashboardFragmentTemplate
struct DashboardFragmentTemplateThe dashboard’s content alone, which the live-reload script swaps in.
| Field | Type | Description |
|---|---|---|
active_iteration_count |
usize | Iterations whose status is active. |
artifact_count |
usize | Artifacts in the project that are not archived. |
cancelled_count |
usize | Tasks whose status is cancelled. |
cancelled_iteration_count |
usize | Iterations whose status is cancelled. |
completed_iteration_count |
usize | Iterations whose status is completed. |
done_count |
usize | Tasks whose status is done. |
in_progress_count |
usize | Tasks whose status is in progress. |
iteration_count |
usize | Iterations shown in the summary card; the active ones only, the same number as active_iteration_count. |
open_count |
usize | Tasks whose status is open. |
task_count |
usize | Tasks still to finish: the open ones plus the in-progress ones. |
Implements Template, Display, FastWritable.
struct DashboardTemplate
struct DashboardTemplateThe full dashboard page, with the layout around the counts.
| Field | Type | Description |
|---|---|---|
active_iteration_count |
usize | Iterations whose status is active. |
artifact_count |
usize | Artifacts in the project that are not archived. |
cancelled_count |
usize | Tasks whose status is cancelled. |
cancelled_iteration_count |
usize | Iterations whose status is cancelled. |
completed_iteration_count |
usize | Iterations whose status is completed. |
done_count |
usize | Tasks whose status is done. |
in_progress_count |
usize | Tasks whose status is in progress. |
iteration_count |
usize | Iterations shown in the summary card; the active ones only, the same number as active_iteration_count. |
open_count |
usize | Tasks whose status is open. |
task_count |
usize | Tasks still to finish: the open ones plus the in-progress ones. |
Implements Template, Display, FastWritable.
fn dashboard
pub async fn dashboard(State(state): State<AppState>) -> Result<Html<String>, web::Error>Dashboard page showing project summary.
| Parameter | Type | Description |
|---|---|---|
State(state) |
State<AppState> | the shared app state, for the store and the project id |
| returns | Result<Html<String>, web::Error> | The rendered page, or a web::Error when the store or the template fails. |
fn dashboard_fragment
pub async fn dashboard_fragment(State(state): State<AppState>) -> Result<Html<String>, web::Error>Dashboard content fragment for live reload.
| Parameter | Type | Description |
|---|---|---|
State(state) |
State<AppState> | the shared app state, for the store and the project id |
| returns | Result<Html<String>, web::Error> | The rendered fragment, without the page layout, or a web::Error when the store or the template fails. |
fn dashboard_counts
fn dashboard_counts(
tasks: &[task::Model],
artifacts: &[artifact::Model],
iterations: &[iteration::Model],
) -> (usize, usize, usize, usize, usize, usize, usize, usize, usize, usize)Compute dashboard status counts from task, artifact, and iteration lists.
| Parameter | Type | Description |
|---|---|---|
tasks |
&[task::Model] | every task of the project |
artifacts |
&[artifact::Model] | the artifacts of the project that are not archived |
iterations |
&[iteration::Model] | every iteration of the project |
| returns | (usize, usize, usize, usize, usize, usize, usize, usize, usize, usize) | The counts in the order of the template fields: active iterations, artifacts, cancelled tasks, cancelled iterations, completed iterations, done tasks, in-progress tasks, iterations (the active count again), open tasks, and unfinished tasks (open plus in progress). |