📝 "Refactor admin UI components for improved consistency and performance" 🌈

This commit is contained in:
2025-06-16 11:06:33 +02:00
parent 52da039da8
commit 4b2ff50f7a
5 changed files with 222 additions and 12 deletions

View File

@ -897,7 +897,17 @@ class AdminDashboard {
// Error-Management
async checkSystemHealth() {
try {
const response = await fetch('/api/admin/system-health');
const response = await fetch(`${this.apiBaseUrl}/api/admin/system/status`);
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
// Prüfe Content-Type vor JSON parsing
const contentType = response.headers.get('content-type');
if (!contentType || !contentType.includes('application/json')) {
throw new Error('Server returned non-JSON response');
}
const data = await response.json();
if (data.success) {
@ -975,10 +985,10 @@ class AdminDashboard {
}
};
console.log('📡 Sende Request an:', '/api/admin/fix-errors');
console.log('📡 Sende Request an:', `${this.apiBaseUrl}/api/admin/fix-errors`);
console.log('📝 Request Headers:', requestOptions.headers);
const response = await fetch('/api/admin/fix-errors', requestOptions);
const response = await fetch(`${this.apiBaseUrl}/api/admin/fix-errors`, requestOptions);
console.log('📡 Response Status:', response.status);
console.log('📡 Response Headers:', Object.fromEntries(response.headers.entries()));
@ -1062,7 +1072,7 @@ class AdminDashboard {
try {
const filter = level || document.getElementById('log-level-filter')?.value || 'all';
const url = `${this.apiBaseUrl}/admin/api/logs?level=${filter}&limit=100`;
const url = `${this.apiBaseUrl}/api/admin/logs?level=${filter}&limit=100`;
const response = await fetch(url, {
headers: {
@ -1205,7 +1215,7 @@ class AdminDashboard {
this.showNotification('📥 Logs werden exportiert...', 'info');
const filter = document.getElementById('log-level-filter')?.value || 'all';
const url = `${this.apiBaseUrl}/admin/api/logs/export`;
const url = `${this.apiBaseUrl}/api/admin/logs/export`;
const response = await fetch(url, {
method: 'POST',
@ -1313,10 +1323,10 @@ class AdminDashboard {
}
};
console.log('📡 TEST Request an:', '/api/admin/fix-errors');
console.log('📡 TEST Request an:', `${this.apiBaseUrl}/api/admin/fix-errors`);
console.log('📝 TEST Headers:', requestOptions.headers);
const response = await fetch('/api/admin/fix-errors', requestOptions);
const response = await fetch(`${this.apiBaseUrl}/api/admin/fix-errors`, requestOptions);
console.log('📡 TEST Response Status:', response.status);
console.log('📡 TEST Response Headers:', Object.fromEntries(response.headers.entries()));