style(tasks): Improve task overview page layout and styling for better readability

This commit is contained in:
Ross
2026-05-17 22:08:07 +01:00
parent 75e3bca503
commit d5e473d692
2 changed files with 40 additions and 18 deletions
+8 -8
View File
@@ -190,7 +190,6 @@ def series_reconstruct_task(
volume = np.stack([item[2] for item in sorted_items], axis=0) volume = np.stack([item[2] for item in sorted_items], axis=0)
template_ds = sorted_items[0][1] template_ds = sorted_items[0][1]
source_positions_mm = geom["source_positions_mm"]
origin_ipp = geom["origin_ipp"] origin_ipp = geom["origin_ipp"]
row_dir = geom["row_dir"] row_dir = geom["row_dir"]
col_dir = geom["col_dir"] col_dir = geom["col_dir"]
@@ -302,22 +301,23 @@ def series_reconstruct_task(
axis_positions_mm = np.arange(axis_length, dtype=float) * float(axis_spacing) axis_positions_mm = np.arange(axis_length, dtype=float) * float(axis_spacing)
end_pos = axis_positions_mm[-1] if axis_positions_mm.size else 0.0 end_pos = axis_positions_mm[-1] if axis_positions_mm.size else 0.0
centers_mm = np.arange(0.0, end_pos + (output_spacing * 0.5), output_spacing, dtype=float) start_positions_mm = np.arange(0.0, end_pos + 1e-6, output_spacing, dtype=float)
if centers_mm.size == 0: if start_positions_mm.size == 0:
centers_mm = np.array([0.0], dtype=float) start_positions_mm = np.array([0.0], dtype=float)
half = slab_thickness / 2.0
slabs = [] slabs = []
centers_idx = [] centers_idx = []
for center_mm in centers_mm: for start_mm in start_positions_mm:
mask = np.abs(axis_positions_mm - center_mm) <= (half + 1e-6) end_mm = start_mm + slab_thickness
mask = (axis_positions_mm >= (start_mm - 1e-6)) & (axis_positions_mm < (end_mm - 1e-6))
if not mask.any(): if not mask.any():
nearest = int(np.argmin(np.abs(axis_positions_mm - center_mm))) nearest = int(np.argmin(np.abs(axis_positions_mm - start_mm)))
idxs = np.array([nearest], dtype=int) idxs = np.array([nearest], dtype=int)
else: else:
idxs = np.where(mask)[0].astype(int) idxs = np.where(mask)[0].astype(int)
slabs.append(idxs) slabs.append(idxs)
center_mm = start_mm + (slab_thickness / 2.0)
centers_idx.append(float(center_mm / axis_spacing) if axis_spacing > 0 else float(idxs[0])) centers_idx.append(float(center_mm / axis_spacing) if axis_spacing > 0 else float(idxs[0]))
return slabs, centers_idx return slabs, centers_idx
+32 -10
View File
@@ -7,7 +7,29 @@ Atlas Task Overview
{% endblock title %} {% endblock title %}
{% block content %} {% block content %}
<div class="container-xl py-3"> <div class="container-fluid py-3 px-3">
<style>
.task-overview-table {
min-width: 1650px;
}
.task-overview-table th,
.task-overview-table td {
white-space: nowrap;
vertical-align: middle;
}
.task-overview-table .task-col,
.task-overview-table .generated-col,
.task-overview-table .error-col,
.task-overview-table .actions-col {
white-space: normal;
}
.task-overview-table .generated-col {
min-width: 220px;
}
</style>
<div class="d-flex flex-wrap align-items-center justify-content-between gap-2 mb-3"> <div class="d-flex flex-wrap align-items-center justify-content-between gap-2 mb-3">
<h2 class="h4 mb-0">Atlas Task Overview</h2> <h2 class="h4 mb-0">Atlas Task Overview</h2>
<div class="d-flex gap-2"> <div class="d-flex gap-2">
@@ -69,20 +91,20 @@ Atlas Task Overview
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-sm table-striped align-middle"> <table class="table table-sm table-striped align-middle task-overview-table">
<thead> <thead>
<tr> <tr>
<th style="width: 36px;"></th> <th style="width: 36px;"></th>
<th>Task</th> <th class="task-col">Task</th>
<th>Status</th> <th>Status</th>
<th>Generated Series</th> <th class="generated-col">Generated Series</th>
<th>Queue</th> <th>Queue</th>
<th>Enqueued</th> <th>Enqueued</th>
<th>Started</th> <th>Started</th>
<th>Finished</th> <th>Finished</th>
<th>Worker</th> <th>Worker</th>
<th>Error</th> <th class="error-col">Error</th>
<th>Actions</th> <th class="actions-col">Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -91,7 +113,7 @@ Atlas Task Overview
<td> <td>
<input class="form-check-input task-select" type="checkbox" name="task_ids" value="{{ task.id }}"> <input class="form-check-input task-select" type="checkbox" name="task_ids" value="{{ task.id }}">
</td> </td>
<td> <td class="task-col">
<div class="small fw-semibold">{{ task.task_path }}</div> <div class="small fw-semibold">{{ task.task_path }}</div>
<div class="small text-muted">{{ task.id }}</div> <div class="small text-muted">{{ task.id }}</div>
</td> </td>
@@ -106,7 +128,7 @@ Atlas Task Overview
<span class="badge bg-secondary">{{ task.status }}</span> <span class="badge bg-secondary">{{ task.status }}</span>
{% endif %} {% endif %}
</td> </td>
<td class="small"> <td class="small generated-col">
{% if task.generated_series %} {% if task.generated_series %}
{% for series in task.generated_series %} {% for series in task.generated_series %}
<a class="d-block" target="_blank" href="{{ series.url }}">{{ series.description }}</a> <a class="d-block" target="_blank" href="{{ series.url }}">{{ series.description }}</a>
@@ -120,8 +142,8 @@ Atlas Task Overview
<td class="small">{{ task.started_at|date:"Y-m-d H:i:s" }}</td> <td class="small">{{ task.started_at|date:"Y-m-d H:i:s" }}</td>
<td class="small">{{ task.finished_at|date:"Y-m-d H:i:s" }}</td> <td class="small">{{ task.finished_at|date:"Y-m-d H:i:s" }}</td>
<td class="small">{{ task.worker_ids }}</td> <td class="small">{{ task.worker_ids }}</td>
<td class="small text-danger">{{ task.exception_class_path|default:"" }}</td> <td class="small text-danger error-col">{{ task.exception_class_path|default:"" }}</td>
<td class="small"> <td class="small actions-col">
{% if task.traceback %} {% if task.traceback %}
<button <button
class="btn btn-outline-danger btn-sm" class="btn btn-outline-danger btn-sm"