public/report.html aktualisiert

This commit is contained in:
M_Viper 2024-10-18 23:51:02 +00:00
parent d061668ab6
commit 165039824b
1 changed files with 15 additions and 2 deletions

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/styles.css"> <link rel="stylesheet" href="css/styles.css">
<link rel="icon" type="image/png" href="img/Viper-plex-logo.png"> <link rel="icon" type="image/png" href="img/Viper-plex-logo.png">
<title>Viper-Plex - Meldung von Bugs und Funktionswünschen</title> <title id="web-title">${WEB_NAME}</title> <!-- Platzhalter für den Titel -->
</head> </head>
<body> <body>
<div class="logo-container"> <div class="logo-container">
@ -14,7 +14,7 @@
</a> </a>
</div> </div>
<div class="welcome-box"> <div class="welcome-box">
<h1>Willkommen bei Viper-Plex</h1> <h1 id="welcome-title">${WEB_NAME}</h1> <!-- ID für das h1-Tag -->
<nav class="navbar"> <nav class="navbar">
<div class="navbar-container"> <div class="navbar-container">
<a href="index.html" class="navbar-link">Home</a> <a href="index.html" class="navbar-link">Home</a>
@ -66,6 +66,19 @@
</footer> </footer>
<script> <script>
// Funktion, um die WEB_NAME-Variable abzurufen und einzufügen
document.addEventListener('DOMContentLoaded', () => {
fetch('/api/web-name')
.then(response => response.json())
.then(data => {
const webName = data.name;
// Ersetze den Text im h1- und title-Tag
document.getElementById('welcome-title').textContent = `Willkommen bei ${webName}`;
document.getElementById('web-title').textContent = webName;
})
.catch(error => console.error('Fehler beim Abrufen des Web-Namens:', error));
});
document.getElementById('report-form').addEventListener('submit', function(event) { document.getElementById('report-form').addEventListener('submit', function(event) {
event.preventDefault(); event.preventDefault();