PoliSage / src /templates /monitoring /list_sources.html
yasserrmd's picture
Upload 80 files
0a40ab8 verified
{% extends "base.html" %}
{% block title %}Monitoring Sources - PoliSage{% endblock %}
{% block content %}
<div class="container mt-4">
<div class="d-flex justify-content-between align-items-center mb-3">
<h2>Monitoring Sources</h2>
<a href="{{ url_for("monitoring.add_source") }}" class="btn btn-primary">
<i class="bi bi-plus-circle me-1"></i> Add Source
</a>
</div>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
{% if sources %}
<div class="list-group">
{% for source in sources %}
<a href="{{ url_for("monitoring.view_source", source_id=source.id) }}" class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">{{ source.name }}</h5>
<small>Last Checked: {{ source.last_checked.strftime("%Y-%m-%d %H:%M") if source.last_checked else "Never" }}</small>
</div>
<p class="mb-1">URL: <span class="text-muted">{{ source.url }}</span></p>
<p class="mb-1">Type: <span class="badge bg-secondary">{{ source.type }}</span> | Frequency: {{ source.frequency_minutes }} min | Status: <span class="badge {{ "bg-success" if source.is_active else "bg-danger" }}">{{ "Active" if source.is_active else "Inactive" }}</span></p>
</a>
{% endfor %}
</div>
{% else %}
<div class="alert alert-info" role="alert">
No monitoring sources found. <a href="{{ url_for("monitoring.add_source") }}">Add a new one?</a>
</div>
{% endif %}
</div>
{% endblock %}