style(tasks): Improve task overview page layout and styling for better readability
This commit is contained in:
+8
-8
@@ -190,7 +190,6 @@ def series_reconstruct_task(
|
||||
volume = np.stack([item[2] for item in sorted_items], axis=0)
|
||||
|
||||
template_ds = sorted_items[0][1]
|
||||
source_positions_mm = geom["source_positions_mm"]
|
||||
origin_ipp = geom["origin_ipp"]
|
||||
row_dir = geom["row_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)
|
||||
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)
|
||||
if centers_mm.size == 0:
|
||||
centers_mm = np.array([0.0], dtype=float)
|
||||
start_positions_mm = np.arange(0.0, end_pos + 1e-6, output_spacing, dtype=float)
|
||||
if start_positions_mm.size == 0:
|
||||
start_positions_mm = np.array([0.0], dtype=float)
|
||||
|
||||
half = slab_thickness / 2.0
|
||||
slabs = []
|
||||
centers_idx = []
|
||||
for center_mm in centers_mm:
|
||||
mask = np.abs(axis_positions_mm - center_mm) <= (half + 1e-6)
|
||||
for start_mm in start_positions_mm:
|
||||
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():
|
||||
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)
|
||||
else:
|
||||
idxs = np.where(mask)[0].astype(int)
|
||||
|
||||
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]))
|
||||
|
||||
return slabs, centers_idx
|
||||
|
||||
@@ -7,7 +7,29 @@ Atlas Task Overview
|
||||
{% endblock title %}
|
||||
|
||||
{% 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">
|
||||
<h2 class="h4 mb-0">Atlas Task Overview</h2>
|
||||
<div class="d-flex gap-2">
|
||||
@@ -69,20 +91,20 @@ Atlas Task Overview
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<tr>
|
||||
<th style="width: 36px;"></th>
|
||||
<th>Task</th>
|
||||
<th class="task-col">Task</th>
|
||||
<th>Status</th>
|
||||
<th>Generated Series</th>
|
||||
<th class="generated-col">Generated Series</th>
|
||||
<th>Queue</th>
|
||||
<th>Enqueued</th>
|
||||
<th>Started</th>
|
||||
<th>Finished</th>
|
||||
<th>Worker</th>
|
||||
<th>Error</th>
|
||||
<th>Actions</th>
|
||||
<th class="error-col">Error</th>
|
||||
<th class="actions-col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -91,7 +113,7 @@ Atlas Task Overview
|
||||
<td>
|
||||
<input class="form-check-input task-select" type="checkbox" name="task_ids" value="{{ task.id }}">
|
||||
</td>
|
||||
<td>
|
||||
<td class="task-col">
|
||||
<div class="small fw-semibold">{{ task.task_path }}</div>
|
||||
<div class="small text-muted">{{ task.id }}</div>
|
||||
</td>
|
||||
@@ -106,7 +128,7 @@ Atlas Task Overview
|
||||
<span class="badge bg-secondary">{{ task.status }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="small">
|
||||
<td class="small generated-col">
|
||||
{% if task.generated_series %}
|
||||
{% for series in task.generated_series %}
|
||||
<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.finished_at|date:"Y-m-d H:i:s" }}</td>
|
||||
<td class="small">{{ task.worker_ids }}</td>
|
||||
<td class="small text-danger">{{ task.exception_class_path|default:"" }}</td>
|
||||
<td class="small">
|
||||
<td class="small text-danger error-col">{{ task.exception_class_path|default:"" }}</td>
|
||||
<td class="small actions-col">
|
||||
{% if task.traceback %}
|
||||
<button
|
||||
class="btn btn-outline-danger btn-sm"
|
||||
|
||||
Reference in New Issue
Block a user