🗑️ Refactor: Remove obsolete printer check scripts and update app logic
**Änderungen:** - ✅ check_printer_ips.py und check_printers.py: Entfernt nicht mehr benötigte Skripte zur Überprüfung von Drucker-IP-Adressen. - ✅ DRUCKER_STATUS_REQUIREMENTS.md: Veraltete Anforderungen entfernt. - ✅ setup_standard_printers.py: Anpassungen zur Vereinheitlichung der Drucker-IP. - ✅ app.py: Logik zur Filterung offline/unreachable Drucker aktualisiert. **Ergebnis:** - Bereinigung des Codes durch Entfernen nicht mehr benötigter Dateien. - Optimierte Logik zur Handhabung von Druckerstatus in der Anwendung. 🤖 Generated with [Claude Code](https://claude.ai/code)
This commit is contained in:
@ -951,9 +951,8 @@
|
||||
</div>
|
||||
|
||||
<!-- Enhanced Add/Edit Printer Modal -->
|
||||
<div id="printerModal" class="fixed inset-0 bg-black/60 backdrop-blur-sm hidden z-50">
|
||||
<div class="flex items-center justify-center min-h-screen p-4">
|
||||
<div class="mercedes-modal max-w-2xl w-full p-8 transform transition-all duration-300 scale-95 opacity-0" id="printerModalContent">
|
||||
<div id="printerModal" class="modal-overlay hidden">
|
||||
<div class="mercedes-modal max-w-2xl w-full p-8" id="printerModalContent">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<div>
|
||||
<h3 id="printerModalTitle" class="text-2xl font-bold text-mercedes-black dark:text-white mb-2">
|
||||
@ -1193,13 +1192,11 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Enhanced Printer Details Modal -->
|
||||
<div id="printerDetailsModal" class="fixed inset-0 bg-black/60 backdrop-blur-sm hidden z-50">
|
||||
<div class="flex items-center justify-center min-h-screen p-4">
|
||||
<div class="mercedes-modal max-w-6xl w-full p-8 transform transition-all duration-300 scale-95 opacity-0" id="printerDetailsModalContent">
|
||||
<div id="printerDetailsModal" class="modal-overlay hidden">
|
||||
<div class="mercedes-modal max-w-6xl w-full p-8" id="printerDetailsModalContent">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<div>
|
||||
<h3 id="printerDetailsTitle" class="text-2xl font-bold text-mercedes-black dark:text-white mb-2">
|
||||
@ -1270,10 +1267,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Global variables
|
||||
@ -1326,6 +1323,9 @@ class PrinterManager {
|
||||
this.refreshPrinters();
|
||||
}
|
||||
});
|
||||
|
||||
// Modal Overlay Click-to-Close
|
||||
this.setupModalOverlayHandlers();
|
||||
}
|
||||
|
||||
handleModelChange(event) {
|
||||
@ -1959,6 +1959,22 @@ class PrinterManager {
|
||||
// Placeholder for toast notification system
|
||||
}
|
||||
|
||||
setupModalOverlayHandlers() {
|
||||
const modals = ['printerModal', 'printerDetailsModal'];
|
||||
modals.forEach(modalId => {
|
||||
const modal = document.getElementById(modalId);
|
||||
if (modal) {
|
||||
modal.setAttribute('data-closable', 'true');
|
||||
modal.addEventListener('click', (e) => {
|
||||
// Schließe nur wenn auf das Overlay geklickt wird, nicht auf den Modal-Inhalt
|
||||
if (e.target === modal) {
|
||||
this.closeModal(modalId);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
closeAllModals() {
|
||||
const modals = ['printerModal', 'printerDetailsModal'];
|
||||
modals.forEach(modalId => {
|
||||
@ -1968,9 +1984,20 @@ class PrinterManager {
|
||||
|
||||
closeModal(modalId) {
|
||||
const modal = document.getElementById(modalId);
|
||||
if (modal) {
|
||||
modal.classList.add('hidden');
|
||||
const content = modal.querySelector('.mercedes-modal');
|
||||
|
||||
if (!modal || !content) {
|
||||
console.error(`Modal ${modalId} oder Content nicht gefunden`);
|
||||
return;
|
||||
}
|
||||
|
||||
// Animation für das Schließen
|
||||
content.classList.remove('show');
|
||||
|
||||
// Modal nach Animation verstecken
|
||||
setTimeout(() => {
|
||||
modal.classList.add('hidden');
|
||||
}, 300); // Entspricht der CSS-Transition-Dauer
|
||||
}
|
||||
|
||||
// Modal-Funktionen
|
||||
@ -1997,13 +2024,18 @@ class PrinterManager {
|
||||
const modal = document.getElementById(modalId);
|
||||
const content = modal.querySelector('.mercedes-modal');
|
||||
|
||||
if (!modal || !content) {
|
||||
console.error(`Modal ${modalId} oder Content nicht gefunden`);
|
||||
return;
|
||||
}
|
||||
|
||||
// Modal anzeigen
|
||||
modal.classList.remove('hidden');
|
||||
|
||||
// Animation
|
||||
setTimeout(() => {
|
||||
content.classList.remove('scale-95', 'opacity-0');
|
||||
content.classList.add('scale-100', 'opacity-100');
|
||||
}, 10);
|
||||
// Animation mit neuen CSS-Klassen
|
||||
requestAnimationFrame(() => {
|
||||
content.classList.add('show');
|
||||
});
|
||||
}
|
||||
|
||||
resetPrinterForm() {
|
||||
@ -2354,16 +2386,50 @@ function openAddPrinterModal() {
|
||||
}
|
||||
|
||||
function closePrinterModal() {
|
||||
printerManager.closeModal('printerModal');
|
||||
if (printerManager) {
|
||||
printerManager.closeModal('printerModal');
|
||||
} else {
|
||||
// Fallback für direkten Modal-Zugriff
|
||||
const modal = document.getElementById('printerModal');
|
||||
const content = modal?.querySelector('.mercedes-modal');
|
||||
if (modal && content) {
|
||||
content.classList.remove('show');
|
||||
setTimeout(() => modal.classList.add('hidden'), 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function closePrinterDetailsModal() {
|
||||
printerManager.closeModal('printerDetailsModal');
|
||||
if (printerManager) {
|
||||
printerManager.closeModal('printerDetailsModal');
|
||||
} else {
|
||||
// Fallback für direkten Modal-Zugriff
|
||||
const modal = document.getElementById('printerDetailsModal');
|
||||
const content = modal?.querySelector('.mercedes-modal');
|
||||
if (modal && content) {
|
||||
content.classList.remove('show');
|
||||
setTimeout(() => modal.classList.add('hidden'), 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Initialisierung beim Laden der Seite
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('🚀 Mercedes-Benz MYP Printer Management System wird initialisiert...');
|
||||
|
||||
// Ensure all modals are closed on page load
|
||||
const modals = ['printerModal', 'printerDetailsModal'];
|
||||
modals.forEach(modalId => {
|
||||
const modal = document.getElementById(modalId);
|
||||
if (modal) {
|
||||
modal.classList.add('hidden');
|
||||
const content = modal.querySelector('.mercedes-modal');
|
||||
if (content) {
|
||||
content.classList.remove('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
printerManager = new PrinterManager();
|
||||
|
||||
// Add Printer Button Event Listener
|
||||
|
Reference in New Issue
Block a user