Files
Discord-ai-chatbot/templates/server_admin_dashboard.html
SimolZimol 196d2ac570 modified: app.py
modified:   bot.py
	modified:   templates/server_admin_dashboard.html
	new file:   templates/server_settings.html
2025-08-19 18:35:32 +02:00

371 lines
17 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Server Admin Dashboard</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
body {
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
min-height: 100vh;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
color: #e0e0e0;
}
.admin-container {
background: rgba(30, 30, 46, 0.95);
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
padding: 2rem;
margin-top: 2rem;
}
.admin-header {
text-align: center;
margin-bottom: 3rem;
}
.admin-title {
color: #f8f9fa;
font-weight: 700;
font-size: 2.5rem;
margin-bottom: 0.5rem;
text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}
.admin-subtitle {
color: #a0a0a0;
font-size: 1.2rem;
font-weight: 400;
}
.admin-card {
background: rgba(45, 55, 72, 0.8);
border-radius: 15px;
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
transition: all 0.3s ease;
margin-bottom: 2rem;
}
.admin-card:hover {
transform: translateY(-5px);
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}
.admin-card .card-body {
padding: 2rem;
}
.card-title {
color: #f7fafc;
font-weight: 600;
font-size: 1.5rem;
margin-bottom: 1rem;
}
.card-text {
color: #cbd5e0;
font-size: 1rem;
margin-bottom: 1.5rem;
}
.scrollable-table {
max-height: 500px;
overflow-y: auto;
border-radius: 10px;
background: rgba(40, 40, 56, 0.9);
}
.table {
margin-bottom: 0;
color: #e0e0e0;
}
.table thead th {
background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
color: #f7fafc;
border: none;
padding: 1rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 0.9rem;
position: sticky;
top: 0;
z-index: 10;
}
.table tbody tr {
background: rgba(45, 55, 72, 0.6);
transition: all 0.3s ease;
border: none;
}
.table tbody tr:hover {
background: rgba(74, 85, 104, 0.8);
transform: translateY(-1px);
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.table tbody td {
padding: 1rem;
vertical-align: middle;
border: none;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
color: #e0e0e0;
}
.status-badge {
font-size: 0.9rem;
padding: 0.5rem 1rem;
border-radius: 25px;
font-weight: 600;
}
.badge-success-custom {
background: linear-gradient(135deg, #48bb78, #38a169);
color: white;
box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}
.badge-warning-custom {
background: linear-gradient(135deg, #ffa500, #ff8c00);
color: white;
box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}
.badge-danger-custom {
background: linear-gradient(135deg, #e53e3e, #c53030);
color: white;
box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}
.admin-btn {
background: linear-gradient(135deg, #4299e1, #3182ce);
border: none;
border-radius: 20px;
padding: 0.5rem 1rem;
color: #ffffff;
font-weight: 600;
text-decoration: none;
font-size: 0.85rem;
transition: all 0.3s ease;
box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}
.admin-btn:hover {
background: linear-gradient(135deg, #3182ce, #2c5282);
color: #ffffff;
text-decoration: none;
transform: translateY(-2px);
box-shadow: 0 6px 16px rgba(66, 153, 225, 0.4);
}
.section-icon {
font-size: 1.3rem;
margin-right: 0.5rem;
}
.giveaway-icon { color: #ffd700; }
.user-icon { color: #4299e1; }
.settings-icon { color: #9f7aea; }
/* Responsive Design */
@media (max-width: 768px) {
.admin-title {
font-size: 2rem;
}
.admin-container {
padding: 1rem;
margin-top: 1rem;
}
.table thead th,
.table tbody td {
padding: 0.75rem 0.5rem;
font-size: 0.9rem;
}
.scrollable-table {
max-height: 400px;
}
}
</style>
</head>
<body>
{% include 'navigation.html' %}
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-lg-12 col-xl-10">
<div class="admin-container">
<div class="admin-header">
<h1 class="admin-title">
<i class="fas fa-cogs"></i> Server Admin Dashboard
</h1>
<p class="admin-subtitle">{{ guild_name }} • Manage server settings and data</p>
</div>
<!-- Giveaway Management Section -->
<div class="admin-card">
<div class="card-body">
<h5 class="card-title">
<i class="fas fa-gift section-icon giveaway-icon"></i>Giveaway Management
</h5>
<p class="card-text">View and manage all active giveaways for this server.</p>
<div class="table-responsive scrollable-table">
<table class="table">
<thead>
<tr>
<th><i class="fas fa-tag"></i> Name</th>
<th><i class="fas fa-gamepad"></i> Platform</th>
<th><i class="fas fa-crown"></i> Winner</th>
<th><i class="fas fa-info-circle"></i> Status</th>
<th><i class="fas fa-cog"></i> Actions</th>
</tr>
</thead>
<tbody>
{% if giveaways %}
{% for giveaway in giveaways %}
<tr>
<td><strong>{{ giveaway.name }}</strong></td>
<td>{{ giveaway.platform }}</td>
<td>{{ giveaway.winner_dc_id or 'Not Assigned' }}</td>
<td>
{% if giveaway.aktiv %}
<span class="badge badge-success-custom status-badge">
<i class="fas fa-check"></i> Redeemed
</span>
{% else %}
<span class="badge badge-warning-custom status-badge">
<i class="fas fa-hourglass-half"></i> Pending
</span>
{% endif %}
</td>
<td>
<a href="{{ url_for('edit_giveaway', guild_id=guild_id, uuid=giveaway['uuid']) }}" class="admin-btn">
<i class="fas fa-edit"></i> Edit
</a>
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="5" class="text-center" style="color: #a0aec0; padding: 2rem;">
<i class="fas fa-gift" style="font-size: 2rem; margin-bottom: 1rem; display: block;"></i>
No giveaways found for this server.
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
<!-- Server Settings Section -->
<div class="admin-card">
<div class="card-body">
<h5 class="card-title">
<i class="fas fa-cogs section-icon" style="color: #9f7aea;"></i>Server Settings
</h5>
<p class="card-text">Configure server-specific settings for moderation, logging, and automation.</p>
<div class="row">
<div class="col-md-6 mb-3">
<div style="background: rgba(159, 122, 234, 0.1); border: 1px solid rgba(159, 122, 234, 0.2); border-radius: 10px; padding: 1.5rem;">
<h6 style="color: #9f7aea; margin-bottom: 0.75rem;">
<i class="fas fa-shield-alt"></i> Moderation Settings
</h6>
<p style="color: #a0aec0; margin-bottom: 1rem; font-size: 0.9rem;">
Configure mute roles, warn thresholds, and automatic moderation actions.
</p>
<a href="{{ url_for('server_settings', guild_id=guild_id) }}" class="admin-btn">
<i class="fas fa-cog"></i> Configure Settings
</a>
</div>
</div>
<div class="col-md-6 mb-3">
<div style="background: rgba(66, 153, 225, 0.1); border: 1px solid rgba(66, 153, 225, 0.2); border-radius: 10px; padding: 1.5rem;">
<h6 style="color: #4299e1; margin-bottom: 0.75rem;">
<i class="fas fa-clipboard-list"></i> Log Configuration
</h6>
<p style="color: #a0aec0; margin-bottom: 1rem; font-size: 0.9rem;">
Set up moderation logs and monitoring channels for server activity.
</p>
<a href="{{ url_for('server_settings', guild_id=guild_id) }}#log-settings" class="admin-btn">
<i class="fas fa-list"></i> Setup Logging
</a>
</div>
</div>
</div>
</div>
</div>
<!-- User Management Section -->
<div class="admin-card">
<div class="card-body">
<h5 class="card-title">
<i class="fas fa-users section-icon user-icon"></i>User Management
</h5>
<p class="card-text">Manage server members' data, including points, bans, and permissions.</p>
<div class="table-responsive scrollable-table">
<table class="table">
<thead>
<tr>
<th><i class="fas fa-id-card"></i> User ID</th>
<th><i class="fas fa-coins"></i> Points</th>
<th><i class="fas fa-layer-group"></i> Level</th>
<th><i class="fas fa-ban"></i> Status</th>
<th><i class="fas fa-cog"></i> Actions</th>
</tr>
</thead>
<tbody>
{% if server_users %}
{% for user in server_users %}
<tr>
<td><code>{{ user.user_id }}</code></td>
<td>{{ "{:,}".format(user.points) }}</td>
<td>{{ user.level }}</td>
<td>
{% if user.ban %}
<span class="badge badge-danger-custom status-badge">
<i class="fas fa-ban"></i> Banned
</span>
{% else %}
<span class="badge badge-success-custom status-badge">
<i class="fas fa-check"></i> Active
</span>
{% endif %}
</td>
<td>
<a href="{{ url_for('edit_user', guild_id=guild_id, user_id=user.user_id) }}" class="admin-btn">
<i class="fas fa-edit"></i> Edit
</a>
</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="5" class="text-center" style="color: #a0aec0; padding: 2rem;">
<i class="fas fa-users" style="font-size: 2rem; margin-bottom: 1rem; display: block;"></i>
No users found for this server.
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>