feat: Develop web interface

- Implemented the initial version of the web interface.
refactor: Begin Telegram bot refactoring
- Started restructuring the bot’s code for better maintainability.
chore: Migrate to Flask project structure
- Reorganized the application to follow Flask's project structure.
cleanup: Extensive code cleanup
- Removed redundant code and improved readability.

Signed-off-by: UdoChudo <stream@udochudo.ru>
This commit is contained in:
2025-06-10 14:39:11 +05:00
parent acf4436fc4
commit 52e31864b3
2200 changed files with 3205 additions and 2638 deletions
+67
View File
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}Dashboard{% endblock %}</title>
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/toastr.min.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/bootstrap-icons-1.11.3/font/bootstrap-icons.css') }}" rel="stylesheet">
<link href="{{ url_for('static', filename='css/styles.css') }}" rel="stylesheet">
{# Блок для подключения дополнительных стилей на страницах #}
{% block styles %}{% endblock %}
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand">Dashboard</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
{% if request.endpoint != 'auth.login' %}
<li class="nav-item">
<a class="nav-link {% if request.endpoint == 'dashboard.dashboard' %}active{% endif %}" href="{{ url_for('dashboard.dashboard') }}">Главная</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint == 'dashboard.users_page' %}active{% endif %}" href="{{ url_for('dashboard.users_page') }}">Пользователи</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint == 'dashboard.regions_page' %}active{% endif %}" href="{{ url_for('dashboard.regions_page') }}">Регионы и системы</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.endpoint == 'dashboard.logs_page' %}active{% endif %}" href="{{ url_for('dashboard.logs_page') }}">Логи</a>
</li>
{% endif %}
</ul>
</div>
{% if request.endpoint != 'auth.login' %}
<div class="d-flex justify-content-end">
<span class="navbar-text me-3">
{% if session['display_name'] %}
{{ session['display_name'] }}
{% else %}
Пользователь
{% endif %}
</span>
<a class="btn btn-outline-danger" href="{{ url_for('auth.logout') }}">Выход</a>
</div>
{% endif %}
</div>
</nav>
<div class="container mt-4">
{% block content %}{% endblock %}
</div>
{% block scripts %}
<script src="{{ url_for('static', filename='js/jquery-3.6.0.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/toastr.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/utils.js') }}"></script>
{% endblock %}
</body>
</html>
+44
View File
@@ -0,0 +1,44 @@
{% extends "base.html" %}
{% block title %}Dashboard Home{% endblock %}
{% block content %}
<h1 class="text-center mb-4 dashboard-title">Добро пожаловать в Dashboard</h1>
<p class="text-center">Выберите один из разделов:</p>
<div class="row">
<!-- Карточка пользователей -->
<div class="col-md-4">
<div class="card shadow-sm">
<div class="card-body text-center">
<h5 class="card-title">Пользователи</h5>
<p class="card-text">Управление пользователями.</p>
<a href="{{ url_for('dashboard.users_page') }}" class="btn btn-primary">Перейти</a>
</div>
</div>
</div>
<!-- Карточка регионов -->
<div class="col-md-4">
<div class="card shadow-sm">
<div class="card-body text-center">
<h5 class="card-title">Регионы и системы</h5>
<p class="card-text">Управление регионами и системами.</p>
<a href="{{ url_for('dashboard.regions_page') }}" class="btn btn-primary">Перейти</a>
</div>
</div>
</div>
<!-- Карточка логов -->
<div class="col-md-4">
<div class="card shadow-sm">
<div class="card-body text-center">
<h5 class="card-title">Логи</h5>
<p class="card-text">Просмотр событий пользователей и логов.</p>
<a href="{{ url_for('dashboard.logs_page') }}" class="btn btn-primary">Перейти</a>
</div>
</div>
</div>
</div>
{% endblock %}
+104
View File
@@ -0,0 +1,104 @@
{% extends "base.html" %}
{% block content %}
<style>
html {
background-color: #56baed;
}
body {
font-family: "Poppins", sans-serif;
height: 100vh;
}
.wrapper {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
width: 100%;
min-height: 100%;
padding: 20px;
}
#formContent {
border-radius: 10px;
background: #fff;
padding: 30px;
width: 90%;
max-width: 450px;
box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3);
text-align: center;
}
#formFooter {
background-color: #f6f6f6;
border-top: 1px solid #dce8f1;
padding: 25px;
border-radius: 0 0 10px 10px;
}
input[type=text], input[type=password] {
background-color: #f6f6f6;
border: none;
color: #0d0d0d;
padding: 15px;
font-size: 16px;
margin: 10px;
width: 95%;
border-radius: 5px;
}
input[type=submit] {
background-color: #56baed;
border: none;
color: white;
padding: 15px;
text-transform: uppercase;
font-size: 13px;
box-shadow: 0 10px 30px 0 rgba(95,186,233,0.4);
border-radius: 5px;
transition: all 0.3s ease-in-out;
}
input[type=submit]:hover {
background-color: #39ace7;
}
.fadeIn {
animation: fadeIn ease-in 1s;
animation-fill-mode: forwards;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
#icon {
width: 60%;
}
</style>
<div class="wrapper fadeInDown">
<div id="formContent">
<!-- Форма входа -->
<form method="POST" action="{{ url_for('auth.login') }}">
<input type="text" id="username" class="fadeIn second form-control text-center" name="username" placeholder="Имя пользователя" required>
<input type="password" id="password" class="fadeIn third form-control text-center" name="password" placeholder="Пароль" required>
<input type="submit" class="fadeIn fourth btn btn-primary w-100 mt-3" value="Войти">
</form>
<!-- Flash-сообщения -->
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="mt-3 alert alert-{{ category }} alert-dismissible fade show w-100" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
</div>
</div>
{% endblock %}
+131
View File
@@ -0,0 +1,131 @@
{% extends "base.html" %}
{% block title %}Логи{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/logs.css') }}">
{% endblock %}
{% block content %}
<div class="container mt-4">
<h2 class="mb-4">Журнал действий</h2>
<!-- Форма фильтрации -->
<form method="get" class="mb-4">
<div class="row g-3">
<div class="col-md">
<label for="action" class="form-label">Тип действия</label>
<input type="text" class="form-control" id="action" name="action"
value="{{ filters.action or '' }}">
</div>
<div class="col-md">
<label for="username" class="form-label">Пользователь</label>
<input type="text" class="form-control" id="username" name="username"
value="{{ filters.username or '' }}">
</div>
<div class="col-md">
<label for="timestamp_from" class="form-label">Дата с</label>
<input type="date" class="form-control" id="timestamp_from" name="timestamp_from"
value="{{ filters.timestamp_from or '' }}">
</div>
<div class="col-md">
<label for="timestamp_to" class="form-label">Дата по</label>
<input type="date" class="form-control" id="timestamp_to" name="timestamp_to"
value="{{ filters.timestamp_to or '' }}">
</div>
<div class="col-md-auto align-self-end">
<button type="submit" class="btn btn-primary">Фильтровать</button>
</div>
</div>
</form>
<!-- Таблица логов -->
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead class="table-light">
<tr>
<th>
{% set new_order = 'asc' if filters.order != 'asc' else 'desc' %}
<a href="{{ url_for('dashboard.logs_page', page=1, order=new_order,
action=filters.action, username=filters.username,
timestamp_from=filters.timestamp_from, timestamp_to=filters.timestamp_to) }}">
Дата и время
{% if filters.order == 'asc' %}
▲
{% elif filters.order == 'desc' %}
▼
{% endif %}
</a>
</th>
<th>Пользователь</th>
<th>Тип действия</th>
<th>Описание</th>
<th>IP-адрес</th>
</tr>
</thead>
<tbody>
{% for log in logs.items %}
<tr>
<td>{{ log.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</td>
<td>{{ log.username }}</td>
<td>{{ log.action }}</td>
<td>{{ log.details }}</td>
<td>{{ log.ipaddress }}</td>
</tr>
{% else %}
<tr>
<td colspan="5" class="text-center">Нет записей</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- Пагинация -->
<nav>
<ul class="pagination justify-content-center">
{% if logs.has_prev %}
<li class="page-item">
<a class="page-link"
href="{{ url_for('dashboard.logs_page', page=logs.prev_num, order=filters.order,
action=filters.action, username=filters.username,
timestamp_from=filters.timestamp_from, timestamp_to=filters.timestamp_to) }}">
Назад
</a>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">Назад</span></li>
{% endif %}
{% for page_num in logs.iter_pages(left_edge=1, right_edge=1, left_current=2, right_current=2) %}
{% if page_num %}
{% if page_num == logs.page %}
<li class="page-item active"><span class="page-link">{{ page_num }}</span></li>
{% else %}
<li class="page-item">
<a class="page-link"
href="{{ url_for('dashboard.logs_page', page=page_num, order=filters.order,
action=filters.action, username=filters.username,
timestamp_from=filters.timestamp_from, timestamp_to=filters.timestamp_to) }}">
{{ page_num }}
</a>
</li>
{% endif %}
{% else %}
<li class="page-item disabled"><span class="page-link">…</span></li>
{% endif %}
{% endfor %}
{% if logs.has_next %}
<li class="page-item">
<a class="page-link"
href="{{ url_for('dashboard.logs_page', page=logs.next_num, order=filters.order,
action=filters.action, username=filters.username,
timestamp_from=filters.timestamp_from, timestamp_to=filters.timestamp_to) }}">
Вперёд
</a>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">Вперёд</span></li>
{% endif %}
</ul>
</nav>
</div>
{% endblock %}
+272
View File
@@ -0,0 +1,272 @@
{% extends "base.html" %}
{% block title %}Регионы и системы{% endblock %}
{% block content %}
<div class="container">
<h2 class="mb-4">Регионы и системы</h2>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="regions-tab" data-bs-toggle="tab" data-bs-target="#regions" type="button" role="tab" aria-controls="regions" aria-selected="true">Регионы</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="systems-tab" data-bs-toggle="tab" data-bs-target="#systems" type="button" role="tab" aria-controls="systems" aria-selected="false">Системы</button>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="regions" role="tabpanel" aria-labelledby="regions-tab">
<div class="mt-4">
<button type="button" class="btn btn-primary mb-3" data-bs-toggle="modal" data-bs-target="#addRegionModal">
<i class="bi bi-plus-circle"></i> Добавить регион
</button>
<div class="modal fade" id="addRegionModal" tabindex="-1" aria-labelledby="addRegionModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addRegionModalLabel">Добавить регион</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="add-region-form">
<div class="mb-3">
<label for="region-id" class="form-label">ID региона</label>
<input type="text" class="form-control" id="region-id" required>
</div>
<div class="mb-3">
<label for="region-name" class="form-label">Название региона</label>
<input type="text" class="form-control" id="region-name" required>
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="region-active" checked>
<label class="form-check-label" for="region-active">Активен</label>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
<button type="submit" form="add-region-form" class="btn btn-primary">Добавить</button>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th style="width: 10%; cursor: pointer;" data-sort="region_id">ID</th>
<th style="width: 50%; cursor: pointer;" data-sort="name">Название</th>
<th style="width: 20%; cursor: pointer;" data-sort="active">Статус</th>
<th style="width: 20%;">Действия</th>
</tr>
</thead>
<tbody id="regions-table">
</tbody>
</table>
</div>
<nav aria-label="Regions navigation">
<ul class="pagination justify-content-center" id="pagination-regions">
</ul>
</nav>
</div>
</div>
<div class="tab-pane fade" id="systems" role="tabpanel" aria-labelledby="systems-tab">
<div class="mt-4">
<button type="button" class="btn btn-primary mb-3" data-bs-toggle="modal" data-bs-target="#addSystemModal">
<i class="bi bi-plus-circle"></i> Добавить систему
</button>
<div class="modal fade" id="addSystemModal" tabindex="-1" aria-labelledby="addSystemModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addSystemModalLabel">Добавить систему</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="add-system-form">
<div class="mb-3">
<label for="system-id" class="form-label">ID системы</label>
<input type="text" class="form-control" id="system-id" required>
</div>
<div class="mb-3">
<label for="system-name-lat" class="form-label">Название системы (латиница)</label>
<input type="text" class="form-control" id="system-name-lat" required>
</div>
<div class="mb-3">
<label for="system-name-cyr" class="form-label">Название системы (кириллица)</label>
<input type="text" class="form-control" id="system-name-cyr" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
<button type="submit" form="add-system-form" class="btn btn-primary">Добавить</button>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th style="width: 10%; cursor: pointer;" data-sort="system_id">ID</th>
<th style="width: 25%; cursor: pointer;" data-sort="system_name">Название (латиница)</th>
<th style="width: 25%; cursor: pointer;" data-sort="name">Название (кириллица)</th>
<th style="width: 20%;">Действия</th>
</tr>
</thead>
<tbody id="systems-table">
</tbody>
</table>
</div>
<nav aria-label="Systems navigation">
<ul class="pagination justify-content-center" id="pagination-systems">
</ul>
</nav>
</div>
</div>
</div>
</div>
{# Модальное окно для редактирования региона#}
<div class="modal fade" id="editRegionNameModal" tabindex="-1" aria-labelledby="editRegionNameModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editRegionNameModalLabel">Изменить название региона</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="edit-region-name-form">
<div class="mb-3">
<label for="old-region-name" class="form-label">Прошлое название</label>
<input type="text" class="form-control" id="old-region-name" readonly>
</div>
<div class="mb-3">
<label for="new-region-name" class="form-label">Новое название</label>
<input type="text" class="form-control" id="new-region-name" required>
</div>
</form>
</div>
<div class="modal-footer">
<span id="edit-region-name-timer" class="me-2">5</span>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
<button type="submit" form="edit-region-name-form" class="btn btn-primary" id="save-region-name-btn" disabled>Сохранить изменения</button>
</div>
</div>
</div>
</div>
{# Модальное окно для удаления региона#}
<div class="modal fade" id="deleteRegionModal" tabindex="-1" aria-labelledby="deleteRegionModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteRegionModalLabel">Подтверждение удаления</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
</div>
<div class="modal-body">
<p>Для подтверждения удаления введите слово "УДАЛИТЬ" большими буквами:</p>
<input type="text" id="deleteConfirmationInput" class="form-control">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
<button type="button" class="btn btn-danger" id="confirmDeleteButton" disabled>Удалить</button>
</div>
</div>
</div>
</div>
{# Модальное окно для отображения подписчиков региона #}
<div class="modal fade" id="regionSubscribersModal" tabindex="-1" aria-labelledby="regionSubscribersModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="regionSubscribersModalLabel">Подписчики региона</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
</div>
<div class="modal-body">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Telegram ID</th>
<th>Email</th>
</tr>
</thead>
<tbody id="regionSubscribersTableBody">
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
</div>
</div>
</div>
</div>
{# Модальное окно для редактирования имени системы#}
<div class="modal fade" id="editSystemNameModal" tabindex="-1" aria-labelledby="editSystemNameModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editSystemNameModalLabel">Редактировать систему</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
</div>
<div class="modal-body">
<!-- Здесь поля формы -->
<input type="hidden" id="edit-system-id" /> <!-- ID системы, скрытое -->
<div class="mb-3">
<label for="edit-system-name-lat" class="form-label">Латинское имя</label>
<input type="text" class="form-control" id="edit-system-name-lat" readonly />
</div>
<div class="mb-3">
<label for="old-system-name" class="form-label">Текущее имя</label>
<input type="text" class="form-control" id="old-system-name" readonly />
</div>
<div class="mb-3">
<label for="new-system-name" class="form-label">Новое имя</label>
<input type="text" class="form-control" id="new-system-name" />
</div>
<div>
Осталось времени: <span id="edit-system-name-timer">5</span> сек.
</div>
</div>
<div class="modal-footer">
<button id="saveSystemNameBtn" class="btn btn-primary" disabled>Сохранить</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
</div>
</div>
</div>
</div>
{# Модальное окно для удаления системы #}
<div class="modal fade" id="deleteSystemModal" tabindex="-1" aria-labelledby="deleteSystemModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteSystemModalLabel">Подтверждение удаления</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
</div>
<div class="modal-body">
<p>Для подтверждения удаления введите слово "УДАЛИТЬ" большими буквами:</p>
<input type="text" id="deleteSystemConfirmationInput" class="form-control">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
<button type="button" class="btn btn-danger" id="confirmDeleteSystemButton" disabled>Удалить</button>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{ url_for('static', filename='js/regions.js') }}"></script>
{% endblock %}
+183
View File
@@ -0,0 +1,183 @@
{% extends 'base.html' %}
{% block content %}
<head>
<title>Пользователи</title>
</head>
<div class="container">
<h1>Пользователи</h1>
<button class="btn btn-success mb-3" data-bs-toggle="modal" data-bs-target="#addUserModal">Добавить пользователя</button>
<button class="btn btn-primary mb-3" data-bs-toggle="modal" data-bs-target="#searchUsersModal">Поиск</button>
<div class="table-responsive">
<table class="table table-bordered table-striped" id="users-table">
<thead>
<tr>
<th style="width: 8%;">Chat ID</th>
<th style="width: 15%;">Telegram ID</th>
<th style="width: 20%;">Email</th>
<th style="width: 20%;">Подписки</th>
<th style="width: 15%;">Тип уведомлений</th>
<th style="width: 10%;">Статус</th>
<th style="width: 12%;">Действия</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<nav>
<ul class="pagination" id="pagination">
</ul>
</nav>
{# Модальное окно карточки пользователя #}
<div id="userModal" class="modal fade" tabindex="-1" aria-labelledby="userModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="userModalLabel">Редактирование пользователя</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Chat ID: <span id="userId"></span></p>
<p>Telegram ID: <span id="telegram_id"></span></p>
<p>Email: <span id="userEmail"></span></p>
<div class="mt-3">
<h6>События пользователя:</h6>
<div class="overflow-auto" style="max-height: 300px;">
<table class="table table-bordered table-striped" id="userEventsTable">
<thead>
<tr>
<th class="text-nowrap">Действие</th>
<th class="text-nowrap">Время</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">
<button id="toggleBlockUser" class="btn btn-warning">Заблокировать</button>
<button id="deleteUser" class="btn btn-danger">Удалить</button>
</div>
</div>
</div>
</div>
<div id="addUserModal" class="modal fade" tabindex="-1" aria-labelledby="addUserModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addUserModalLabel">Добавить пользователя</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="newUserId" class="form-label">Chat ID</label>
<input type="number" class="form-control" id="newUserId" min="1" maxlength="32" title="Введите числовое значение (максимум 32 символа)">
</div>
<div class="mb-3">
<label for="newUsername" class="form-label">Telegram ID</label>
<input type="text" class="form-control" id="newUsername" pattern="@.*" title="Начните с символа @">
</div>
<div class="mb-3">
<label for="newUserEmail" class="form-label">Email</label>
<input type="email" class="form-control" id="newUserEmail" pattern=".*@rtmis\.ru$" title="Должен содержать домен @rtmis.ru">
</div>
</div>
<div class="modal-footer">
<button id="addNewUser" class="btn btn-success">Добавить</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="userEventsModal" tabindex="-1" role="dialog" aria-labelledby="userEventsModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="userEventsModalLabel">Действия пользователя</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="userEventsModalBody" style="max-height: 400px; overflow-y: auto;">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Закрыть</button>
</div>
</div>
</div>
</div>
{# Модальное окно для удаления пользователя #}
<div class="modal fade" id="deleteConfirmationModal" tabindex="-1" aria-labelledby="deleteConfirmationModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteConfirmationModalLabel">Подтверждение удаления</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Для подтверждения удаления пользователя введите слово "УДАЛИТЬ" в поле ниже:</p>
<label for="confirmationText"></label><input type="text" id="confirmationText" class="form-control" placeholder="УДАЛИТЬ">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
<button type="button" class="btn btn-danger" id="confirmDeleteButton">Удалить</button>
</div>
</div>
</div>
</div>
{# Модальное окно поиска#}
<div class="modal fade" id="searchUsersModal" tabindex="-1" aria-labelledby="searchUsersModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="searchUsersModalLabel">Поиск пользователей</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="searchTelegramId" class="form-label">Telegram ID</label>
<input type="text" class="form-control" id="searchTelegramId">
</div>
<div class="mb-3">
<label for="searchEmail" class="form-label">Email</label>
<input type="email" class="form-control" id="searchEmail">
</div>
{# Поле ФИО будет добавлено позже #}
<div id="searchResults" style="display: none;">
<h3>Результаты поиска:</h3>
<table class="table table-bordered table-striped" id="searchResultsTableModal">
<thead>
<tr>
<th style="width: 8%;">Chat ID</th>
<th style="width: 15%;">Telegram ID</th>
<th style="width: 20%;">Email</th>
<th style="width: 12%;">Действия</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button id="searchUsersButton" class="btn btn-primary">Поиск</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{ url_for('static', filename='js/users.js') }}"></script>
{% endblock %}