Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
@@ -1,43 +1,52 @@
|
||||
import '../css/styles.css';
|
||||
|
||||
import { initApp } from './core/init.js';
|
||||
import { Logger } from './core/logger.js';
|
||||
import { CsrfAutoRefresh } from './modules/csrf-auto-refresh.js';
|
||||
import { FormAutoSave } from './modules/form-autosave.js';
|
||||
|
||||
// resources/js/app.js (dein Einstiegspunkt)
|
||||
import { registerSW } from 'virtual:pwa-register';
|
||||
// PWA Service Worker temporarily disabled
|
||||
// TODO: Re-enable after fixing build issues
|
||||
|
||||
const updateSW = registerSW({
|
||||
onNeedRefresh() {
|
||||
const reload = confirm('🔄 Neue Version verfügbar. Seite neu laden?');
|
||||
if (reload) updateSW(true);
|
||||
},
|
||||
onOfflineReady() {
|
||||
console.log('📦 Offline-Inhalte sind bereit.');
|
||||
document.addEventListener("DOMContentLoaded", async () => {
|
||||
try {
|
||||
console.log('🚀 Starting app initialization...');
|
||||
await initApp();
|
||||
console.log('✅ App initialized successfully!');
|
||||
|
||||
// Initialize CSRF Auto-Refresh for all forms
|
||||
const csrfInstances = CsrfAutoRefresh.initializeAll();
|
||||
console.log(`🔒 CSRF Auto-Refresh initialized for ${csrfInstances.length} forms`);
|
||||
|
||||
// Initialize Form Auto-Save for all forms
|
||||
const autosaveInstances = FormAutoSave.initializeAll();
|
||||
console.log(`💾 Form Auto-Save initialized for ${autosaveInstances.length} forms`);
|
||||
|
||||
// Debug info
|
||||
setTimeout(() => {
|
||||
console.log('📊 Debug Info:');
|
||||
console.log('- Forms found:', document.querySelectorAll('form').length);
|
||||
console.log('- Links found:', document.querySelectorAll('a[href^="/"]').length);
|
||||
console.log('- SPA Router:', window.spaRouter ? 'Active' : 'Missing');
|
||||
console.log('- Enhanced forms:', document.querySelectorAll('form[data-auto-enhanced]').length);
|
||||
console.log('- CSRF protected forms:', document.querySelectorAll('input[name="_token"]').length);
|
||||
}, 500);
|
||||
} catch (error) {
|
||||
console.error('❌ App initialization failed:', error);
|
||||
console.error('Stack trace:', error.stack);
|
||||
}
|
||||
});
|
||||
|
||||
registerSW({
|
||||
onRegistered(reg) {
|
||||
console.log('Service Worker registriert:', reg);
|
||||
},
|
||||
onRegisterError(error) {
|
||||
console.error('Service Worker Fehler:', error);
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
initApp();
|
||||
});
|
||||
|
||||
function isHtmlAttributeSupported(elementName, attribute) {
|
||||
const element = document.createElement(elementName);
|
||||
return attribute in element;
|
||||
}
|
||||
|
||||
|
||||
let closedAttr = document.getElementById('my-dialog');
|
||||
if(! 'closedby' in closedAttr) {
|
||||
/*let closedAttr = document.getElementById('my-dialog');
|
||||
if(closedAttr && !('closedby' in closedAttr)) {
|
||||
alert('oh no');
|
||||
}
|
||||
}*/
|
||||
|
||||
/*
|
||||
if (isHtmlAttributeSupported('dialog', 'closedby')) {
|
||||
|
||||
Reference in New Issue
Block a user