Update v1.2.0-beta - Dynamic context menu & permissions
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
✨ New Features: - Dynamic permission-based context menus for files and folders - Support for collaborative folder access control - Upload to specific folders including shared folders - Changelog modal for version updates - Improved dark mode synchronization 🐛 Bug Fixes: - Fixed context menu displaying incorrect options - Fixed CSS !important override preventing dynamic menu behavior - Fixed folder collaboration permission checks - Fixed breadcrumb navigation with empty segments - Fixed "Premature close" error loop in attachments - Fixed missing user variable in admin routes - Fixed avatar loading COEP policy issues 🔒 Security: - Added security middleware (CSRF, rate limiting, input validation) - Fixed collaboration folder access validation - Improved shared folder permission handling 🎨 UI/UX Improvements: - Removed Actions column from folder view - Context menu now properly hides/shows based on permissions - Better visual feedback for collaborative folders - Improved upload flow with inline modals 🧹 Code Quality: - Added collaboration data to folder routes - Refactored context menu logic for better maintainability - Added debug logging for troubleshooting - Improved file upload handling with chunking support
This commit is contained in:
@@ -3,24 +3,12 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Paramètres Admin</title>
|
||||
<title>Panneau d'Administration - CDN Insider</title>
|
||||
<link rel="icon" href="/public/assets/homelab_logo.png" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<style>
|
||||
body {
|
||||
background-image: url('<%= user.wallpaper %>'); /* Placeholder for dynamic background */
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
margin: 0;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
||||
|
||||
:root {
|
||||
--background: 0 0% 100%;
|
||||
@@ -67,170 +55,702 @@
|
||||
--ring: 212.7 26.8% 83.9%;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
background-color: hsl(var(--background));
|
||||
color: hsl(var(--foreground));
|
||||
transition: background-color 0.3s ease, color 0.3s ease;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 100vh;
|
||||
background-image: url('<%= user.wallpaper %>');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
.backdrop {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 960px;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.form-container {
|
||||
background-color: hsl(var(--card));
|
||||
.profile-card {
|
||||
background: hsl(var(--card));
|
||||
border: 1px solid hsl(var(--border));
|
||||
border-radius: var(--radius);
|
||||
padding: 2rem;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
max-width: 900px;
|
||||
animation: slideIn 0.5s ease-out;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
@keyframes slideIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20px) scale(0.95);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Header admin */
|
||||
.profile-header {
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
|
||||
color: white;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.profile-header::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="white" opacity="0.1"/><circle cx="80" cy="80" r="2" fill="white" opacity="0.1"/><circle cx="40" cy="60" r="1" fill="white" opacity="0.05"/></svg>');
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.admin-icon {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
width: 100%;
|
||||
padding: 0.5rem;
|
||||
.admin-icon i {
|
||||
font-size: 4rem;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
|
||||
animation: pulse 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { transform: scale(1); }
|
||||
50% { transform: scale(1.05); }
|
||||
}
|
||||
|
||||
.user-info {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 0.5rem;
|
||||
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.user-subtitle {
|
||||
font-size: 1rem;
|
||||
opacity: 0.9;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.role-badge {
|
||||
display: inline-block;
|
||||
background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 25px;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
/* Onglets */
|
||||
.tabs-container {
|
||||
background: hsl(var(--card));
|
||||
border-bottom: 1px solid hsl(var(--border));
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
overflow-x: auto;
|
||||
scrollbar-width: none;
|
||||
-ms-overflow-style: none;
|
||||
}
|
||||
|
||||
.tabs::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab {
|
||||
padding: 1.25rem 2rem;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
background: transparent;
|
||||
color: hsl(var(--muted-foreground));
|
||||
border: none;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 500;
|
||||
position: relative;
|
||||
border-bottom: 3px solid transparent;
|
||||
}
|
||||
|
||||
.tab:hover {
|
||||
background-color: hsl(var(--accent));
|
||||
color: hsl(var(--accent-foreground));
|
||||
}
|
||||
|
||||
.tab.active {
|
||||
background: hsl(var(--primary));
|
||||
color: hsl(var(--primary-foreground));
|
||||
border-bottom-color: hsl(var(--primary));
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.tab.active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 3px;
|
||||
background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--ring)));
|
||||
border-radius: 3px 3px 0 0;
|
||||
}
|
||||
|
||||
.tab i {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
/* Contenu des onglets */
|
||||
.tab-content {
|
||||
display: none;
|
||||
padding: 2rem;
|
||||
animation: fadeIn 0.3s ease-out;
|
||||
}
|
||||
|
||||
.tab-content.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: translateY(10px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
/* Stats cards */
|
||||
.stats-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 1.5rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
background: hsl(var(--card));
|
||||
border: 1px solid hsl(var(--border));
|
||||
border-radius: var(--radius);
|
||||
background-color: hsl(var(--background));
|
||||
border-radius: 12px;
|
||||
padding: 1.5rem;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.stat-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, #3b82f6, #8b5cf6);
|
||||
}
|
||||
|
||||
.stat-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.stat-icon {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 0.85rem;
|
||||
color: hsl(var(--muted-foreground));
|
||||
font-weight: 500;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 1.75rem;
|
||||
font-weight: 700;
|
||||
color: hsl(var(--foreground));
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
/* Actions rapides */
|
||||
.quick-actions {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.quick-action {
|
||||
background: hsl(var(--card));
|
||||
border: 1px solid hsl(var(--border));
|
||||
border-radius: 12px;
|
||||
padding: 1.5rem;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
text-decoration: none;
|
||||
color: hsl(var(--foreground));
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.quick-action::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
|
||||
transition: left 0.5s;
|
||||
}
|
||||
|
||||
.quick-action:hover::before {
|
||||
left: 100%;
|
||||
}
|
||||
|
||||
.quick-action:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
|
||||
text-decoration: none;
|
||||
color: hsl(var(--foreground));
|
||||
}
|
||||
|
||||
.quick-action-icon {
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 1rem;
|
||||
color: hsl(var(--primary));
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.quick-action:hover .quick-action-icon {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.quick-action-title {
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.quick-action-desc {
|
||||
font-size: 0.85rem;
|
||||
color: hsl(var(--muted-foreground));
|
||||
}
|
||||
|
||||
/* System info */
|
||||
.system-info-grid {
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.system-info-item {
|
||||
background: hsl(var(--card));
|
||||
border: 1px solid hsl(var(--border));
|
||||
border-radius: 8px;
|
||||
padding: 1rem 1.5rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.system-info-label {
|
||||
font-weight: 500;
|
||||
color: hsl(var(--muted-foreground));
|
||||
}
|
||||
|
||||
.system-info-value {
|
||||
font-weight: 600;
|
||||
color: hsl(var(--foreground));
|
||||
}
|
||||
|
||||
/* Boutons */
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: var(--radius);
|
||||
gap: 0.5rem;
|
||||
padding: 0.875rem 1.5rem;
|
||||
border-radius: 25px;
|
||||
font-weight: 500;
|
||||
font-size: 0.95rem;
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
width: 100%; /* Full width */
|
||||
padding: 0.75rem; /* Adjust padding as needed */
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.btn::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
||||
transition: left 0.5s;
|
||||
}
|
||||
|
||||
.btn:hover::before {
|
||||
left: 100%;
|
||||
}
|
||||
|
||||
.btn:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: hsl(var(--primary));
|
||||
background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--ring)) 100%);
|
||||
color: hsl(var(--primary-foreground));
|
||||
box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
opacity: 0.9;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px 0 rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background-color: hsl(var(--secondary));
|
||||
background: hsl(var(--secondary));
|
||||
color: hsl(var(--secondary-foreground));
|
||||
border: 1px solid hsl(var(--border));
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
opacity: 0.9;
|
||||
background: hsl(var(--accent));
|
||||
color: hsl(var(--accent-foreground));
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
#themeSwitcher {
|
||||
.btn-full {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Theme switcher */
|
||||
.theme-switcher {
|
||||
position: fixed;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
z-index: 1000; /* Ensure it stays above other elements */
|
||||
background-color: hsl(var(--secondary));
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
padding: 0.5rem;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
#themeSwitcher:hover {
|
||||
background-color: hsl(var(--primary));
|
||||
}
|
||||
|
||||
#themeSwitcher svg {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
color: hsl(var(--primary-foreground));
|
||||
}
|
||||
|
||||
.animate {
|
||||
animation: fadeIn 0.5s ease-out;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
.icon-spacing {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.swal2-toast {
|
||||
background-color: hsl(var(--card));
|
||||
color: hsl(var(--foreground));
|
||||
top: 2rem;
|
||||
right: 2rem;
|
||||
z-index: 10;
|
||||
background: hsl(var(--card));
|
||||
border: 1px solid hsl(var(--border));
|
||||
border-radius: var(--radius);
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 50%;
|
||||
padding: 0.75rem;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.theme-switcher:hover {
|
||||
transform: scale(1.1) rotate(180deg);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.theme-switcher svg {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
color: hsl(var(--foreground));
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 768px) {
|
||||
.container {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.profile-header {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.tab {
|
||||
padding: 1rem 1.5rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.theme-switcher {
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.quick-actions {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Toast notifications */
|
||||
.swal2-toast {
|
||||
background-color: hsl(var(--card)) !important;
|
||||
color: hsl(var(--foreground)) !important;
|
||||
border: 1px solid hsl(var(--border)) !important;
|
||||
border-radius: var(--radius) !important;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
|
||||
}
|
||||
|
||||
.dark .swal2-toast {
|
||||
background-color: #000; /* Fond noir en mode sombre */
|
||||
color: #fff; /* Texte blanc */
|
||||
border: 1px solid #333; /* Bordure grise foncée */
|
||||
background-color: hsl(var(--card)) !important;
|
||||
color: hsl(var(--foreground)) !important;
|
||||
border: 1px solid hsl(var(--border)) !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="animate dark">
|
||||
<button id="themeSwitcher">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" />
|
||||
</svg>
|
||||
</button>
|
||||
<body class="dark">
|
||||
<div class="backdrop"></div>
|
||||
|
||||
<div class="min-h-screen flex items-center justify-center p-4">
|
||||
<div class="container mt-8">
|
||||
<h1 class="text-3xl font-semibold mb-6 text-center">Paramètres Admin</h1>
|
||||
<div class="container">
|
||||
<div class="profile-card">
|
||||
<!-- Header admin -->
|
||||
<div class="profile-header">
|
||||
<div class="admin-icon">
|
||||
<i class="fas fa-user-shield"></i>
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<h1 class="user-name">Panneau d'Administration</h1>
|
||||
<p class="user-subtitle">Centre de contrôle du système CDN Insider</p>
|
||||
<div class="role-badge">
|
||||
<i class="fas fa-crown"></i> Administrateur
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-container">
|
||||
<div class="flex flex-col gap-4">
|
||||
<a href="/dpanel/dashboard/admin/users?page=1&limit=10" class="btn btn-primary flex items-center justify-center space-x-2">
|
||||
<i class="fas fa-users icon-spacing"></i>
|
||||
<span>Gérer les utilisateurs</span>
|
||||
</a>
|
||||
|
||||
<a href="/dpanel/dashboard/admin/settingsetup" class="btn btn-primary flex items-center justify-center space-x-2">
|
||||
<i class="fas fa-cogs icon-spacing"></i>
|
||||
<span>Modifier les paramètres de configuration</span>
|
||||
</a>
|
||||
|
||||
<a href="/dpanel/dashboard/admin/stats-logs" class="btn btn-primary flex items-center justify-center space-x-2">
|
||||
<i class="fas fa-chart-bar icon-spacing"></i>
|
||||
<span>Afficher les statistiques & logs</span>
|
||||
</a>
|
||||
|
||||
<a href="/dpanel/dashboard/admin/Privacy-Security" class="btn btn-primary flex items-center justify-center space-x-2">
|
||||
<i class="fas fa-shield-alt icon-spacing"></i>
|
||||
<span>Confidentialité & Sécurité</span>
|
||||
</a>
|
||||
|
||||
<button onclick="window.location.href='/dpanel/dashboard';" class="btn btn-secondary w-full py-2 mt-4">
|
||||
<i class="fas fa-arrow-left icon-spacing"></i>
|
||||
Retour au Dashboard
|
||||
<!-- Onglets -->
|
||||
<div class="tabs-container">
|
||||
<div class="tabs">
|
||||
<button class="tab active" data-tab="overview">
|
||||
<i class="fas fa-chart-pie"></i>
|
||||
Aperçu
|
||||
</button>
|
||||
<button class="tab" data-tab="management">
|
||||
<i class="fas fa-tasks"></i>
|
||||
Gestion
|
||||
</button>
|
||||
<button class="tab" data-tab="system">
|
||||
<i class="fas fa-server"></i>
|
||||
Système
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contenu de l'onglet Aperçu -->
|
||||
<div class="tab-content active" id="overview">
|
||||
<div class="stats-grid">
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon">
|
||||
<i class="fas fa-users"></i>
|
||||
</div>
|
||||
<div class="stat-label">Utilisateurs totaux</div>
|
||||
<div class="stat-value"><%= users.length %></div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon">
|
||||
<i class="fas fa-folder"></i>
|
||||
</div>
|
||||
<div class="stat-label">Dossiers actifs</div>
|
||||
<div class="stat-value"><%= stats.foldersCount %></div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-icon">
|
||||
<i class="fas fa-hdd"></i>
|
||||
</div>
|
||||
<div class="stat-label">Espace utilisé</div>
|
||||
<div class="stat-value">
|
||||
<%
|
||||
const sizeInGB = (stats.totalSize / (1024 * 1024 * 1024)).toFixed(2);
|
||||
const sizeInMB = (stats.totalSize / (1024 * 1024)).toFixed(2);
|
||||
%>
|
||||
<%= stats.totalSize > 1073741824 ? sizeInGB + ' GB' : sizeInMB + ' MB' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; margin-top: 2rem;">
|
||||
<a href="/dpanel/dashboard" class="btn btn-secondary">
|
||||
<i class="fas fa-arrow-left"></i>
|
||||
Retour au Dashboard
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contenu de l'onglet Gestion -->
|
||||
<div class="tab-content" id="management">
|
||||
<div class="quick-actions">
|
||||
<a href="/dpanel/dashboard/admin/users?page=1&limit=10" class="quick-action">
|
||||
<div class="quick-action-icon">
|
||||
<i class="fas fa-users-cog"></i>
|
||||
</div>
|
||||
<div class="quick-action-title">Utilisateurs</div>
|
||||
<div class="quick-action-desc">Gérer les comptes utilisateurs</div>
|
||||
</a>
|
||||
<a href="/dpanel/dashboard/admin/settingsetup" class="quick-action">
|
||||
<div class="quick-action-icon">
|
||||
<i class="fas fa-cogs"></i>
|
||||
</div>
|
||||
<div class="quick-action-title">Configuration</div>
|
||||
<div class="quick-action-desc">Paramètres du système</div>
|
||||
</a>
|
||||
<a href="/dpanel/dashboard/admin/stats-logs" class="quick-action">
|
||||
<div class="quick-action-icon">
|
||||
<i class="fas fa-chart-line"></i>
|
||||
</div>
|
||||
<div class="quick-action-title">Stats & Logs</div>
|
||||
<div class="quick-action-desc">Statistiques et journaux</div>
|
||||
</a>
|
||||
<a href="/dpanel/dashboard/admin/Privacy-Security" class="quick-action">
|
||||
<div class="quick-action-icon">
|
||||
<i class="fas fa-shield-alt"></i>
|
||||
</div>
|
||||
<div class="quick-action-title">Sécurité</div>
|
||||
<div class="quick-action-desc">Confidentialité et sécurité</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Contenu de l'onglet Système -->
|
||||
<div class="tab-content" id="system">
|
||||
<div class="system-info-grid">
|
||||
<div class="system-info-item">
|
||||
<span class="system-info-label">
|
||||
<i class="fas fa-server"></i> Statut du serveur
|
||||
</span>
|
||||
<span class="system-info-value" style="color: #10b981;">
|
||||
<i class="fas fa-circle"></i> En ligne
|
||||
</span>
|
||||
</div>
|
||||
<div class="system-info-item">
|
||||
<span class="system-info-label">
|
||||
<i class="fas fa-code-branch"></i> Version
|
||||
</span>
|
||||
<span class="system-info-value">v1.2.0-beta</span>
|
||||
</div>
|
||||
<div class="system-info-item">
|
||||
<span class="system-info-label">
|
||||
<i class="fas fa-clock"></i> Uptime
|
||||
</span>
|
||||
<span class="system-info-value">
|
||||
<%
|
||||
const days = Math.floor(stats.uptime / 86400);
|
||||
const hours = Math.floor((stats.uptime % 86400) / 3600);
|
||||
const minutes = Math.floor((stats.uptime % 3600) / 60);
|
||||
const uptimeText = days > 0 ? `${days}j ${hours}h ${minutes}m` :
|
||||
hours > 0 ? `${hours}h ${minutes}m` : `${minutes}m`;
|
||||
%>
|
||||
<%= uptimeText %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="system-info-item">
|
||||
<span class="system-info-label">
|
||||
<i class="fas fa-database"></i> Base de données
|
||||
</span>
|
||||
<span class="system-info-value" style="color: #10b981;">
|
||||
<i class="fas fa-check-circle"></i> Connectée
|
||||
</span>
|
||||
</div>
|
||||
<div class="system-info-item">
|
||||
<span class="system-info-label">
|
||||
<i class="fas fa-memory"></i> Utilisation mémoire
|
||||
</span>
|
||||
<span class="system-info-value"><%= stats.memoryUsage %> MB</span>
|
||||
</div>
|
||||
<div class="system-info-item">
|
||||
<span class="system-info-label">
|
||||
<i class="fas fa-microchip"></i> Charge CPU
|
||||
</span>
|
||||
<span class="system-info-value"><%= stats.cpuUsage %> ms</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 2rem; padding: 1.5rem; background: hsl(var(--muted)); border-radius: 12px; border-left: 4px solid #3b82f6;">
|
||||
<div style="display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem;">
|
||||
<i class="fas fa-info-circle" style="color: #3b82f6; font-size: 1.25rem;"></i>
|
||||
<strong style="color: hsl(var(--foreground));">Informations système</strong>
|
||||
</div>
|
||||
<p style="margin: 0; font-size: 0.9rem; color: hsl(var(--muted-foreground)); line-height: 1.6;">
|
||||
Le système CDN Insider fonctionne de manière optimale. Toutes les connexions sont sécurisées et les services sont opérationnels.
|
||||
Surveillez régulièrement les statistiques pour maintenir les performances du système.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Theme Switcher -->
|
||||
<button class="theme-switcher" id="themeSwitcher">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<script>
|
||||
// =================== VARIABLES GLOBALES ===================
|
||||
const body = document.body;
|
||||
const themeSwitcher = document.getElementById('themeSwitcher');
|
||||
|
||||
|
||||
// =================== GESTION DU THÈME ===================
|
||||
function setTheme(theme) {
|
||||
if (theme === 'dark') {
|
||||
body.classList.add('dark');
|
||||
@@ -239,14 +759,15 @@
|
||||
}
|
||||
localStorage.setItem('theme', theme);
|
||||
}
|
||||
|
||||
|
||||
// Initialisation du thème
|
||||
const savedTheme = localStorage.getItem('theme');
|
||||
if (savedTheme) {
|
||||
setTheme(savedTheme);
|
||||
} else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
setTheme('dark');
|
||||
}
|
||||
|
||||
|
||||
themeSwitcher.addEventListener('click', function() {
|
||||
if (body.classList.contains('dark')) {
|
||||
setTheme('light');
|
||||
@@ -254,13 +775,39 @@
|
||||
setTheme('dark');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// =================== GESTION DES ONGLETS ===================
|
||||
function switchTab(tabName) {
|
||||
// Désactiver tous les onglets
|
||||
document.querySelectorAll('.tab').forEach(tab => {
|
||||
tab.classList.remove('active');
|
||||
});
|
||||
|
||||
// Masquer tout le contenu
|
||||
document.querySelectorAll('.tab-content').forEach(content => {
|
||||
content.classList.remove('active');
|
||||
});
|
||||
|
||||
// Activer l'onglet et le contenu sélectionnés
|
||||
document.querySelector(`[data-tab="${tabName}"]`).classList.add('active');
|
||||
document.getElementById(tabName).classList.add('active');
|
||||
}
|
||||
|
||||
// Gestionnaires d'événements pour les onglets
|
||||
document.querySelectorAll('.tab').forEach(tab => {
|
||||
tab.addEventListener('click', function() {
|
||||
const tabName = this.getAttribute('data-tab');
|
||||
switchTab(tabName);
|
||||
});
|
||||
});
|
||||
|
||||
// =================== NOTIFICATIONS ===================
|
||||
function showToast(icon, title) {
|
||||
Swal.fire({
|
||||
icon: icon,
|
||||
title: title,
|
||||
showConfirmButton: false,
|
||||
timer: 1800,
|
||||
timer: 3000,
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
customClass: {
|
||||
@@ -268,6 +815,18 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// =================== INITIALISATION ===================
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Animation d'entrée
|
||||
setTimeout(() => {
|
||||
document.querySelector('.profile-card').style.opacity = '1';
|
||||
document.querySelector('.profile-card').style.transform = 'translateY(0) scale(1)';
|
||||
}, 100);
|
||||
|
||||
console.log('🎨 Panneau d\'administration chargé !');
|
||||
console.log('✨ Interface moderne activée');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user