Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
- Remove middleware reference from Gitea Traefik labels (caused routing issues) - Optimize Gitea connection pool settings (MAX_IDLE_CONNS=30, authentication_timeout=180s) - Add explicit service reference in Traefik labels - Fix intermittent 504 timeouts by improving PostgreSQL connection handling Fixes Gitea unreachability via git.michaelschiemer.de
81 lines
2.9 KiB
JavaScript
81 lines
2.9 KiB
JavaScript
// Hot Reload Test JavaScript
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const statusDiv = document.getElementById('status');
|
|
const logDiv = document.getElementById('log');
|
|
|
|
function log(message, className = '') {
|
|
const time = new Date().toLocaleTimeString();
|
|
const p = document.createElement('p');
|
|
p.innerHTML = `[${time}] ${message}`;
|
|
if (className) {
|
|
p.className = className;
|
|
}
|
|
logDiv.appendChild(p);
|
|
logDiv.scrollTop = logDiv.scrollHeight;
|
|
console.log(message);
|
|
}
|
|
|
|
log('Testing Hot Reload connection...');
|
|
|
|
const eventSource = new EventSource('/dev-hot-reload-minimal.php');
|
|
|
|
eventSource.addEventListener('open', function() {
|
|
statusDiv.textContent = 'Connected to Hot Reload server!';
|
|
statusDiv.className = 'connected';
|
|
statusDiv.style.color = 'green';
|
|
log('✅ Hot Reload connected', 'connected');
|
|
});
|
|
|
|
eventSource.addEventListener('message', function(event) {
|
|
log('📨 Message: ' + event.data);
|
|
});
|
|
|
|
eventSource.addEventListener('connected', function(event) {
|
|
const data = JSON.parse(event.data);
|
|
log('🔗 Connected: ' + data.message, 'connected');
|
|
});
|
|
|
|
eventSource.addEventListener('reload', function(event) {
|
|
const data = JSON.parse(event.data);
|
|
log('🔄 Reload event: ' + data.message + ' (' + data.type + ')', 'warning');
|
|
|
|
// Handle different reload types
|
|
if (data.type === 'css') {
|
|
log('♻️ Hot-reloading CSS...', 'connected');
|
|
// Reload CSS files
|
|
document.querySelectorAll('link[rel="stylesheet"]').forEach(link => {
|
|
const href = link.href;
|
|
link.href = href + (href.includes('?') ? '&' : '?') + 't=' + Date.now();
|
|
});
|
|
} else if (data.type === 'full') {
|
|
log('🔄 Full page reload in 2 seconds...', 'warning');
|
|
setTimeout(() => {
|
|
window.location.reload();
|
|
}, 2000);
|
|
} else if (data.type === 'hmr') {
|
|
log('⚡ HMR update detected', 'connected');
|
|
// HMR would be handled by build tools like Vite
|
|
}
|
|
});
|
|
|
|
eventSource.addEventListener('heartbeat', function(event) {
|
|
log('💓 Heartbeat received');
|
|
});
|
|
|
|
eventSource.addEventListener('error', function(error) {
|
|
statusDiv.textContent = 'Connection error';
|
|
statusDiv.className = 'error';
|
|
statusDiv.style.color = 'red';
|
|
log('❌ Connection error - retrying...', 'error');
|
|
});
|
|
|
|
// Test file change simulation after 3 seconds
|
|
setTimeout(() => {
|
|
log('🧪 Hot Reload system is ready! Try editing a PHP file in src/ to see live reloading.', 'connected');
|
|
}, 3000);
|
|
|
|
// Clean up on page unload
|
|
window.addEventListener('beforeunload', function() {
|
|
eventSource.close();
|
|
});
|
|
}); |