300 lines
12 KiB
HTML
300 lines
12 KiB
HTML
{% extends 'base.html' %}
|
||
|
||
{% block title %}OSINT Администраторски Табло{% endblock %}
|
||
|
||
{% block extra_css %}
|
||
<style>
|
||
.dashboard-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||
gap: 1.5rem;
|
||
margin-bottom: 2rem;
|
||
}
|
||
|
||
.dashboard-card {
|
||
background: var(--gov-white);
|
||
border-radius: 10px;
|
||
box-shadow: 0 4px 16px var(--gov-shadow);
|
||
padding: 1.5rem;
|
||
border-left: 4px solid var(--gov-secondary);
|
||
}
|
||
|
||
.dashboard-card h3 {
|
||
font-family: 'Roboto Slab', serif;
|
||
color: var(--gov-primary);
|
||
margin-bottom: 1rem;
|
||
font-size: 1.3rem;
|
||
border-bottom: 2px solid var(--gov-gray-light);
|
||
padding-bottom: 0.5rem;
|
||
}
|
||
|
||
.stat-number {
|
||
font-size: 2.5rem;
|
||
font-weight: 700;
|
||
color: var(--gov-secondary);
|
||
margin: 0.5rem 0;
|
||
}
|
||
|
||
.quick-actions {
|
||
display: flex;
|
||
gap: 1rem;
|
||
flex-wrap: wrap;
|
||
margin-top: 1rem;
|
||
}
|
||
|
||
.table-responsive {
|
||
overflow-x: auto;
|
||
margin-top: 1rem;
|
||
}
|
||
|
||
.status-badge {
|
||
display: inline-block;
|
||
padding: 0.25rem 0.75rem;
|
||
border-radius: 12px;
|
||
font-size: 0.85rem;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.status-active { background: #d4edda; color: #155724; }
|
||
.status-inactive { background: #f8d7da; color: #721c24; }
|
||
.status-pending { background: #fff3cd; color: #856404; }
|
||
</style>
|
||
{% endblock %}
|
||
|
||
{% block content %}
|
||
<div class="gov-card">
|
||
<div class="gov-card-header">
|
||
<h2>🤖 OSINT Администраторски Табло</h2>
|
||
<div class="quick-actions">
|
||
<a href="{% url 'osint:seed_create' %}" class="btn btn-primary">➕ Добави Seed Website</a>
|
||
<a href="{% url 'osint:keyword_create' %}" class="btn btn-primary">➕ Добави Ключова Дума</a>
|
||
<a href="{% url 'osint:start_crawling' %}" class="btn btn-success">🚀 Стартирай Crawling</a>
|
||
<a href="{% url 'osint:auto_report_list' %}" class="btn btn-secondary">📋 Преглед на Доклади</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Statistics Overview -->
|
||
<div class="dashboard-grid">
|
||
<div class="dashboard-card">
|
||
<h3>📊 Seed Websites</h3>
|
||
<div class="stat-number">{{ total_seeds }}</div>
|
||
<p>Общо: {{ total_seeds }} | Активни: {{ active_seeds }}</p>
|
||
<a href="{% url 'osint:seed_create' %}" class="btn btn-sm btn-primary" style="margin-top: 1rem;">Управление</a>
|
||
</div>
|
||
|
||
<div class="dashboard-card">
|
||
<h3>🔍 Ключови Думи</h3>
|
||
<div class="stat-number">{{ total_keywords }}</div>
|
||
<p>Общо: {{ total_keywords }} | Активни: {{ active_keywords }}</p>
|
||
<a href="{% url 'osint:keyword_create' %}" class="btn btn-sm btn-primary" style="margin-top: 1rem;">Управление</a>
|
||
</div>
|
||
|
||
<div class="dashboard-card">
|
||
<h3>📄 Събрано Съдържание</h3>
|
||
<div class="stat-number">{{ total_crawled }}</div>
|
||
<p>Общо: {{ total_crawled }} | Потенциални измами: {{ potential_scams }}</p>
|
||
</div>
|
||
|
||
<div class="dashboard-card">
|
||
<h3>📋 Автоматични Доклади</h3>
|
||
<div class="stat-number">{{ pending_reports }}</div>
|
||
<p>Чакащи: {{ pending_reports }} | Публикувани: {{ published_reports }}</p>
|
||
<a href="{% url 'osint:auto_report_list' %}" class="btn btn-sm btn-primary" style="margin-top: 1rem;">Преглед</a>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Seed Websites Management -->
|
||
<div class="gov-card">
|
||
<div class="gov-card-header" style="display: flex; justify-content: space-between; align-items: center;">
|
||
<h2>🌐 Seed Websites</h2>
|
||
<a href="{% url 'osint:seed_create' %}" class="btn btn-primary">➕ Добави Нов</a>
|
||
</div>
|
||
<div class="gov-card-body">
|
||
{% if seed_websites %}
|
||
<div class="table-responsive">
|
||
<table class="gov-table">
|
||
<thead>
|
||
<tr>
|
||
<th>Име</th>
|
||
<th>URL</th>
|
||
<th>Статус</th>
|
||
<th>Приоритет</th>
|
||
<th>Последно Crawl</th>
|
||
<th>Страници</th>
|
||
<th>Съвпадения</th>
|
||
<th>Действия</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for seed in seed_websites %}
|
||
<tr>
|
||
<td><strong>{{ seed.name }}</strong></td>
|
||
<td><a href="{{ seed.url }}" target="_blank">{{ seed.url|truncatechars:40 }}</a></td>
|
||
<td>
|
||
{% if seed.is_active %}
|
||
<span class="status-badge status-active">Активен</span>
|
||
{% else %}
|
||
<span class="status-badge status-inactive">Неактивен</span>
|
||
{% endif %}
|
||
</td>
|
||
<td>{{ seed.get_priority_display }}</td>
|
||
<td>
|
||
{% if seed.last_crawled_at %}
|
||
{{ seed.last_crawled_at|date:"d.m.Y H:i" }}
|
||
{% else %}
|
||
<span style="color: orange;">Никога</span>
|
||
{% endif %}
|
||
</td>
|
||
<td>{{ seed.pages_crawled }}</td>
|
||
<td>{{ seed.matches_found }}</td>
|
||
<td>
|
||
<a href="{% url 'osint:seed_edit' seed.pk %}" class="btn btn-sm btn-secondary">✏️ Редактирай</a>
|
||
<a href="{% url 'osint:seed_delete' seed.pk %}" class="btn btn-sm btn-danger"
|
||
onclick="return confirm('Сигурни ли сте?')">🗑️ Изтрий</a>
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
{% else %}
|
||
<div class="empty-state">
|
||
<p>Няма конфигурирани seed websites. <a href="{% url 'osint:seed_create' %}">Добавете първия</a></p>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Keywords Management -->
|
||
<div class="gov-card">
|
||
<div class="gov-card-header" style="display: flex; justify-content: space-between; align-items: center;">
|
||
<h2>🔑 Ключови Думи</h2>
|
||
<a href="{% url 'osint:keyword_create' %}" class="btn btn-primary">➕ Добави Нова</a>
|
||
</div>
|
||
<div class="gov-card-body">
|
||
{% if keywords %}
|
||
<div class="table-responsive">
|
||
<table class="gov-table">
|
||
<thead>
|
||
<tr>
|
||
<th>Име</th>
|
||
<th>Ключова Дума</th>
|
||
<th>Тип</th>
|
||
<th>Статус</th>
|
||
<th>Увереност</th>
|
||
<th>Auto Approve</th>
|
||
<th>Действия</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for keyword in keywords %}
|
||
<tr>
|
||
<td><strong>{{ keyword.name }}</strong></td>
|
||
<td><code style="font-size: 0.85rem;">{{ keyword.keyword|truncatechars:50 }}</code></td>
|
||
<td>{{ keyword.get_keyword_type_display }}</td>
|
||
<td>
|
||
{% if keyword.is_active %}
|
||
<span class="status-badge status-active">Активна</span>
|
||
{% else %}
|
||
<span class="status-badge status-inactive">Неактивна</span>
|
||
{% endif %}
|
||
</td>
|
||
<td>{{ keyword.confidence_score }}%</td>
|
||
<td>
|
||
{% if keyword.auto_approve %}
|
||
<span class="status-badge status-active">Да</span>
|
||
{% else %}
|
||
<span class="status-badge status-inactive">Не</span>
|
||
{% endif %}
|
||
</td>
|
||
<td>
|
||
<a href="{% url 'osint:keyword_edit' keyword.pk %}" class="btn btn-sm btn-secondary">✏️ Редактирай</a>
|
||
<a href="{% url 'osint:keyword_delete' keyword.pk %}" class="btn btn-sm btn-danger"
|
||
onclick="return confirm('Сигурни ли сте?')">🗑️ Изтрий</a>
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
{% else %}
|
||
<div class="empty-state">
|
||
<p>Няма конфигурирани ключови думи. <a href="{% url 'osint:keyword_create' %}">Добавете първата</a></p>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Recent Activity -->
|
||
<div class="gov-card">
|
||
<div class="gov-card-header">
|
||
<h2>📊 Последна Активност</h2>
|
||
</div>
|
||
<div class="gov-card-body">
|
||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;">
|
||
<div>
|
||
<h3>Последно Събрано Съдържание</h3>
|
||
{% if recent_crawled %}
|
||
<ul style="list-style: none; padding: 0;">
|
||
{% for content in recent_crawled %}
|
||
<li style="padding: 0.5rem; border-bottom: 1px solid var(--gov-gray-light);">
|
||
<strong><a href="{{ content.url }}" target="_blank">{{ content.title|truncatechars:50 }}</a></strong><br>
|
||
<small>{{ content.crawled_at|date:"d.m.Y H:i" }} | {{ content.match_count }} съвпадения</small>
|
||
</li>
|
||
{% endfor %}
|
||
</ul>
|
||
{% else %}
|
||
<p>Все още няма събрано съдържание.</p>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<div>
|
||
<h3>Последни Автоматични Доклади</h3>
|
||
{% if recent_auto_reports %}
|
||
<ul style="list-style: none; padding: 0;">
|
||
{% for report in recent_auto_reports %}
|
||
<li style="padding: 0.5rem; border-bottom: 1px solid var(--gov-gray-light);">
|
||
<strong><a href="{% url 'osint:auto_report_detail' report.pk %}">{{ report.title|truncatechars:50 }}</a></strong><br>
|
||
<small>
|
||
{{ report.created_at|date:"d.m.Y H:i" }} |
|
||
<span class="badge badge-{{ report.status }}">{{ report.get_status_display }}</span> |
|
||
{{ report.confidence_score }}%
|
||
</small>
|
||
</li>
|
||
{% endfor %}
|
||
</ul>
|
||
{% else %}
|
||
<p>Все още няма автоматично генерирани доклади.</p>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Due for Crawling -->
|
||
{% if due_for_crawling %}
|
||
<div class="gov-card">
|
||
<div class="gov-card-header">
|
||
<h2>⏰ Seed Websites за Crawling</h2>
|
||
</div>
|
||
<div class="gov-card-body">
|
||
<div class="gov-alert gov-alert-warning">
|
||
<div class="alert-icon">⚠</div>
|
||
<div class="alert-content">
|
||
<strong>Следните seed websites са готови за crawling:</strong>
|
||
<ul style="margin-top: 0.5rem;">
|
||
{% for seed in due_for_crawling %}
|
||
<li><strong>{{ seed.name }}</strong> - {{ seed.url }}</li>
|
||
{% endfor %}
|
||
</ul>
|
||
<a href="{% url 'osint:start_crawling' %}" class="btn btn-primary" style="margin-top: 1rem;">Стартирай Crawling</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% endblock %}
|
||
|