mirror of
https://github.com/MrUnknownDE/utools.git
synced 2026-04-17 13:23:45 +02:00
add version on footer
This commit is contained in:
@@ -66,6 +66,9 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const tracerouteLoader = document.getElementById('traceroute-loader');
|
||||
const tracerouteMessage = document.getElementById('traceroute-message');
|
||||
|
||||
// --- DOM Elements (Footer) ---
|
||||
const commitShaEl = document.getElementById('commit-sha');
|
||||
|
||||
// --- Configuration ---
|
||||
const API_BASE_URL = '/api'; // Anpassen, falls nötig
|
||||
|
||||
@@ -260,6 +263,22 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}
|
||||
}
|
||||
|
||||
/** Ruft die Versionsinformationen (Commit SHA) ab */
|
||||
async function fetchVersionInfo() {
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}/version`);
|
||||
if (!response.ok) throw new Error(`Network response: ${response.statusText} (${response.status})`);
|
||||
const data = await response.json();
|
||||
console.log('Received Version Info:', data);
|
||||
if (commitShaEl) {
|
||||
commitShaEl.textContent = data.commitSha || 'unknown';
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch version info:', error);
|
||||
if (commitShaEl) commitShaEl.textContent = 'error';
|
||||
}
|
||||
}
|
||||
|
||||
// --- Lookup Functions ---
|
||||
|
||||
/** Zeigt Fehler im Lookup-Bereich an */
|
||||
@@ -562,6 +581,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
// --- Initial Load & Event Listeners ---
|
||||
fetchIpInfo(); // Lade Infos zur eigenen IP
|
||||
fetchVersionInfo(); // Lade Versionsinfo für Footer
|
||||
|
||||
lookupButton.addEventListener('click', handleLookupClick);
|
||||
lookupIpInput.addEventListener('keypress', (event) => {
|
||||
|
||||
Reference in New Issue
Block a user