Files
CDN-APP-INSIDER/views/paramAdminPrivacy&Security.ejs
Dinawo 2df1b28962
All checks were successful
continuous-integration/drone/push Build is passing
Update v1.2.0-beta - Dynamic context menu & permissions
 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
2025-10-25 23:55:51 +02:00

659 lines
20 KiB
Plaintext

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Confidentialité & Sécurité - Interface Admin</title>
<link rel="icon" href="/public/assets/homelab_logo.png" />
<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@11"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 210 40% 98%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--ring: 222.2 84% 4.9%;
--radius: 0.5rem;
}
.dark {
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
--card: 222.2 84% 4.9%;
--card-foreground: 210 40% 98%;
--popover: 222.2 84% 4.9%;
--popover-foreground: 210 40% 98%;
--primary: 210 40% 98%;
--primary-foreground: 222.2 47.4% 11.2%;
--secondary: 217.2 32.6% 17.5%;
--secondary-foreground: 210 40% 98%;
--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;
--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 210 40% 98%;
--border: 217.2 32.6% 17.5%;
--input: 217.2 32.6% 17.5%;
--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 {
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;
}
.admin-card {
background: hsl(var(--card));
border: 1px solid hsl(var(--border));
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: 1000px;
animation: slideIn 0.5s ease-out;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(20px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
.admin-header {
padding: 2rem;
text-align: center;
background: linear-gradient(135deg, #10b981 0%, #059669 100%);
color: white;
position: relative;
overflow: hidden;
}
.admin-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-header h1 {
font-size: 2rem;
font-weight: 700;
margin: 0;
position: relative;
z-index: 2;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.admin-content {
padding: 2rem;
}
.section-title {
font-size: 1.5rem;
font-weight: 600;
color: hsl(var(--foreground));
margin-bottom: 1.5rem;
display: flex;
align-items: center;
gap: 0.75rem;
}
.section-title i {
color: #10b981;
}
.info-banner {
background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
border: 1px solid rgba(16, 185, 129, 0.3);
border-radius: 12px;
padding: 1.5rem;
margin-bottom: 2rem;
display: flex;
align-items: start;
gap: 1rem;
}
.info-banner-icon {
font-size: 1.5rem;
color: #10b981;
flex-shrink: 0;
}
.info-banner-content h3 {
margin: 0 0 0.5rem 0;
font-size: 1.1rem;
font-weight: 600;
color: hsl(var(--foreground));
}
.info-banner-content p {
margin: 0;
font-size: 0.9rem;
color: hsl(var(--muted-foreground));
line-height: 1.6;
}
.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: 0;
right: 0;
height: 4px;
background: linear-gradient(90deg, #10b981, #059669);
opacity: 0;
transition: opacity 0.3s ease;
}
.quick-action:hover::before {
opacity: 1;
}
.quick-action:hover {
transform: translateY(-4px);
box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
text-decoration: none;
color: hsl(var(--foreground));
}
.quick-action-icon {
font-size: 2rem;
margin-bottom: 1rem;
color: #10b981;
}
.quick-action-title {
font-weight: 600;
margin-bottom: 0.5rem;
}
.quick-action-desc {
font-size: 0.85rem;
color: hsl(var(--muted-foreground));
}
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
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;
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: linear-gradient(135deg, #10b981 0%, #059669 100%);
color: white;
box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px 0 rgba(16, 185, 129, 0.4);
}
.btn-secondary {
background: hsl(var(--secondary));
color: hsl(var(--secondary-foreground));
border: 1px solid hsl(var(--border));
}
.btn-secondary:hover {
background: hsl(var(--accent));
color: hsl(var(--accent-foreground));
transform: translateY(-1px);
}
.btn-full {
width: 100%;
}
.theme-switcher {
position: fixed;
top: 2rem;
right: 2rem;
z-index: 10;
background: hsl(var(--card));
border: 1px solid hsl(var(--border));
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);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.theme-switcher svg {
width: 1.25rem;
height: 1.25rem;
color: hsl(var(--foreground));
}
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(4px);
}
.modal-content {
background: hsl(var(--card));
margin: 5% auto;
padding: 0;
border: 1px solid hsl(var(--border));
width: 90%;
max-width: 900px;
border-radius: 16px;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
animation: slideIn 0.3s ease-out;
}
.modal-header {
padding: 1.5rem 2rem;
background: linear-gradient(135deg, #10b981 0%, #059669 100%);
color: white;
border-radius: 16px 16px 0 0;
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-header h2 {
margin: 0;
font-size: 1.5rem;
font-weight: 600;
}
.close {
color: white;
font-size: 2rem;
font-weight: 300;
cursor: pointer;
transition: all 0.2s ease;
line-height: 1;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
}
.close:hover {
background: rgba(255, 255, 255, 0.2);
transform: rotate(90deg);
}
.modal-body {
padding: 2rem;
max-height: 70vh;
overflow-y: auto;
}
.modal-body pre {
background: hsl(var(--muted));
border: 1px solid hsl(var(--border));
border-radius: 8px;
padding: 1.5rem;
overflow-x: auto;
font-size: 0.875rem;
line-height: 1.6;
color: hsl(var(--foreground));
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
white-space: pre-wrap;
word-wrap: break-word;
}
.empty-state {
text-align: center;
padding: 3rem 2rem;
color: hsl(var(--muted-foreground));
}
.empty-state-icon {
font-size: 4rem;
margin-bottom: 1.5rem;
opacity: 0.3;
color: #10b981;
}
.empty-state h3 {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 0.5rem;
color: hsl(var(--foreground));
}
.empty-state p {
font-size: 0.95rem;
color: hsl(var(--muted-foreground));
}
@media (max-width: 768px) {
.container {
padding: 1rem;
}
.admin-header {
padding: 1.5rem;
}
.admin-header h1 {
font-size: 1.5rem;
}
.admin-content {
padding: 1.5rem;
}
.theme-switcher {
top: 1rem;
right: 1rem;
}
.modal-content {
width: 95%;
margin: 10% auto;
}
.quick-actions {
grid-template-columns: 1fr;
}
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body class="dark">
<div class="backdrop"></div>
<div class="container">
<div class="admin-card">
<div class="admin-header">
<h1><i class="fas fa-shield-alt"></i> Confidentialité & Sécurité</h1>
</div>
<div class="admin-content">
<!-- Banner d'information -->
<div class="info-banner">
<div class="info-banner-icon">
<i class="fas fa-info-circle"></i>
</div>
<div class="info-banner-content">
<h3>Centre de Confidentialité</h3>
<p>
Consultez les rapports de confidentialité et de sécurité de votre système.
Ces données sont collectées de manière anonyme et permettent d'améliorer la sécurité de l'application.
</p>
</div>
</div>
<!-- Rapports -->
<div class="section-title">
<i class="fas fa-file-shield"></i>
Rapports de Sécurité
</div>
<% if (reports && reports.length > 0) { %>
<div class="quick-actions">
<% reports.forEach((report, index) => { %>
<% if (report) { %>
<div class="quick-action" data-report-index="<%= index %>">
<div class="quick-action-icon">
<i class="fas fa-file-contract"></i>
</div>
<div class="quick-action-title"><%= report.name %></div>
<div class="quick-action-desc">Cliquer pour voir le détail</div>
</div>
<% } %>
<% }); %>
</div>
<% } else { %>
<div class="empty-state">
<div class="empty-state-icon">
<i class="fas fa-folder-open"></i>
</div>
<h3>Aucun rapport disponible</h3>
<p>Les rapports de sécurité apparaîtront ici lorsqu'ils seront générés par le système.</p>
</div>
<% } %>
<!-- Bouton retour -->
<div style="margin-top: 2rem;">
<a href="/dpanel/dashboard/admin/" class="btn btn-secondary btn-full">
<i class="fas fa-arrow-left"></i>
Retourner au dashboard admin
</a>
</div>
</div>
</div>
</div>
<!-- Modals pour les rapports -->
<% if (reports && reports.length > 0) { %>
<% reports.forEach((report, index) => { %>
<% if (report) { %>
<div id="reportModal<%= index %>" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2><i class="fas fa-file-contract"></i> <%= report.name %></h2>
<span class="close" data-modal-index="<%= index %>">&times;</span>
</div>
<div class="modal-body">
<pre><%= report.content %></pre>
</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');
} else {
body.classList.remove('dark');
}
localStorage.setItem('theme', theme);
}
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');
} else {
setTheme('dark');
}
});
// =================== GESTION DES MODALS ===================
const reportButtons = document.querySelectorAll('.quick-action[data-report-index]');
const closeButtons = document.querySelectorAll('.close[data-modal-index]');
reportButtons.forEach(button => {
button.addEventListener('click', function() {
const index = this.getAttribute('data-report-index');
const modal = document.getElementById('reportModal' + index);
if (modal) {
modal.style.display = 'block';
}
});
});
closeButtons.forEach(button => {
button.addEventListener('click', function() {
const index = this.getAttribute('data-modal-index');
const modal = document.getElementById('reportModal' + index);
if (modal) {
modal.style.display = 'none';
}
});
});
window.onclick = function(event) {
if (event.target.classList.contains('modal')) {
event.target.style.display = 'none';
}
};
// =================== ANIMATIONS ===================
document.addEventListener('DOMContentLoaded', function() {
setTimeout(() => {
document.querySelector('.admin-card').style.opacity = '1';
document.querySelector('.admin-card').style.transform = 'translateY(0) scale(1)';
}, 100);
console.log('🔒 Interface Confidentialité & Sécurité chargée !');
});
</script>
</body>
</html>