V1.0.0-beta.16 Update
All checks were successful
continuous-integration/drone/push Build is passing

Note: We appreciate your feedback and bug reports to continue improving our platform. Thank you for your continued support!
This commit is contained in:
2024-10-27 16:48:30 +01:00
parent f83358c67d
commit 9ff4642a10
33 changed files with 3550 additions and 2058 deletions

View File

@@ -1,43 +1,159 @@
<!DOCTYPE html>
<html lang="en">
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="stylesheet" href="/public/css/login.css">
<title>Confidentialité et Sécurité</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/chart.js"></script>
<style>
body {
background-image: url('<%= user.wallpaper %>');
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');
: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%;
}
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;
}
.container {
max-width: 960px;
margin: 0 auto;
padding: 2rem;
}
.form-container {
background-color: hsl(var(--card));
border: 1px solid hsl(var(--border));
border-radius: var(--radius);
padding: 2rem;
}
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: var(--radius);
font-weight: 500;
transition: all 0.3s ease;
cursor: pointer;
}
.btn-primary {
background-color: hsl(var(--primary));
color: hsl(var(--primary-foreground));
}
.btn-primary:hover {
opacity: 0.9;
}
.btn-secondary {
background-color: hsl(var(--secondary));
color: hsl(var(--secondary-foreground));
}
.btn-secondary:hover {
opacity: 0.9;
}
#themeSwitcher {
position: fixed;
top: 1rem;
right: 1rem;
}
.animate {
animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0,0,0,0.4);
}
/* Modal Content */
.modal-content {
background-color: #fefefe;
margin: auto;
background-color: hsl(var(--background));
margin: 15% auto;
padding: 20px;
border: 1px solid #888;
border: 1px solid hsl(var(--border));
width: 80%;
border-radius: var(--radius);
}
/* The Close Button */
.close {
color: #aaaaaa;
color: hsl(var(--muted-foreground));
float: right;
font-size: 28px;
font-weight: bold;
@@ -45,156 +161,108 @@
.close:hover,
.close:focus {
color: #000;
color: hsl(var(--foreground));
text-decoration: none;
cursor: pointer;
}
</style>
</head>
<body class="animate">
<div id="app" class="min-h-screen">
<div class="container mt-8">
<h1 class="text-3xl font-semibold mb-6 text-center animate">Confidentialité et Sécurité</h1>
.custom-btn {
display: inline-flex;
align-items: center;
justify-content: center;
font-family: inherit;
font-weight: 500;
font-size: 14px; /* réduit la taille de la police */
padding: 0.6em 1.2em; /* réduit le padding */
color: white;
background: linear-gradient(0deg, rgba(77,54,208,1) 0%, rgba(132,116,254,1) 100%);
border: none;
box-shadow: 0 0.7em 1.5em -0.5em #4d36d0be;
letter-spacing: 0.05em;
border-radius: 15em; /* réduit le rayon de la bordure */
cursor: pointer;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
<div class="form-container">
<h2 class="text-2xl font-semibold mb-4">Données d'analyse</h2>
<% if (reports && reports.length > 0) { %>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<% reports.forEach((report, index) => { %>
<% if (report) { %>
<div class="text-center">
<button class="btn btn-primary w-full reportName" data-index="<%= index %>"><%= report.name %></button>
</div>
<div id="myReportModal<%= index %>" class="modal">
<div class="modal-content">
<span class="close" data-index="<%= index %>">&times;</span>
<pre class="whitespace-pre-wrap"><%= report.content %></pre>
</div>
</div>
<% } %>
<% }); %>
</div>
<% } else { %>
<p class="text-center text-lg text-gray-500">Aucun rapport disponible pour le moment.</p>
<% } %>
<div class="text-center">
<br><button onclick="window.location.href='/dpanel/dashboard/admin';" class="btn btn-secondary w-full py-2 mt-4">
<i class="fas fa-arrow-left icon-spacing"></i>
Retour au Dashboard Admin
</button>
</div>
</div>
</div>
</div>
<button id="themeSwitcher" class="btn btn-secondary p-2">
<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>
<script>
const body = document.body;
const themeSwitcher = document.getElementById('themeSwitcher');
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');
}
</style>
</head>
<body class="light-mode animate">
<div class="container mt-4 table-container animate">
<h2 class="text-center">Confidentialité et Sécurité</h2><br>
<h2>Données d'analyse</h2>
<div class="row">
<% reports && reports.forEach((report, index) => { %>
<% if (report) { %>
<div class="col-md-4 text-center">
<button class="btn btn-primary custom-btn reportName" data-index="<%= index %>"><%= report.name %></button>
</div>
<% if ((index + 1) % 3 === 0) { %>
</div><div class="row">
<% } %>
<div id="myReportModal<%= index %>" class="modal">
<div class="modal-content">
<span class="close" data-index="<%= index %>">&times;</span>
<pre><%= report.content %></pre>
</div>
</div>
<% } %>
<% }); %>
</div>
<br><div class="d-flex justify-content-center align-items-center">
<a class="dropdown-item text-center text-white no-hover custom-btn" href="/dpanel/dashboard/admin/" style="max-width: 250px; padding: 10px;">
<i class="fas fa-sign-out-alt text-white "></i> Retourner au dashboard admin
</a>
</div>
<div class="d-flex justify-content-center animate">
<button id="themeSwitcher" class="btn btn-warning mt-3 animate ">Changer de Thème</button>
</div>
<script>
var logNames = document.getElementsByClassName("logName");
var closeButtons = document.getElementsByClassName("close");
// Add event listeners to all log names
for (var i = 0; i < logNames.length; i++) {
logNames[i].addEventListener("click", function(event) {
var index = event.target.getAttribute("data-index");
var modal = document.getElementById("myModal" + index);
modal.style.display = "block";
});
themeSwitcher.addEventListener('click', function() {
if (body.classList.contains('dark')) {
setTheme('light');
} else {
setTheme('dark');
}
});
// Add event listeners to all close buttons
for (var i = 0; i < closeButtons.length; i++) {
closeButtons[i].addEventListener("click", function(event) {
var index = event.target.getAttribute("data-index");
var modal = document.getElementById("myModal" + index);
modal.style.display = "none";
});
}
var reportNames = document.getElementsByClassName("reportName");
var reportCloseButtons = document.getElementsByClassName("close");
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target.className === "modal") {
event.target.style.display = "none";
}
}
var reportNames = document.getElementsByClassName("reportName");
var reportCloseButtons = document.getElementsByClassName("close");
// Add event listeners to all report names
for (var i = 0; i < reportNames.length; i++) {
reportNames[i].addEventListener("click", function(event) {
var index = event.target.getAttribute("data-index");
var modal = document.getElementById("myReportModal" + index);
modal.style.display = "block";
});
}
// Add event listeners to all close buttons
for (var i = 0; i < reportCloseButtons.length; i++) {
reportCloseButtons[i].addEventListener("click", function(event) {
var index = event.target.getAttribute("data-index");
var modal = document.getElementById("myReportModal" + index);
modal.style.display = "none";
});
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target.className === "modal") {
event.target.style.display = "none";
}
}
const body = document.body;
document.getElementById('themeSwitcher').addEventListener('click', function () {
if (body.classList.contains('dark-mode')) {
body.classList.remove('dark-mode');
body.classList.add('light-mode');
} else {
body.classList.remove('light-mode');
body.classList.add('dark-mode');
}
for (var i = 0; i < reportNames.length; i++) {
reportNames[i].addEventListener("click", function(event) {
var index = event.target.getAttribute("data-index");
var modal = document.getElementById("myReportModal" + index);
modal.style.display = "block";
});
}
document.addEventListener('DOMContentLoaded', function () {
const darkModeSwitch = document.getElementById('darkModeSwitch');
for (var i = 0; i < reportCloseButtons.length; i++) {
reportCloseButtons[i].addEventListener("click", function(event) {
var index = event.target.getAttribute("data-index");
var modal = document.getElementById("myReportModal" + index);
modal.style.display = "none";
});
}
const darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
body.classList.toggle('dark-mode', darkModeMediaQuery.matches);
darkModeMediaQuery.addListener(function (e) {
body.classList.toggle('dark-mode', e.matches);
});
});
window.onclick = function(event) {
if (event.target.className === "modal") {
event.target.style.display = "none";
}
}
</script>
</body>
</script>
</div>
</body>
</html>
</html>