v2.3
This commit is contained in:
@@ -0,0 +1,651 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="vi">
|
||||
|
||||
<head>
|
||||
<script>
|
||||
var savedTheme = localStorage.getItem('audit_theme');
|
||||
if (savedTheme === 'dark' || (!savedTheme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
||||
document.documentElement.setAttribute('data-theme', 'dark');
|
||||
} else {
|
||||
document.documentElement.setAttribute('data-theme', 'light');
|
||||
}
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" type="image/png" href="{{ url_for('icon', path='/icon.png') }}">
|
||||
<title>Quản lý Công cụ - Admin - VNPT-MEDIA</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
background: var(--bg-main);
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
color: var(--text-main);
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 30px;
|
||||
padding: 20px;
|
||||
background: var(--card-bg);
|
||||
border-radius: 15px;
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
color: var(--text-main);
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 10px 20px;
|
||||
border-radius: 8px;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: #e74c3c;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: #c0392b;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--card-bg);
|
||||
border-radius: 15px;
|
||||
padding: 25px;
|
||||
margin-bottom: 20px;
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 18px;
|
||||
color: var(--text-main);
|
||||
}
|
||||
|
||||
.tools-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.tools-table th,
|
||||
.tools-table td {
|
||||
padding: 15px;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.tools-table th {
|
||||
color: var(--text-muted);
|
||||
font-weight: 500;
|
||||
font-size: 13px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.tools-table tr:hover {
|
||||
background: var(--card-bg);
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
display: inline-block;
|
||||
padding: 5px 12px;
|
||||
border-radius: 20px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.status-available {
|
||||
background: rgba(46, 204, 113, 0.2);
|
||||
color: #2ecc71;
|
||||
}
|
||||
|
||||
.status-unavailable {
|
||||
background: rgba(231, 76, 60, 0.2);
|
||||
color: #e74c3c;
|
||||
}
|
||||
|
||||
.os-icon {
|
||||
font-size: 20px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
/* Upload Form */
|
||||
.upload-form {
|
||||
background: var(--table-row-hover);
|
||||
border: 2px dashed var(--border-color);
|
||||
border-radius: 15px;
|
||||
padding: 30px;
|
||||
text-align: center;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.upload-form:hover {
|
||||
border-color: #667eea;
|
||||
background: var(--empty-state-bg);
|
||||
}
|
||||
|
||||
.upload-form.dragover {
|
||||
border-color: #667eea;
|
||||
background: var(--hover-bg);
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group select {
|
||||
width: 100%;
|
||||
padding: 12px 15px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--input-border);
|
||||
background: var(--card-bg);
|
||||
color: var(--text-main);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group select:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
.form-group select option {
|
||||
background: var(--input-bg);
|
||||
color: var(--input-text);
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.form-group input[type="file"] {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.form-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.alert {
|
||||
padding: 15px 20px;
|
||||
border-radius: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.alert-success {
|
||||
background: rgba(46, 204, 113, 0.2);
|
||||
color: #2ecc71;
|
||||
border: 1px solid rgba(46, 204, 113, 0.3);
|
||||
}
|
||||
|
||||
.alert-error {
|
||||
background: rgba(231, 76, 60, 0.2);
|
||||
color: #e74c3c;
|
||||
border: 1px solid rgba(231, 76, 60, 0.3);
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 40px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.empty-state-icon {
|
||||
font-size: 48px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.form-row {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.header {
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.tools-table {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.tools-table th,
|
||||
.tools-table td {
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% include 'header.html' %}
|
||||
<div class="container">
|
||||
<!-- Top Navigation Tabs -->
|
||||
<div class="top-nav-tabs"
|
||||
style="display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; background: rgba(25, 118, 210, 0.05); padding: 15px; border-radius: 12px; border: 1px solid rgba(25, 118, 210, 0.1);">
|
||||
<a href="{{ url_for('index') }}" class="nav-tab"
|
||||
style="padding: 10px 20px; background: var(--card-bg); color: var(--text-main); text-decoration: none; border-radius: 8px; font-weight: 600; font-size: 14px; transition: all 0.3s ease; border: 1px solid var(--border-color); box-shadow: 0 2px 5px rgba(0,0,0,0.05);">🏠 Trang chủ</a>
|
||||
<a href="{{ url_for('my_files') }}" class="nav-tab"
|
||||
style="padding: 10px 20px; background: var(--card-bg); color: var(--text-main); text-decoration: none; border-radius: 8px; font-weight: 600; font-size: 14px; transition: all 0.3s ease; border: 1px solid var(--border-color); box-shadow: 0 2px 5px rgba(0,0,0,0.05);">📁 File của tôi</a>
|
||||
{% if user_info and user_info.role == 'admin' %}
|
||||
<a href="{{ url_for('admin_tools') }}" class="nav-tab"
|
||||
style="padding: 10px 20px; background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%); color: white; text-decoration: none; border-radius: 8px; font-weight: 600; font-size: 14px; transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(25, 118, 210, 0.3);">⚙️ Quản trị</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if user_info and user_info.role == 'admin' %}
|
||||
<!-- Admin Sub Navigation Tabs (Dark mode style) -->
|
||||
<div class="admin-sub-tabs"
|
||||
style="display: flex; justify-content: center; gap: 8px; margin-bottom: 25px; flex-wrap: wrap;">
|
||||
<a href="{{ url_for('admin_tools') }}" class="sub-tab"
|
||||
style="padding: 8px 16px; background: #667eea; color: white; text-decoration: none; border-radius: 20px; font-weight: 600; font-size: 13px; transition: all 0.3s ease; box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);">🔧 Cài đặt chung</a>
|
||||
<a href="{{ url_for('admin_users_page') }}" class="sub-tab"
|
||||
style="padding: 8px 16px; background: rgba(255, 255, 255, 0.1); color: var(--text-main); text-decoration: none; border-radius: 20px; font-weight: 600; font-size: 13px; transition: all 0.3s ease; border: 1px solid var(--input-border);">👥 Người dùng & Đơn vị</a>
|
||||
<a href="{{ url_for('list_outputs') }}" class="sub-tab"
|
||||
style="padding: 8px 16px; background: rgba(255, 255, 255, 0.1); color: var(--text-main); text-decoration: none; border-radius: 20px; font-weight: 600; font-size: 13px; transition: all 0.3s ease; border: 1px solid var(--input-border);">📂 Tất cả File</a>
|
||||
<a href="{{ url_for('server_stats_page') }}" class="sub-tab"
|
||||
style="padding: 8px 16px; background: rgba(255, 255, 255, 0.1); color: var(--text-main); text-decoration: none; border-radius: 20px; font-weight: 600; font-size: 13px; transition: all 0.3s ease; border: 1px solid var(--input-border);">📊 Thống kê</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="header">
|
||||
<h1>🔧 Quản lý Công cụ Đánh giá</h1>
|
||||
<div class="header-actions">
|
||||
<a href="{{ url_for('index') }}" class="btn btn-secondary">← Về trang chủ</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if message %}
|
||||
<div class="alert alert-{{ message.type }}">
|
||||
{{ message.text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Upload New Tool -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">📤 Tải lên Công cụ mới</h2>
|
||||
</div>
|
||||
<form action="tools/upload" method="post" enctype="multipart/form-data" class="upload-form" id="uploadForm">
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label>Hệ điều hành *</label>
|
||||
<select name="os_type" required>
|
||||
<option value="">-- Chọn OS --</option>
|
||||
{% for os_key, meta in os_metadata.items() %}
|
||||
<option value="{{ os_key }}">{{ meta.icon }} {{ meta.display_name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Phiên bản OS (vd: 22.04, 24.04, 2019) *</label>
|
||||
<input type="text" name="os_version_label" placeholder="22.04" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label>Tên công cụ *</label>
|
||||
<input type="text" name="tool_name" placeholder="Ubuntu 22.04 Hardening" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Phiên bản script (vd: v2.0.0) *</label>
|
||||
<input type="text" name="version" placeholder="v2.0.0" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group" style="grid-column: 1 / -1;">
|
||||
<label>File công cụ (.sh, .py, .ps1, .zip) *</label>
|
||||
<input type="file" name="tool_file" accept=".sh,.py,.ps1,.zip,.tar.gz" required>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">⬆️ Tải lên</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Current Tools -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">📦 Công cụ hiện có</h2>
|
||||
</div>
|
||||
|
||||
{% if tools_list %}
|
||||
<table class="tools-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hệ điều hành</th>
|
||||
<th>Phiên bản OS</th>
|
||||
<th>Tên công cụ</th>
|
||||
<th>Script ver.</th>
|
||||
<th>Cập nhật</th>
|
||||
<th>Trạng thái</th>
|
||||
<th>Thao tác</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for tool in tools_list %}
|
||||
<tr>
|
||||
<td><span class="os-icon">{{ tool.icon }}</span>{{ tool.display_name }}</td>
|
||||
<td>{{ tool.os_version_label or '-' }}</td>
|
||||
<td>{{ tool.name }}</td>
|
||||
<td><code>{{ tool.version }}</code></td>
|
||||
<td>{{ tool.updated }}</td>
|
||||
<td>
|
||||
{% if tool.available %}
|
||||
<span class="status-badge status-available">✓ Có sẵn</span>
|
||||
{% else %}
|
||||
<span class="status-badge status-unavailable">✗ Chưa có</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="white-space: nowrap;">
|
||||
{% if tool.available %}
|
||||
<div style="display: inline-flex; gap: 6px; align-items: center;">
|
||||
<a href="{{ url_for('download_tool', version_key=tool.version_key) }}"
|
||||
class="btn btn-secondary" style="padding: 5px 10px; font-size: 12px; white-space: nowrap;">⬇️ Tải</a>
|
||||
<form action="tools/delete/{{ tool.version_key }}" method="post" style="display: inline; margin: 0;"
|
||||
onsubmit="return confirm('Bạn có chắc muốn xóa công cụ này?')">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
style="padding: 5px 10px; font-size: 12px; white-space: nowrap;">🗑️ Xóa</button>
|
||||
</form>
|
||||
</div>
|
||||
{% else %}
|
||||
<span style="color: var(--text-muted);">-</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<div class="empty-state-icon">📭</div>
|
||||
<p>Chưa có công cụ nào được tải lên.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Upload Documentation Form -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">⬆️ Tải lên Tài liệu Cấu hình mới</h2>
|
||||
</div>
|
||||
<form action="{{ url_for('admin_docs_upload') }}" method="post" enctype="multipart/form-data">
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label>Tên tài liệu *</label>
|
||||
<input type="text" name="doc_name" placeholder="VD: Hướng dẫn Hardening OS" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Phiên bản tài liệu (vd: v1.0) *</label>
|
||||
<input type="text" name="doc_version" placeholder="v1.0" value="v1.0" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group" style="grid-column: 1 / -1;">
|
||||
<label>File tài liệu (.pdf, .docx, .xlsx, .zip) *</label>
|
||||
<input type="file" name="doc_file" required>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">⬆️ Tải lên Tài liệu</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Current Documentation -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">📚 Quản lý Tài liệu Cấu hình hiện có</h2>
|
||||
</div>
|
||||
|
||||
{% if docs_list %}
|
||||
<table class="tools-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tên tài liệu</th>
|
||||
<th>Tên file</th>
|
||||
<th>Phiên bản</th>
|
||||
<th>Kích thước</th>
|
||||
<th>Cập nhật</th>
|
||||
<th>Trạng thái</th>
|
||||
<th>Thao tác</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for doc in docs_list %}
|
||||
<tr>
|
||||
<td><strong>📄 {{ doc.name }}</strong></td>
|
||||
<td><code>{{ doc.file }}</code></td>
|
||||
<td><code>{{ doc.version }}</code></td>
|
||||
<td>{{ doc.size }}</td>
|
||||
<td>{{ doc.updated }}</td>
|
||||
<td>
|
||||
{% if doc.available %}
|
||||
<span class="status-badge status-available">✓ Có sẵn</span>
|
||||
{% else %}
|
||||
<span class="status-badge status-unavailable">✗ Lỗi file</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="white-space: nowrap;">
|
||||
{% if doc.available %}
|
||||
<div style="display: inline-flex; gap: 6px; align-items: center;">
|
||||
<a href="{{ url_for('download_doc', doc_key=doc.doc_key) }}"
|
||||
class="btn btn-secondary" style="padding: 5px 10px; font-size: 12px; white-space: nowrap;">⬇️ Tải</a>
|
||||
<form action="{{ url_for('admin_docs_delete', doc_key=doc.doc_key) }}" method="post" style="display: inline; margin: 0;"
|
||||
onsubmit="return confirm('Bạn có chắc muốn xóa tài liệu này?')">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
style="padding: 5px 10px; font-size: 12px; white-space: nowrap;">🗑️ Xóa</button>
|
||||
</form>
|
||||
</div>
|
||||
{% else %}
|
||||
<form action="{{ url_for('admin_docs_delete', doc_key=doc.doc_key) }}" method="post" style="display: inline; margin: 0;"
|
||||
onsubmit="return confirm('Bạn có chắc muốn xóa bản ghi này?')">
|
||||
<button type="submit" class="btn btn-danger"
|
||||
style="padding: 5px 10px; font-size: 12px; white-space: nowrap;">🗑️ Xóa</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<div class="empty-state-icon">📭</div>
|
||||
<p>Chưa có tài liệu cấu hình nào được tải lên.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Email Notification Settings -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">⚙️ Cài đặt Hệ thống</h2>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; align-items: flex-start; gap: 30px; flex-wrap: wrap;">
|
||||
<!-- Email Toggle Block -->
|
||||
<div style="flex: 1; min-width: 280px;">
|
||||
<p style="color: var(--text-muted); font-size: 13px; margin-bottom: 15px;">
|
||||
Bật / Tắt chức năng gửi email thông báo khi xử lý file hoàn tất.
|
||||
</p>
|
||||
|
||||
{% if not email_module_available %}
|
||||
<!-- Module không có sẵn -->
|
||||
<div style="display: flex; align-items: center; gap: 15px; padding: 18px 20px; background: rgba(231,76,60,0.12); border: 1px solid rgba(231,76,60,0.3); border-radius: 12px;">
|
||||
<span style="font-size: 32px;">📧</span>
|
||||
<div>
|
||||
<div style="font-weight: 600; font-size: 15px; color: #e74c3c;">Không khả dụng</div>
|
||||
<div style="font-size: 12px; color: var(--text-muted); margin-top: 4px;">
|
||||
Module <code style="background: rgba(255,255,255,0.1); padding: 1px 6px; border-radius: 4px;">email_notifier</code> chưa được cài đặt trên server này.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% elif email_enabled %}
|
||||
<!-- Module có, đang BẬT -->
|
||||
<div style="display: flex; align-items: center; gap: 15px; padding: 18px 20px; background: rgba(46,204,113,0.12); border: 1px solid rgba(46,204,113,0.3); border-radius: 12px; margin-bottom: 15px;">
|
||||
<span style="font-size: 32px;">✅</span>
|
||||
<div>
|
||||
<div style="font-weight: 600; font-size: 15px; color: #2ecc71;">Đang BẬT</div>
|
||||
<div style="font-size: 12px; color: var(--text-muted); margin-top: 4px;">
|
||||
Hệ thống sẽ gửi email thông báo sau mỗi lần xử lý file thành công.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form action="email/disable" method="post">
|
||||
<button type="submit" class="btn btn-danger" style="width: 100%;">
|
||||
🔕 Tắt gửi Email
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{% else %}
|
||||
<!-- Module có, đang TẮT -->
|
||||
<div style="display: flex; align-items: center; gap: 15px; padding: 18px 20px; background: var(--card-bg); border: 1px solid rgba(255,255,255,0.15); border-radius: 12px; margin-bottom: 15px;">
|
||||
<span style="font-size: 32px;">🔕</span>
|
||||
<div>
|
||||
<div style="font-weight: 600; font-size: 15px; color: var(--text-muted);">Đang TẮT</div>
|
||||
<div style="font-size: 12px; color: var(--text-muted); margin-top: 4px;">
|
||||
Không gửi email sau khi xử lý. Nhấn bên dưới để bật.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form action="email/enable" method="post">
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%;">
|
||||
📧 Bật gửi Email
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<p style="margin-top: 12px; font-size: 11px; color: #666; font-style: italic;">
|
||||
⚠️ Lưu ý: cài đặt này chỉ giữ trong phiên chạy hiện tại. Khi khởi động lại server, email sẽ trở về trạng thái <strong>TẮT</strong>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- User Email Stats -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">👥 Thống kê Người dùng (VNPT Email)</h2>
|
||||
</div>
|
||||
|
||||
{% if email_stats and email_stats|length > 0 %}
|
||||
<div style="overflow-x: auto;">
|
||||
<table class="tools-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Người dùng</th>
|
||||
<th>Email</th>
|
||||
<th>Số lần Upload</th>
|
||||
<th>Tổng File</th>
|
||||
<th>Lần đầu</th>
|
||||
<th>Gần nhất</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for stat in email_stats %}
|
||||
<tr>
|
||||
<td style="font-weight: 600; color: var(--text-main);">{{ stat.display_name }}</td>
|
||||
<td style="color: #90caf9;">{{ stat.email }}</td>
|
||||
<td><span class="status-badge" style="background: rgba(102,126,234,0.2); color: #8ba4f9;">{{ stat.total_uploads }}</span></td>
|
||||
<td><span class="status-badge status-available">{{ stat.total_files }}</span></td>
|
||||
<td style="font-size: 13px; color: var(--text-muted);">{{ stat.first_seen }}</td>
|
||||
<td style="font-size: 13px; color: var(--text-muted);">{{ stat.last_seen }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<div class="empty-state-icon">📭</div>
|
||||
<p>Chưa có dữ liệu thống kê từ người dùng.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Drag and drop support
|
||||
const uploadForm = document.getElementById('uploadForm');
|
||||
|
||||
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|
||||
uploadForm.addEventListener(eventName, preventDefaults, false);
|
||||
});
|
||||
|
||||
function preventDefaults(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
['dragenter', 'dragover'].forEach(eventName => {
|
||||
uploadForm.addEventListener(eventName, () => uploadForm.classList.add('dragover'), false);
|
||||
});
|
||||
|
||||
['dragleave', 'drop'].forEach(eventName => {
|
||||
uploadForm.addEventListener(eventName, () => uploadForm.classList.remove('dragover'), false);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user