adding statistics page for admin
This commit is contained in:
46
web/templates/admin/stats.html
Normal file
46
web/templates/admin/stats.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{% extends 'base.html' %} {% block content %}
|
||||
<div id="admin-stats">
|
||||
<h2>Database Statistics</h2>
|
||||
<div class="stats-summary">
|
||||
<p><strong>Total jobs:</strong> {{ stats.total_jobs }}</p>
|
||||
<p><strong>Total keywords:</strong> {{ stats.total_keywords }}</p>
|
||||
<p><strong>Total regions:</strong> {{ stats.total_regions }}</p>
|
||||
</div>
|
||||
|
||||
<h3>Jobs per keyword</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Keyword</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in stats.jobs_per_keyword %}
|
||||
<tr>
|
||||
<td>{{ row.keyword or '(empty)' }}</td>
|
||||
<td>{{ row.count }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Jobs per region</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Region</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in stats.jobs_per_region %}
|
||||
<tr>
|
||||
<td>{{ row.region or '(empty)' }}</td>
|
||||
<td>{{ row.count }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -22,6 +22,7 @@
|
||||
{% if current_user and current_user.is_admin %} |
|
||||
<a href="{{ url_for('scrape_page') }}">Scrape Jobs</a> |
|
||||
<a href="{{ url_for('admin_taxonomy') }}">Taxonomy</a> |
|
||||
<a href="{{ url_for('admin_stats') }}">Statistics</a> |
|
||||
<a href="{{ url_for('admin_users') }}">Users</a> {% endif %} {% if
|
||||
session.get('username') %} |
|
||||
<a href="{{ url_for('logout') }}">Logout</a> {% else %} |
|
||||
|
||||
Reference in New Issue
Block a user