"feat: Integrate database shm
This commit is contained in:
parent
1f2405d56b
commit
05468e9b2d
BIN
backend/app/database/myp.db-shm
Normal file
BIN
backend/app/database/myp.db-shm
Normal file
Binary file not shown.
BIN
backend/app/database/myp.db-wal
Normal file
BIN
backend/app/database/myp.db-wal
Normal file
Binary file not shown.
1
backend/app/docs/admin_printer_improvements.md
Normal file
1
backend/app/docs/admin_printer_improvements.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -181,6 +181,12 @@ function initSystemManagement() {
|
|||||||
if (restartSystemBtn) {
|
if (restartSystemBtn) {
|
||||||
restartSystemBtn.addEventListener('click', () => restartSystem());
|
restartSystemBtn.addEventListener('click', () => restartSystem());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Drucker-Initialisierung erzwingen
|
||||||
|
const forceInitPrintersBtn = document.getElementById('force-init-printers-btn');
|
||||||
|
if (forceInitPrintersBtn) {
|
||||||
|
forceInitPrintersBtn.addEventListener('click', () => forceInitializePrinters());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1151,9 +1157,11 @@ async function updateAllPrinters() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// System neustarten
|
/**
|
||||||
|
* System neustarten
|
||||||
|
*/
|
||||||
async function restartSystem() {
|
async function restartSystem() {
|
||||||
if (!confirm('🔄 Möchten Sie das System wirklich neu starten? Dies kann einige Minuten dauern.')) return;
|
if (!confirm('🔄 Möchten Sie das System wirklich neustarten?\n\nDies wird alle aktiven Verbindungen trennen.')) return;
|
||||||
|
|
||||||
showLoadingOverlay();
|
showLoadingOverlay();
|
||||||
|
|
||||||
@ -1163,26 +1171,72 @@ async function restartSystem() {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'X-CSRFToken': getCSRFToken()
|
'X-CSRFToken': csrfToken
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = await response.json();
|
const data = await response.json();
|
||||||
|
hideLoadingOverlay();
|
||||||
|
|
||||||
if (result.success) {
|
if (data.success) {
|
||||||
showNotification('🔄 System wird neu gestartet...', 'info');
|
showNotification('🔄 System wird neugestartet...', 'info');
|
||||||
// Nach 5 Sekunden versuchen, die Seite neu zu laden
|
|
||||||
|
// Nach 5 Sekunden zur Login-Seite weiterleiten
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
location.reload();
|
window.location.href = '/auth/login';
|
||||||
}, 5000);
|
}, 5000);
|
||||||
} else {
|
} else {
|
||||||
showNotification('❌ Fehler beim Neustart: ' + result.message, 'error');
|
showNotification('❌ Fehler beim Neustart: ' + data.message, 'error');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('System restart error:', error);
|
|
||||||
showNotification('❌ Fehler beim System-Neustart', 'error');
|
|
||||||
} finally {
|
|
||||||
hideLoadingOverlay();
|
hideLoadingOverlay();
|
||||||
|
showNotification('❌ Netzwerkfehler beim Neustart', 'error');
|
||||||
|
console.error('System restart error:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Robuste Drucker-Initialisierung erzwingen
|
||||||
|
*/
|
||||||
|
async function forceInitializePrinters() {
|
||||||
|
if (!confirm('🔄 Möchten Sie eine robuste Drucker-Initialisierung starten?\n\nDies überprüft alle Drucker um jeden Preis und markiert sie als online/offline.')) return;
|
||||||
|
|
||||||
|
showLoadingOverlay();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const url = `${API_BASE_URL}/api/admin/printers/force-initialize`;
|
||||||
|
const response = await fetch(url, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'X-CSRFToken': csrfToken
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = await response.json();
|
||||||
|
hideLoadingOverlay();
|
||||||
|
|
||||||
|
if (data.success) {
|
||||||
|
showNotification('🚀 Drucker-Initialisierung gestartet!', 'success');
|
||||||
|
showNotification('ℹ️ ' + data.info, 'info');
|
||||||
|
|
||||||
|
// Nach 3 Sekunden die Drucker-Statistiken aktualisieren
|
||||||
|
setTimeout(() => {
|
||||||
|
updateDashboardStats();
|
||||||
|
}, 3000);
|
||||||
|
|
||||||
|
// Nach 10 Sekunden eine weitere Aktualisierung für vollständige Ergebnisse
|
||||||
|
setTimeout(() => {
|
||||||
|
updateDashboardStats();
|
||||||
|
showNotification('✅ Drucker-Status wurde aktualisiert', 'success');
|
||||||
|
}, 10000);
|
||||||
|
} else {
|
||||||
|
showNotification('❌ Fehler bei der Drucker-Initialisierung: ' + data.message, 'error');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
hideLoadingOverlay();
|
||||||
|
showNotification('❌ Netzwerkfehler bei der Drucker-Initialisierung', 'error');
|
||||||
|
console.error('Force printer initialization error:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,6 +433,9 @@
|
|||||||
<button id="create-backup-btn" class="w-full px-4 py-2 bg-green-500 text-white rounded-lg hover:bg-green-600 transition-colors text-sm font-medium">
|
<button id="create-backup-btn" class="w-full px-4 py-2 bg-green-500 text-white rounded-lg hover:bg-green-600 transition-colors text-sm font-medium">
|
||||||
Backup erstellen
|
Backup erstellen
|
||||||
</button>
|
</button>
|
||||||
|
<button id="force-init-printers-btn" class="w-full px-4 py-2 bg-purple-500 text-white rounded-lg hover:bg-purple-600 transition-colors text-sm font-medium">
|
||||||
|
Drucker-Initialisierung erzwingen
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user