Fix Frontend: Use addEventListener instead of onclick, add debug logs, cache bust

This commit is contained in:
2025-12-27 23:19:41 +11:00
parent f7a1f1be42
commit 04245e33ae
2 changed files with 12 additions and 2 deletions

View File

@@ -7,7 +7,7 @@
<meta name="description" content="Beyond Cloud Technology Project Base"> <meta name="description" content="Beyond Cloud Technology Project Base">
<title>Beyond Cloud Technology - Project Base</title> <title>Beyond Cloud Technology - Project Base</title>
<link rel="icon" type="image/png" href="Logo.png"> <link rel="icon" type="image/png" href="Logo.png">
<link rel="stylesheet" href="styles.css?v=2.1"> <link rel="stylesheet" href="styles.css?v=2.2">
</head> </head>
<body> <body>
@@ -63,7 +63,7 @@
</div> </div>
</div> </div>
<button id="run-btn" class="btn-primary" onclick="runTest()"> <button id="run-btn" class="btn-primary">
<span>Run Test</span> <span>Run Test</span>
<div id="loading-spinner" class="loading-spinner" style="display: none;"></div> <div id="loading-spinner" class="loading-spinner" style="display: none;"></div>
</button> </button>

View File

@@ -35,6 +35,7 @@ function setLoading(isLoading) {
// ============================================================================ // ============================================================================
async function runTest() { async function runTest() {
console.log('Run Test triggered');
const urlInput = document.getElementById('test-url'); const urlInput = document.getElementById('test-url');
const url = urlInput.value.trim(); const url = urlInput.value.trim();
const errorMsg = document.getElementById('error-msg'); const errorMsg = document.getElementById('error-msg');
@@ -213,6 +214,15 @@ document.addEventListener('DOMContentLoaded', () => {
updateVersionBadge(); updateVersionBadge();
loadHistory(); loadHistory();
// Attach event listener programmatically
const runBtn = document.getElementById('run-btn');
if (runBtn) {
runBtn.addEventListener('click', runTest);
console.log('Run Test button listener attached');
} else {
console.error('Run Test button not found');
}
// Auto-refresh Git badge // Auto-refresh Git badge
setInterval(updateVersionBadge, 5 * 60 * 1000); setInterval(updateVersionBadge, 5 * 60 * 1000);
}); });