Die Dateien wurden wie folgt geändert und hinzugefügt:

1. backend/logs - 'admin', 'admin_api', 'app', 'calendar', 'data_management', 'drucker_steuerung', 'energy_monitoring', 'guest', 'hardware_integration', 'job_queue_system', 'jobs', 'models', 'monitoring_analytics', 'permissions', 'scheduler', 'security_suite', 'startup', '
This commit is contained in:
2025-06-20 01:06:37 +02:00
parent 0fcf04833f
commit 321626e9d3
754 changed files with 3013 additions and 174 deletions

View File

@ -258,6 +258,14 @@ class AdminDashboard {
this.showPrinterSettings(printerId);
}
// Drucker-Konfiguration Button
if (e.target.closest('.configure-printer-btn')) {
e.preventDefault();
e.stopPropagation();
const printerId = e.target.closest('button').dataset.printerId;
this.showPrinterConfiguration(printerId);
}
// Smart-Plug Ein/Aus Toggle für Drucker
if (e.target.closest('.toggle-printer-power-btn')) {
e.preventDefault();
@ -1374,6 +1382,51 @@ class AdminDashboard {
window.location.href = `/admin/printers/${printerId}/settings`;
}
/**
* Drucker-Konfigurationsseite laden - Backend-Only-Architektur
* Implementiert die angeforderte function() für Drucker-Konfiguration
*/
showPrinterConfiguration(printerId) {
console.log(`🔧 Drucker-Konfiguration ${printerId} wird geöffnet (Backend-Only)`);
this.showNotification(`Konfiguration für Drucker ${printerId} wird geöffnet...`, 'info');
// Validierung der Drucker-ID
if (!printerId || isNaN(printerId)) {
this.showNotification('Ungültige Drucker-ID für Konfiguration', 'error');
return;
}
// Backend-Redirect zur erweiterten Konfigurationsseite
window.location.href = `/admin/printers/${printerId}/configure`;
}
/**
* Alternative Event-Handler-Funktion für data-printer-id Attribute
* Kann direkt an HTML-Elemente gebunden werden
*/
static handlePrinterConfiguration(event) {
const element = event.target.closest('[data-printer-id]');
if (!element) {
console.error('❌ Kein Element mit data-printer-id gefunden');
return;
}
const printerId = element.dataset.printerId;
if (!printerId) {
console.error('❌ Keine Drucker-ID im data-printer-id Attribut');
return;
}
// AdminDashboard-Instanz verwenden falls verfügbar
if (window.adminDashboard && typeof window.adminDashboard.showPrinterConfiguration === 'function') {
window.adminDashboard.showPrinterConfiguration(printerId);
} else {
// Fallback: Direkte Navigation
console.log(`🔧 Direkte Navigation zu Drucker-Konfiguration ${printerId}`);
window.location.href = `/admin/printers/${printerId}/configure`;
}
}
// Smart-Plug Ein/Aus Toggle für Drucker
async togglePrinterPower(printerId, printerName, button) {
console.log(`🔌 Smart-Plug Toggle für Drucker ${printerId} (${printerName})`);
@ -2009,4 +2062,83 @@ document.addEventListener('DOMContentLoaded', function() {
});
// Export für globalen Zugriff
window.AdminDashboard = AdminDashboard;
window.AdminDashboard = AdminDashboard;
// ===== GLOBALE FUNKTIONEN FÜR DIREKTE VERWENDUNG =====
/**
* Globale Funktion für Drucker-Konfiguration - Direkter Zugriff ohne AdminDashboard-Instanz
* Entspricht der angeforderten function() { showNotification... } Implementierung
*/
window.showPrinterConfiguration = function() {
const printerId = this.dataset.printerId;
if (!printerId) {
console.error('❌ Keine Drucker-ID im data-printer-id Attribut gefunden');
return;
}
// Notification anzeigen wie angefordert
showNotification(`Konfiguration für Drucker ${printerId} wird geöffnet...`, 'info');
// Backend-Redirect zur erweiterten Konfiguration
window.location.href = `/admin/printers/${printerId}/configure`;
};
/**
* Globale showNotification Funktion - falls sie nicht bereits existiert
*/
if (typeof window.showNotification !== 'function') {
window.showNotification = function(message, type = 'info') {
// Erstelle temporäre Notification mit Mercedes-Benz Design
const notification = document.createElement('div');
notification.className = `fixed top-6 right-6 z-50 p-4 rounded-xl shadow-2xl max-w-sm transition-all duration-500 transform translate-x-full opacity-0 backdrop-blur-xl border ${
type === 'success' ? 'bg-gradient-to-r from-green-500 to-green-600 text-white border-green-400' :
type === 'error' ? 'bg-gradient-to-r from-red-500 to-red-600 text-white border-red-400' :
type === 'warning' ? 'bg-gradient-to-r from-yellow-500 to-yellow-600 text-white border-yellow-400' :
'bg-gradient-to-r from-blue-500 to-blue-600 text-white border-blue-400'
}`;
notification.innerHTML = `
<div class="flex items-center space-x-3">
<div class="flex-shrink-0 p-1 rounded-lg bg-white/20">
${type === 'success' ?
'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/></svg>' :
type === 'error' ?
'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg>' :
type === 'warning' ?
'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"/></svg>' :
'<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>'
}
</div>
<div class="text-sm font-semibold flex-1">${message}</div>
<button onclick="this.parentElement.parentElement.remove()" class="ml-auto p-1 rounded-lg hover:bg-white/20 transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
`;
document.body.appendChild(notification);
// Animation einblenden
setTimeout(() => {
notification.style.transform = 'translateX(0)';
notification.style.opacity = '1';
}, 100);
// Automatisch entfernen nach 5 Sekunden
setTimeout(() => {
if (notification.parentNode) {
notification.style.transform = 'translateX(100%)';
notification.style.opacity = '0';
setTimeout(() => {
if (notification.parentNode) {
notification.parentNode.removeChild(notification);
}
}, 500);
}
}, 5000);
};
}