Files
SmartScanProbeTrack/app/routes/channels.py
T
2025-07-27 21:49:34 -04:00

22 lines
760 B
Python

from flask import Blueprint, render_template, redirect, url_for, flash
from app.models import Channel, Calibration
from app.routes.auth import role_required
channels_bp = Blueprint('channels', __name__)
@channels_bp.route('/<channel_id>')
@role_required('review')
def view_channel(channel_id):
"""View details of a single channel"""
channel = Channel.get_by_id(channel_id)
if not channel:
flash('Channel not found', 'danger')
return redirect(url_for('probes.list_probes'))
# Get calibration history for this channel
calibrations = Calibration.get_by_channel(channel_id)
return render_template('channel_view.html',
channel=channel,
calibrations=calibrations)