Files
SmartScanProbeTrack/templates/probe_view.html
T
2025-07-27 21:49:34 -04:00

110 lines
4.3 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="container mt-4">
<div class="card">
<div class="card-header">
<div class="d-flex justify-content-between align-items-center">
<h2 class="mb-0">Probe: {{ probe.serial_number }}</h2>
<span class="badge
{% if probe.retired_at %}bg-secondary
{% else %}bg-success{% endif %}">
{% if probe.retired_at %}Retired{% else %}Active{% endif %}
</span>
</div>
</div>
<div class="card-body">
<div class="row mb-3">
<div class="col-md-6">
<h5>Details</h5>
<dl class="row">
<dt class="col-sm-4">Serial Number</dt>
<dd class="col-sm-8">{{ probe.serial_number }}</dd>
<dt class="col-sm-4">Created</dt>
<dd class="col-sm-8">{{ probe.created_at.strftime('%Y-%m-%d') }}</dd>
{% if probe.retired_at %}
<dt class="col-sm-4">Retired</dt>
<dd class="col-sm-8">{{ probe.retired_at.strftime('%Y-%m-%d') }}</dd>
{% endif %}
</dl>
</div>
</div>
</div>
{% if channels %}
<div class="mt-4">
<h5>Channels</h5>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Serial Number</th>
<th>Parameter</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for channel in channels %}
<tr>
<td>{{ channel.serial_number }}</td>
<td>{{ channel.parameter.parameter_name }}</td>
<td>
<a href="{{ url_for('channels.view_channel', channel_id=channel.id) }}"
class="btn btn-sm btn-outline-primary">View</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% else %}
<div class="alert alert-info mt-4">No channels found for this probe</div>
{% endif %}
{% if locations %}
<div class="mt-4">
<h5>Location History</h5>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Location</th>
<th>Start Date</th>
<th>End Date</th>
</tr>
</thead>
<tbody>
{% for location in locations %}
<tr>
<td>{{ location.location.name }}</td>
<td>{{ location.start_date.strftime('%Y-%m-%d') }}</td>
<td>
{% if location.end_date %}
{{ location.end_date.strftime('%Y-%m-%d') }}
{% else %}
Current
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% else %}
<div class="alert alert-info mt-4">No location history found for this probe</div>
{% endif %}
<div class="mt-4">
<a href="{{ url_for('probes.list_probes') }}"
class="btn btn-outline-secondary">Back to List</a>
</div>
</div>
</div>
</div>
{% endblock %}