Update probe related models, routes and templates

This commit is contained in:
Andrew Conlon
2025-07-29 10:51:42 -04:00
parent 7e62e61124
commit 2600a5aa61
7 changed files with 395 additions and 47 deletions
+21 -18
View File
@@ -24,41 +24,44 @@
<thead>
<tr>
<th>Model</th>
<th>Serial Number</th>
<th>Description</th>
<th>Created</th>
<th>Status</th>
<th>Retired</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% set current_model = none %}
{% for probe in probes|sort(attribute='model_name') %}
{% if probe.model_name != current_model %}
<tr class="table-info">
<td colspan="6">
<strong>{{ probe.model_name }}</strong>
</td>
</tr>
{% set current_model = probe.model_name %}
{% endif %}
<tr class="probe-row" data-active="{{ 'true' if not probe.retired_at else 'false' }}">
<td></td> <!-- Empty cell under model header -->
<td>{{ probe.serial_number }}</td>
<td>{{ probe.description }}</td>
<td>{{ probe.model_name }}</td>
<td>{{ probe.created_at.strftime('%Y-%m-%d') }}</td>
<td>
{% if probe.retired_at %}
<span class="badge bg-secondary">Retired</span>
<span class="badge bg-secondary">Yes</span>
{% else %}
<span class="badge bg-success">Active</span>
<span class="badge bg-success">No</span>
{% endif %}
</td>
<td>
<a href="{{ url_for('probes.view_probe', probe_id=probe.id) }}"
class="btn btn-sm btn-outline-primary">View</a>
class="btn btn-sm btn-outline-primary">View/Edit</a>
</td>
</tr>
{% if probe.channels %}
{% for channel in probe.channels %}
<tr class="channel-row">
<td colspan="2">
<small class="text-muted">
Channel: {{ channel.parameter.parameter_name }} ({{ channel.serial_number }})
</small>
</td>
<td></td>
<td>
<a href="{{ url_for('channels.view_channel', channel_id=channel.id) }}"
class="btn btn-sm btn-outline-secondary">View</a>
</td>
</tr>
{% endfor %}
{% endif %}
{% endfor %}
</tbody>
</table>