🎉 Removed unnecessary files & logs, updated documentation & UI components. 🖥️🔍📚💻

This commit is contained in:
2025-06-01 01:20:36 +02:00
parent 9e15c4d5c8
commit 40ca104860
22 changed files with 1476 additions and 2166 deletions

View File

@@ -356,20 +356,60 @@ async function loadRecentActivity() {
async function loadSystemStatus() {
try {
const response = await fetch('/api/stats');
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
const data = await response.json();
// Update system stats
document.getElementById('total-print-time').textContent =
formatPrintTime(data.total_print_time_hours);
document.getElementById('completed-jobs-count').textContent =
data.total_jobs_completed || 0;
document.getElementById('total-material-used').textContent =
formatMaterialUsed(data.total_material_used);
document.getElementById('last-updated-time').textContent =
data.last_updated ? formatDateTime(data.last_updated) : '-';
// Prüfen ob data gültig ist
if (!data || typeof data !== 'object') {
throw new Error('Ungültige Antwort vom Server erhalten');
}
// Update system stats mit Fallback-Werten
const totalPrintTimeEl = document.getElementById('total-print-time');
if (totalPrintTimeEl) {
totalPrintTimeEl.textContent = formatPrintTime(data.total_print_time_hours);
}
const completedJobsEl = document.getElementById('completed-jobs-count');
if (completedJobsEl) {
completedJobsEl.textContent = data.total_jobs_completed || 0;
}
const totalMaterialEl = document.getElementById('total-material-used');
if (totalMaterialEl) {
totalMaterialEl.textContent = formatMaterialUsed(data.total_material_used);
}
const lastUpdatedEl = document.getElementById('last-updated-time');
if (lastUpdatedEl) {
lastUpdatedEl.textContent = data.last_updated ? formatDateTime(data.last_updated) : '-';
}
console.log('✅ Systemstatus erfolgreich geladen:', data);
} catch (error) {
console.error('Error loading system status:', error);
showToast('Fehler beim Laden des Systemstatus', 'error');
const errorMessage = error.message || 'Unbekannter Systemfehler';
showToast(`Fehler beim Laden des Systemstatus: ${errorMessage}`, 'error');
// Fallback-Werte anzeigen
const elements = [
'total-print-time',
'completed-jobs-count',
'total-material-used',
'last-updated-time'
];
elements.forEach(id => {
const el = document.getElementById(id);
if (el) {
el.textContent = 'Fehler beim Laden';
el.classList.add('text-red-500');
}
});
}
}