mirror of
https://github.com/Significant-Gravitas/AutoModerate.git
synced 2026-11-09 17:54:01 -10:00
Updated ai_moderator.py to process content chunks in parallel using ThreadPoolExecutor for improved performance. Modified base.html to display the real-time connection indicator only for authenticated users.
233 lines
11 KiB
HTML
233 lines
11 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
|
<meta http-equiv="Pragma" content="no-cache">
|
|
<meta http-equiv="Expires" content="0">
|
|
<title>{% block title %}AutoModerate{% endblock %}</title>
|
|
|
|
<!-- Prevent dark mode flash by applying theme immediately -->
|
|
<script>
|
|
(function() {
|
|
const savedTheme = localStorage.getItem('theme') || 'light';
|
|
document.documentElement.setAttribute('data-bs-theme', savedTheme);
|
|
})();
|
|
</script>
|
|
|
|
<!-- Bootstrap CSS -->
|
|
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
|
|
rel="stylesheet"
|
|
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
|
|
crossorigin="anonymous">
|
|
<!-- Font Awesome -->
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
|
|
rel="stylesheet"
|
|
integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg=="
|
|
crossorigin="anonymous"
|
|
referrerpolicy="no-referrer">
|
|
<!-- Socket.IO -->
|
|
<script src="https://cdn.socket.io/4.5.0/socket.io.min.js"
|
|
integrity="sha384-7EyYLQZgWBi67fBtVxw60/OWl1kjsfrPFcaU0pp0nAh+i8FD068QogUvg85Ewy1k"
|
|
crossorigin="anonymous"></script>
|
|
<!-- Modular CSS Files -->
|
|
<link href="{{ url_for('static', filename='css/core/layout.css') }}" rel="stylesheet">
|
|
<link href="{{ url_for('static', filename='css/core/dark-mode.css') }}" rel="stylesheet">
|
|
<link href="{{ url_for('static', filename='css/components/tables.css') }}" rel="stylesheet">
|
|
<link href="{{ url_for('static', filename='css/components/forms.css') }}" rel="stylesheet">
|
|
<link href="{{ url_for('static', filename='css/components/modals.css') }}" rel="stylesheet">
|
|
<link href="{{ url_for('static', filename='css/utilities/responsive.css') }}" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
<!-- Real-time connection indicator (only for authenticated users) -->
|
|
{% if current_user.is_authenticated %}
|
|
<div id="connection-status" class="real-time-indicator">
|
|
<span class="badge bg-secondary" style="font-size: 0.75rem; padding: 0.25rem 0.5rem;">
|
|
<i class="fas fa-circle"></i> <span class="connection-text">Connecting...</span>
|
|
</span>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Toast Notification Container -->
|
|
<div aria-live="polite" aria-atomic="true" class="position-fixed top-0 end-0 p-3" style="z-index: 1080; min-width: 300px;">
|
|
<div id="mainToast" class="toast align-items-center text-white bg-success border-0" role="alert" aria-live="assertive" aria-atomic="true">
|
|
<div class="d-flex">
|
|
<div class="toast-body" id="mainToastBody">
|
|
<!-- Toast message will be injected here -->
|
|
</div>
|
|
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Mobile sidebar overlay -->
|
|
<div id="sidebar-overlay" class="sidebar-overlay"></div>
|
|
|
|
<!-- Mobile-only sidebar (independent of Bootstrap grid) -->
|
|
{% if current_user.is_authenticated %}
|
|
<nav id="mobile-sidebar" class="mobile-sidebar d-md-none">
|
|
<div class="position-sticky pt-3">
|
|
<div class="text-center mb-4">
|
|
<h4 class="text-primary">AutoModerate</h4>
|
|
<small class="text-muted">Welcome, {{ current_user.username }}</small>
|
|
<div class="mt-2">
|
|
<button id="dark-mode-toggle-mobile" class="btn btn-outline-secondary btn-sm" title="Toggle dark mode">
|
|
<i class="fas fa-moon"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<ul class="nav flex-column">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('dashboard.index') }}">
|
|
<i class="fas fa-tachometer-alt"></i> Dashboard
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('dashboard.projects') }}">
|
|
<i class="fas fa-project-diagram"></i> Projects
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('api.api_docs') }}">
|
|
<i class="fas fa-book"></i> API Docs
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('manual_review.api_users') }}">
|
|
<i class="fas fa-users"></i> API Users
|
|
</a>
|
|
</li>
|
|
{% if current_user.is_admin %}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('admin.index') }}">
|
|
<i class="fas fa-shield-alt"></i> Admin
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('admin.analytics') }}">
|
|
<i class="fas fa-chart-line"></i> Analytics
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('auth.profile') }}">
|
|
<i class="fas fa-user"></i> Profile
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('auth.logout') }}">
|
|
<i class="fas fa-sign-out-alt"></i> Logout
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
{% endif %}
|
|
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
{% if current_user.is_authenticated %}
|
|
<!-- Desktop Sidebar -->
|
|
<nav id="sidebar" class="col-md-3 col-lg-2 d-none d-md-block sidebar">
|
|
<div class="position-sticky pt-3">
|
|
<div class="text-center mb-4">
|
|
<h4 class="text-primary">AutoModerate</h4>
|
|
<small class="text-muted">Welcome, {{ current_user.username }}</small>
|
|
<div class="mt-2">
|
|
<button id="dark-mode-toggle" class="btn btn-outline-secondary btn-sm" title="Toggle dark mode">
|
|
<i class="fas fa-moon"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<ul class="nav flex-column">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('dashboard.index') }}">
|
|
<i class="fas fa-tachometer-alt"></i> Dashboard
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('dashboard.projects') }}">
|
|
<i class="fas fa-project-diagram"></i> Projects
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('api.api_docs') }}">
|
|
<i class="fas fa-book"></i> API Docs
|
|
</a>
|
|
</li>
|
|
{% if current_user.is_admin %}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('admin.index') }}">
|
|
<i class="fas fa-shield-alt"></i> Admin
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('auth.profile') }}">
|
|
<i class="fas fa-user"></i> Profile
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('auth.logout') }}">
|
|
<i class="fas fa-sign-out-alt"></i> Logout
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Main content -->
|
|
<main id="main-content" class="col-md-9 ms-sm-auto col-lg-10 px-md-4 content-area">
|
|
{% else %}
|
|
<main id="main-content" class="col-12 content-area">
|
|
{% endif %}
|
|
<!-- Flash messages -->
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
<div class="mt-3">
|
|
{% for category, message in messages %}
|
|
<div class="alert alert-{{ 'danger' if category == 'error' else category }} alert-dismissible fade show" role="alert">
|
|
{{ message }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% endwith %}
|
|
|
|
{% block page_header %}
|
|
<!-- Default page header with sidebar toggle -->
|
|
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
|
<div class="d-flex align-items-center">
|
|
{% if current_user.is_authenticated %}
|
|
<button id="sidebar-toggle" class="btn btn-outline-secondary btn-sm me-3" title="Toggle sidebar">
|
|
<i class="fas fa-chevron-left"></i>
|
|
</button>
|
|
{% endif %}
|
|
<h1 class="h2 mb-0">{% block page_title %}Dashboard{% endblock %}</h1>
|
|
</div>
|
|
<div class="btn-toolbar mb-2 mb-md-0">
|
|
{% block page_actions %}{% endblock %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Bootstrap JS -->
|
|
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
|
|
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
|
|
crossorigin="anonymous"></script>
|
|
<!-- Base JS -->
|
|
<script src="{{ url_for('static', filename='js/base.js') }}"></script>
|
|
|
|
{% block scripts %}{% endblock %}
|
|
</body>
|
|
</html>
|